]> Cypherpunks repositories - gostls13.git/commit
crypto/x509: don't panic when decrypting invalid PEM data.
authorAdam Langley <agl@golang.org>
Sun, 14 Jun 2015 23:41:31 +0000 (16:41 -0700)
committerRuss Cox <rsc@golang.org>
Fri, 26 Jun 2015 16:16:51 +0000 (16:16 +0000)
commit4ec946ce95226b9e1b5258bdc3d46090d828d896
tree6ea59f64a0ed2de59ab1932e2a7ea2075d086c58
parentc248aaef7049c9c90af787d7fa91de378fa7e202
crypto/x509: don't panic when decrypting invalid PEM data.

If an encrypted PEM block contained ciphertext that was not a multiple
of the block size then the code would panic. This change tests for that
case and returns an error.

Fixes #11215.

Change-Id: I7b700f99e20810c4f545519b1e9d766b4640e8a7
Reviewed-on: https://go-review.googlesource.com/11097
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
src/crypto/x509/pem_decrypt.go
src/crypto/x509/pem_decrypt_test.go