From: Tarmigan Casebolt Date: Mon, 24 Aug 2015 02:51:16 +0000 (-0700) Subject: crypto/x509: return err if marshalPublicKey fails to marshal an rsa public key X-Git-Tag: go1.6beta1~1030 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=7360638da09bed30bb32c183c9264f7f9f0bb8c9;p=gostls13.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 Run-TryBot: Adam Langley TryBot-Result: Gobot Gobot --- diff --git a/src/crypto/x509/x509.go b/src/crypto/x509/x509.go index be6c013464..0431f87cd0 100644 --- a/src/crypto/x509/x509.go +++ b/src/crypto/x509/x509.go @@ -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