File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -168,10 +168,12 @@ func TestParsePEMPrivateKey(t *testing.T) {
168168
169169 pemPrivateKey := PEMEncode (privateKey )
170170
171- // Decoding a key should work and create an identical key to the original
171+ // Decoding a key should work and create an identical RSA key to the original,
172+ // ignoring precomputed values.
172173 decoded , err := ParsePEMPrivateKey (pemPrivateKey )
173174 require .NoError (t , err )
174- assert .Equal (t , decoded , privateKey )
175+ decodedRsaPrivateKey := decoded .(* rsa.PrivateKey )
176+ require .True (t , decodedRsaPrivateKey .Equal (privateKey ))
175177
176178 // Decoding a PEM block that doesn't contain a private key should error
177179 _ , err = ParsePEMPrivateKey (pem .EncodeToMemory (& pem.Block {Type : "CERTIFICATE" }))
You can’t perform that action at this time.
0 commit comments