mirror of https://github.com/golang/go.git
crypto/x509: return err if marshalPublicKey fails to marshal an rsa public key
Change-Id: I9bd5c1b66fd90f0b54bd1a8f3e57b6830d2b7733 Reviewed-on: https://go-review.googlesource.com/13846 Reviewed-by: Adam Langley <agl@golang.org> Run-TryBot: Adam Langley <agl@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
c0ca9f46d8
commit
7360638da0
|
|
@ -56,6 +56,9 @@ func marshalPublicKey(pub interface{}) (publicKeyBytes []byte, publicKeyAlgorith
|
|||
N: pub.N,
|
||||
E: pub.E,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, pkix.AlgorithmIdentifier{}, err
|
||||
}
|
||||
publicKeyAlgorithm.Algorithm = oidPublicKeyRSA
|
||||
// This is a NULL parameters value which is technically
|
||||
// superfluous, but most other code includes it and, by
|
||||
|
|
|
|||
Loading…
Reference in New Issue