From 0bbb50e072fb8fe5402be3961486fbdef0f78282 Mon Sep 17 00:00:00 2001 From: AdrianT Date: Thu, 13 Apr 2023 18:16:56 +1000 Subject: [PATCH] Fix `EncryptPKCS8PrivateKey` output incompatibility with OpenSSL --- pemutil/pkcs8.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pemutil/pkcs8.go b/pemutil/pkcs8.go index 62af8f93..13d6e8a2 100644 --- a/pemutil/pkcs8.go +++ b/pemutil/pkcs8.go @@ -324,7 +324,8 @@ func EncryptPKCS8PrivateKey(rand io.Reader, data, password []byte, alg x509.PEMC Salt: salt, IterationCount: PBKDF2Iterations, PrfParam: prfParam{ - Algo: oidHMACWithSHA256, + Algo: oidHMACWithSHA256, + NullParam: asn1.NullRawValue, }, }, },