]> Cypherpunks repositories - gostls13.git/commitdiff
crypto/x509: return err if marshalPublicKey fails to marshal an rsa public key
authorTarmigan Casebolt <tarmigan@gmail.com>
Mon, 24 Aug 2015 02:51:16 +0000 (19:51 -0700)
committerAdam Langley <agl@golang.org>
Fri, 18 Sep 2015 21:48:10 +0000 (21:48 +0000)
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>

src/crypto/x509/x509.go

index be6c013464b40eae1a8e881b4aa51ccf7d71dd41..0431f87cd00ac23a219b97b3f47b7831701d21bc 100644 (file)
@@ -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