Regression #14635
closed"Legacy" strength PKCS#12 Export needs ``-legacy`` provider parameter on OpenSSL command
100%
Description
On current dev snapshots with OpenSSL 3.0, the "Legacy" strength PKCS#12 export (RC2-40+SHA1) is unsupported by default. Attempting to use it results in the page reloading without producing an export file.
The other levels (high and low) work as expected.
Adding -legacy
to the OpenSSL command parameters for that export strength enables the legacy provider and allows the command to work:
diff --git a/src/etc/inc/certs.inc b/src/etc/inc/certs.inc
index 46325aec1d..8c8ff1ae92 100644
--- a/src/etc/inc/certs.inc
+++ b/src/etc/inc/certs.inc
@@ -2655,7 +2655,7 @@ function cert_pkcs12_export($cert, $encryption = 'high', $passphrase = '', $add_
/* Encryption and Digest */
switch ($encryption) {
case 'legacy':
- $algo = '-certpbe PBE-SHA1-RC2-40 -keypbe PBE-SHA1-RC2-40';
+ $algo = '-legacy -certpbe PBE-SHA1-RC2-40 -keypbe PBE-SHA1-RC2-40';
$hash = '';
break;
case 'low':
A similar change will be needed inside the export package but it will need to be wrapped in a version test of some kind since that parameter will not work on OpenSSL 1.1.x I will start a separate issue for that.
Updated by Jim Pingle over 1 year ago
- Status changed from New to Feedback
- % Done changed from 0 to 100
Applied in changeset 9b9eaaeaa6cfa87c1320687836496d316aac61ef.
Updated by Chris Linstruth about 1 year ago
% openssl pkcs12 -legacy -info -in HA+OpenVPN+Server-Legacy.p12
MAC Iteration 2048
MAC verified OK
PKCS7 Encrypted data: pbeWithSHA1And40BitRC2-CBC, Iteration 2048
PKCS7 Data
Shrouded Keybag: pbeWithSHA1And40BitRC2-CBC, Iteration 2048
% openssl pkcs12 -info -in HA+OpenVPN+Server-Low.p12
MAC Iteration 2048
MAC verified OK
PKCS7 Encrypted data: pbeWithSHA1And3-KeyTripleDES-CBC, Iteration 2048
PKCS7 Data
Shrouded Keybag: pbeWithSHA1And3-KeyTripleDES-CBC, Iteration 2048
% openssl pkcs12 -info -in HA+OpenVPN+Server-High.p12
MAC: sha256, Iteration 2048
MAC length: 32, salt length: 8
PKCS7 Encrypted data: PBES2, PBKDF2, AES-256-CBC, Iteration 2048, PRF hmacWithSHA256
PKCS7 Data
Shrouded Keybag: PBES2, PBKDF2, AES-256-CBC, Iteration 2048, PRF hmacWithSHA256
Updated by Jim Pingle about 1 year ago
- Status changed from Feedback to Resolved
Looks good. When it failed it produced no file to download for the 'legacy' option at all, not even a 0-byte file.
Updated by Jim Pingle about 1 year ago
- Target version changed from 2.8.0 to 2.7.1