git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #137004 from baloo/baloo/openssl/3.0.0-init

openssl3: init at 3.0.0

commit83ab81ae89265e3051c34e86299df69a57d2362a authorJanne Heß <janne@hess.ooo> dateFri 5 Nov 2021, 13:02 (5 years ago) parent6d6ab8e613a0bf
6 files changed+63−3
pkgs/development/libraries/openssl/3.0/nix-ssl-cert-file.patch+15 pkgs/development/libraries/openssl/3.0/openssl-disable-kernel-detection.patch+22 pkgs/development/libraries/openssl/default.nix+24−2 pkgs/development/libraries/openssl/1.1/use-etc-ssl-certs-darwin.patch → pkgs/development/libraries/openssl/use-etc-ssl-certs-darwin.patch pkgs/development/libraries/openssl/1.1/use-etc-ssl-certs.patch → pkgs/development/libraries/openssl/use-etc-ssl-certs.patch pkgs/top-level/all-packages.nix+2−1
pkgs/development/libraries/openssl/3.0/nix-ssl-cert-file.patchnew file+15
@@ -0,0 +1,15 @@
1+diff --git a/crypto/x509/by_file.c b/crypto/x509/by_file.c
2+index 37d73ca84c..e328896234 100644
3+--- a/crypto/x509/by_file.c
4++++ b/crypto/x509/by_file.c
5+@@ -54,7 +54,9 @@ static int by_file_ctrl_ex(X509_LOOKUP *ctx, int cmd, const char *argp,
6+ switch (cmd) {
7+ case X509_L_FILE_LOAD:
8+ if (argl == X509_FILETYPE_DEFAULT) {
9+- file = ossl_safe_getenv(X509_get_default_cert_file_env());
10++ file = ossl_safe_getenv("NIX_SSL_CERT_FILE");
11++ if (!file)
12++ file = ossl_safe_getenv(X509_get_default_cert_file_env());
13+ if (file)
14+ ok = (X509_load_cert_crl_file_ex(ctx, file, X509_FILETYPE_PEM,
15+ libctx, propq) != 0);
pkgs/development/libraries/openssl/3.0/openssl-disable-kernel-detection.patchnew file+22
@@ -0,0 +1,22 @@
1+diff --git a/Configure b/Configure
2+index f0ad787bc4..a48d2008c6 100755
3+--- a/Configure
4++++ b/Configure
5+@@ -1688,17 +1688,6 @@ unless ($disabled{devcryptoeng}) {
6+ unless ($disabled{ktls}) {
7+ $config{ktls}="";
8+ if ($target =~ m/^linux/) {
9+- my $usr = "/usr/$config{cross_compile_prefix}";
10+- chop($usr);
11+- if ($config{cross_compile_prefix} eq "") {
12+- $usr = "/usr";
13+- }
14+- my $minver = (4 << 16) + (13 << 8) + 0;
15+- my @verstr = split(" ",`cat $usr/include/linux/version.h | grep LINUX_VERSION_CODE`);
16+-
17+- if ($verstr[2] < $minver) {
18+- disable('too-old-kernel', 'ktls');
19+- }
20+ } elsif ($target =~ m/^BSD/) {
21+ my $cc = $config{CROSS_COMPILE}.$config{CC};
22+ system("printf '#include <sys/types.h>\n#include <sys/ktls.h>' | $cc -E - >/dev/null 2>&1");
pkgs/development/libraries/openssl/default.nix+24−2
@@ -198,11 +198,33 @@ in {
198198 ./1.1/nix-ssl-cert-file.patch
199199
200200 (if stdenv.hostPlatform.isDarwin
201− then ./1.1/use-etc-ssl-certs-darwin.patch
202− else ./1.1/use-etc-ssl-certs.patch)
201+ then ./use-etc-ssl-certs-darwin.patch
202+ else ./use-etc-ssl-certs.patch)
203203 ] ++ lib.optionals (stdenv.isDarwin) [
204204 ./1.1/macos-yosemite-compat.patch
205205 ];
206206 withDocs = true;
207207 };
208+
209+ openssl_3_0 = common {
210+ version = "3.0.0";
211+ sha256 = "sha256-We7fy0bCUhTJvTftYHgpe03wHQEiZ/6enu4x9hvHBTY=";
212+ patches = [
213+ ./3.0/nix-ssl-cert-file.patch
214+
215+ # openssl will only compile in KTLS if the current kernel supports it.
216+ # This patch disables build-time detection.
217+ ./3.0/openssl-disable-kernel-detection.patch
218+
219+ (if stdenv.hostPlatform.isDarwin
220+ then ./use-etc-ssl-certs-darwin.patch
221+ else ./use-etc-ssl-certs.patch)
222+ ];
223+
224+ withDocs = true;
225+
226+ extraMeta = with lib; {
227+ license = licenses.asl20;
228+ };
229+ };
208230}
pkgs/development/libraries/openssl/1.1/use-etc-ssl-certs-darwin.patch → pkgs/development/libraries/openssl/use-etc-ssl-certs-darwin.patchrenamed

The content is the same.

pkgs/development/libraries/openssl/1.1/use-etc-ssl-certs.patch → pkgs/development/libraries/openssl/use-etc-ssl-certs.patchrenamed

The content is the same.

pkgs/top-level/all-packages.nix+2−1
@@ -18845,7 +18845,8 @@ with pkgs;
1884518845
1884618846 inherit (callPackages ../development/libraries/openssl { })
1884718847 openssl_1_0_2
18848− openssl_1_1;
18848+ openssl_1_1
18849+ openssl_3_0;
1884918850
1885018851 openssl-chacha = callPackage ../development/libraries/openssl/chacha.nix { };
1885118852