public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/perl/, dev-lang/perl/files/
Date: Thu, 25 May 2023 21:52:31 +0000 (UTC)	[thread overview]
Message-ID: <1685051527.3ea685044d49945fffc7b62f82a6d3fb9d7ba37a.sam@gentoo> (raw)

commit:     3ea685044d49945fffc7b62f82a6d3fb9d7ba37a
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu May 25 08:16:44 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu May 25 21:52:07 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3ea68504

dev-lang/perl: update HTTP::Tiny SSL-verify-by-default patch

Thanks to Stig for pointing this out! Pull in the fixed version from nixpkgs,
like Alpine has done.

Bug: https://bugs.gentoo.org/905296
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-lang/perl/files/perl-5.36.1-http-tiny.patch    | 71 +++++++++++++++++++---
 ...perl-5.36.1-r1.ebuild => perl-5.36.1-r2.ebuild} |  0
 2 files changed, 63 insertions(+), 8 deletions(-)

diff --git a/dev-lang/perl/files/perl-5.36.1-http-tiny.patch b/dev-lang/perl/files/perl-5.36.1-http-tiny.patch
index 34907cc6d9fd..2144b4d4ff86 100644
--- a/dev-lang/perl/files/perl-5.36.1-http-tiny.patch
+++ b/dev-lang/perl/files/perl-5.36.1-http-tiny.patch
@@ -1,19 +1,35 @@
-in current year, we should verify tls certs by default.
-not doing so is as good as not using tls
-https://www.openwall.com/lists/oss-security/2023/04/18/14
-
 Source:
-https://git.alpinelinux.org/aports/plain/main/perl/default-https-perl-http-tiny.patch?id=fc21c0f7930ae3a9e2f50bacc305fb167a456ded
+https://github.com/NixOS/nixpkgs/blob/5b709277f48df630c8fa7aab0cf6157f71a5b45c/pkgs/development/interpreters/perl/http-tiny-verify-ssl-by-default.patch
 
 Bug: https://bugs.gentoo.org/905296
 See-also: https://github.com/chansen/p5-http-tiny/pull/151
 See-also: https://github.com/chansen/p5-http-tiny/issues/152
-
+See-also: https://www.openwall.com/lists/oss-security/2023/04/18/14
 --
-diff --git a/cpan/HTTP-Tiny/lib/HTTP/Tiny.pm b/cpan/HTTP-Tiny/lib/HTTP/Tiny.pm
-index 83ca06d..dc6217a 100644
+Patch for HTTP::Tiny that defaults verify_SSL to 1
+
+Based on proposed Debian patch by Dominic Hargreaves:
+https://salsa.debian.org/perl-team/interpreter/perl/-/commit/1490431e40e22052f75a0b3449f1f53cbd27ba92
 --- a/cpan/HTTP-Tiny/lib/HTTP/Tiny.pm
 +++ b/cpan/HTTP-Tiny/lib/HTTP/Tiny.pm
+@@ -41,7 +41,7 @@ sub _croak { require Carp; Carp::croak(@_) }
+ #pod   read or write takes longer than the timeout, the request response status code
+ #pod   will be 599.
+ #pod * C<verify_SSL> — A boolean that indicates whether to validate the SSL
+-#pod   certificate of an C<https> — connection (default is false)
++#pod   certificate of an C<https> — connection (default is true)
+ #pod * C<SSL_options> — A hashref of C<SSL_*> — options to pass through to
+ #pod   L<IO::Socket::SSL>
+ #pod
+@@ -115,7 +115,7 @@ sub new {
+         max_redirect => 5,
+         timeout      => defined $args{timeout} ? $args{timeout} : 60,
+         keep_alive   => 1,
+-        verify_SSL   => $args{verify_SSL} || $args{verify_ssl} || 0, # no verification by default
++        verify_SSL   => $args{verify_SSL} // $args{verify_ssl} // 1, # verification by default
+         no_proxy     => $ENV{no_proxy},
+     };
+ 
 @@ -1055,7 +1055,7 @@ sub new {
          timeout          => 60,
          max_line_size    => 16384,
@@ -23,3 +39,42 @@ index 83ca06d..dc6217a 100644
          SSL_options      => {},
          %args
      }, $class;
+@@ -1797,7 +1797,7 @@ C<timeout> — Request timeout in seconds (default is 60) If a socket open, read
+ 
+ =item *
+ 
+-C<verify_SSL> — A boolean that indicates whether to validate the SSL certificate of an C<https> — connection (default is false)
++C<verify_SSL> — A boolean that indicates whether to validate the SSL certificate of an C<https> — connection (default is true)
+ 
+ =item *
+ 
+@@ -2069,7 +2069,7 @@ Verification of server identity
+ 
+ =back
+ 
+-B<By default, HTTP::Tiny does not verify server identity>.
++B<By default, HTTP::Tiny in Gentoo verifies server identity>.
+ 
+ Server identity verification is controversial and potentially tricky because it
+ depends on a (usually paid) third-party Certificate Authority (CA) trust model
+@@ -2077,16 +2077,14 @@ to validate a certificate as legitimate.  This discriminates against servers
+ with self-signed certificates or certificates signed by free, community-driven
+ CA's such as L<CAcert.org|http://cacert.org>.
+ 
+-By default, HTTP::Tiny does not make any assumptions about your trust model,
+-threat level or risk tolerance.  It just aims to give you an encrypted channel
+-when you need one.
+-
+ Setting the C<verify_SSL> attribute to a true value will make HTTP::Tiny verify
+ that an SSL connection has a valid SSL certificate corresponding to the host
+ name of the connection and that the SSL certificate has been verified by a CA.
+ Assuming you trust the CA, this will protect against a L<man-in-the-middle
+-attack|http://en.wikipedia.org/wiki/Man-in-the-middle_attack>.  If you are
+-concerned about security, you should enable this option.
++attack|http://en.wikipedia.org/wiki/Man-in-the-middle_attack>.
++
++If you are not concerned about security, and this default in Gentoo causes
++problems, you should disable this option.
+ 
+ Certificate verification requires a file containing trusted CA certificates.
+ 

diff --git a/dev-lang/perl/perl-5.36.1-r1.ebuild b/dev-lang/perl/perl-5.36.1-r2.ebuild
similarity index 100%
rename from dev-lang/perl/perl-5.36.1-r1.ebuild
rename to dev-lang/perl/perl-5.36.1-r2.ebuild


             reply	other threads:[~2023-05-25 21:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-25 21:52 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-10-03 20:42 [gentoo-commits] repo/gentoo:master commit in: dev-lang/perl/, dev-lang/perl/files/ Sam James
2024-12-07  2:59 Sam James
2024-09-11 18:54 Sam James
2021-10-28  3:53 Sam James
2021-07-19 21:20 Andreas K. Hüttel
2020-12-26 13:37 Fabian Groffen
2020-06-20 13:06 Kent Fredric

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1685051527.3ea685044d49945fffc7b62f82a6d3fb9d7ba37a.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox