]> Cypherpunks repositories - gostls13.git/commit
crypto/rsa: left-pad OAEP results when needed.
authorAdam Langley <agl@golang.org>
Fri, 18 Feb 2011 16:31:10 +0000 (11:31 -0500)
committerAdam Langley <agl@golang.org>
Fri, 18 Feb 2011 16:31:10 +0000 (11:31 -0500)
commit193709736fd7d43c407bf73841fa6dbfca8fbbb3
treee0b0ec25414f3c5cda142ced787e661c86a210af
parent547918e3632121cd2fa40e8d6d8f5f0b2e2778c2
crypto/rsa: left-pad OAEP results when needed.

PKCS#1 v2.1 section 7.1.1 says that the result of an OAEP encryption
is "an octet string of length $k$". Since we didn't left-pad the
result it was previously possible for the result to be smaller when
the most-significant byte was zero.

Fixes #1519.

R=rsc
CC=golang-dev
https://golang.org/cl/4175059
src/pkg/crypto/rsa/rsa.go
src/pkg/crypto/rsa/rsa_test.go