]> Cypherpunks repositories - gostls13.git/commit
crypto/x509: return error for missing SerialNumber.
authorAdam Langley <agl@golang.org>
Wed, 17 Aug 2016 20:15:28 +0000 (13:15 -0700)
committerAdam Langley <agl@golang.org>
Wed, 17 Aug 2016 23:23:18 +0000 (23:23 +0000)
commitb23b9a762c4f876a9f7575fa512074a386e3c6e1
tree2a5c5b1ffe419c57e7d0c8211479aaec7701544c
parentc2322b7ea60f85b4fd3d566b17ab3f7dcb865c1a
crypto/x509: return error for missing SerialNumber.

If the SerialNumber is nil in the template then the resulting panic is
rather deep in encoding/asn1 and it's not obvious what went wrong.

This change tests and returns a more helpful error in this case.

Fixes #16603.

Change-Id: Ib30d652555191eb78f705dff8d909e4b5808f9ca
Reviewed-on: https://go-review.googlesource.com/27238
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/crypto/x509/x509.go