From dc488f967f49090829cfcda5b451e817433a64d1 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Mon, 14 Feb 2022 18:54:45 -0600 Subject: [PATCH] PKCS8: fix private key creation --- phpseclib/Crypt/DSA/Formats/Keys/PKCS8.php | 2 +- phpseclib/Crypt/RSA/Formats/Keys/PKCS8.php | 2 +- phpseclib/Crypt/RSA/Formats/Keys/PSS.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/phpseclib/Crypt/DSA/Formats/Keys/PKCS8.php b/phpseclib/Crypt/DSA/Formats/Keys/PKCS8.php index ab58c698..ff270595 100644 --- a/phpseclib/Crypt/DSA/Formats/Keys/PKCS8.php +++ b/phpseclib/Crypt/DSA/Formats/Keys/PKCS8.php @@ -141,7 +141,7 @@ abstract class PKCS8 extends Progenitor $params = ASN1::encodeDER($params, Maps\DSAParams::MAP); $params = new ASN1\Element($params); $key = ASN1::encodeDER($x, Maps\DSAPublicKey::MAP); - return self::wrapPrivateKey($key, [], $params, $password, $options); + return self::wrapPrivateKey($key, [], $params, $password, null, '', $options); } /** diff --git a/phpseclib/Crypt/RSA/Formats/Keys/PKCS8.php b/phpseclib/Crypt/RSA/Formats/Keys/PKCS8.php index 0bbdfe6e..206edccd 100644 --- a/phpseclib/Crypt/RSA/Formats/Keys/PKCS8.php +++ b/phpseclib/Crypt/RSA/Formats/Keys/PKCS8.php @@ -128,7 +128,7 @@ abstract class PKCS8 extends Progenitor { $key = PKCS1::savePrivateKey($n, $e, $d, $primes, $exponents, $coefficients); $key = ASN1::extractBER($key); - return self::wrapPrivateKey($key, [], null, $password, $options); + return self::wrapPrivateKey($key, [], null, $password, null, '', $options); } /** diff --git a/phpseclib/Crypt/RSA/Formats/Keys/PSS.php b/phpseclib/Crypt/RSA/Formats/Keys/PSS.php index be7224e5..544ae845 100644 --- a/phpseclib/Crypt/RSA/Formats/Keys/PSS.php +++ b/phpseclib/Crypt/RSA/Formats/Keys/PSS.php @@ -181,7 +181,7 @@ abstract class PSS extends Progenitor $key = PKCS1::savePrivateKey($n, $e, $d, $primes, $exponents, $coefficients); $key = ASN1::extractBER($key); $params = self::savePSSParams($options); - return self::wrapPrivateKey($key, [], $params, $password, $options); + return self::wrapPrivateKey($key, [], $params, $password, null, '', $options); } /**