Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openssl_quantum: init at 3.3.2 #364167

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions pkgs/development/libraries/openssl/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
fetchurl,
buildPackages,
perl,
oqs-provider,
coreutils,
writeShellScript,
makeBinaryWrapper,
Expand All @@ -20,6 +21,9 @@
conf ? null,
removeReferencesTo,
testers,
providers ? [ ],
autoloadProviders ? false,
extraConfig ? null,
}:

# Note: this package is used for bootstrapping fetchurl, and thus
Expand Down Expand Up @@ -275,6 +279,30 @@ let
''
+ lib.optionalString (conf != null) ''
cat ${conf} > $etc/etc/ssl/openssl.cnf
''

+ lib.concatStringsSep "\n" (
map
(provider: ''
cp --no-preserve=mode ${provider.package}/lib/ossl-modules/* "$out/lib/ossl-modules"

${lib.optionalString (autoloadProviders) ''
sed -i '/^[[:space:]]*#/!s/\[provider_sect\]/[provider_sect]\n${provider.name} = ${provider.name}_sect/g' $etc/etc/ssl/openssl.cnf
echo "[${provider.name}_sect]" >> $etc/etc/ssl/openssl.cnf
echo "activate = 1" >> $etc/etc/ssl/openssl.cnf
''}
'')

providers
)

+ lib.optionalString (autoloadProviders) ''
# The default provider needs loading when there are other providers loaded by default
sed -i '/^[[:space:]]*#/!s/\[default_sect\]/[default_sect]\nactivate = 1/g' $etc/etc/ssl/openssl.cnf
''

+ lib.optionalString (extraConfig != null) ''
echo "${extraConfig}" >> $etc/etc/ssl/openssl.cnf
'';

postFixup =
Expand Down
15 changes: 15 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10458,6 +10458,21 @@ with pkgs;

openssl = openssl_3_3;

openssl_quantum = openssl.override {
providers = [
{
name = "oqsprovider";
package = pkgs.oqs-provider;
}
];
autoloadProviders = true;
# TLS groups should be post quantum by default
extraConfig = ''
[tls_system_default]
Groups = X25519MLKEM768:x25519_kyber768:x25519:P-521:prime256v1
'';
};

openssl_legacy = openssl.override {
conf = ../development/libraries/openssl/3.0/legacy.cnf;
};
Expand Down