Skip to content

Commit eae4496

Browse files
committed
[release-branch.go1] crypto/rsa: add SHA-224 hash prefix
««« backport c6213d8a9118 crypto/rsa: add SHA-224 hash prefix http://www.rsa.com/rsalabs/node.asp?id=2125: NOTE: A new OID has been defined for the combination of the v1.5 signature scheme and the SHA-224 hash function: sha224WithRSAEncryption OBJECT IDENTIFIER ::= Like the other sha*WithRSAEncryption OIDs in PKCS #1 v2.1, this OID has NULL parameters. The DigestInfo encoding for SHA-224 (see Section 9.2, Note 1) is: (0x)30 2d 30 0d 06 09 60 86 48 01 65 03 04 02 04 05 00 04 1c || H R=golang-dev, agl CC=golang-dev https://golang.org/cl/6208076 »»»
1 parent f5a5f17 commit eae4496

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/pkg/crypto/rsa/pkcs1v15.go

+1
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ func nonZeroRandomBytes(s []byte, rand io.Reader) (err error) {
151151
var hashPrefixes = map[crypto.Hash][]byte{
152152
crypto.MD5: {0x30, 0x20, 0x30, 0x0c, 0x06, 0x08, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x02, 0x05, 0x05, 0x00, 0x04, 0x10},
153153
crypto.SHA1: {0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 0x2b, 0x0e, 0x03, 0x02, 0x1a, 0x05, 0x00, 0x04, 0x14},
154+
crypto.SHA224: {0x30, 0x2d, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x04, 0x05, 0x00, 0x04, 0x1c},
154155
crypto.SHA256: {0x30, 0x31, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x05, 0x00, 0x04, 0x20},
155156
crypto.SHA384: {0x30, 0x41, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x02, 0x05, 0x00, 0x04, 0x30},
156157
crypto.SHA512: {0x30, 0x51, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x03, 0x05, 0x00, 0x04, 0x40},

0 commit comments

Comments
 (0)