File tree 3 files changed +17
-4
lines changed 3 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -38,11 +38,17 @@ Forge ChangeLog
38
38
DER parsing may need to adapt to this new behavior and optional flag.
39
39
- [ rsa] Add and use a validator to check for proper structure of parsed ASN.1
40
40
` RSASSA-PKCS-v1_5 ` ` DigestInfo ` data. Additionally check that the hash
41
- algorithm identifier is a known value. An invalid ` DigestInfo ` or algorithm
42
- identifier will now cause an error to be thrown.
41
+ algorithm identifier is a known value from RFC 8017
42
+ ` PKCS1-v1-5DigestAlgorithms ` . An invalid ` DigestInfo ` or algorithm identifier
43
+ will now cause an error to be thrown.
43
44
44
45
### Added
45
- - [ oid] Added ` 1.2.840.113549.2.2 ` / ` md2 ` for hash algorithm checking.
46
+ - [ oid] Added missing RFC 8017 PKCS1-v1-5DigestAlgorithms algorithm
47
+ identifiers:
48
+ - ` 1.2.840.113549.2.2 ` / ` md2 `
49
+ - ` 2.16.840.1.101.3.4.2.4 ` / ` sha224 `
50
+ - ` 2.16.840.1.101.3.4.2.5 ` / ` sha512-224 `
51
+ - ` 2.16.840.1.101.3.4.2.6 ` / ` sha512-256 `
46
52
47
53
## 1.2.1 - 2022-01-11
48
54
Original file line number Diff line number Diff line change @@ -47,6 +47,9 @@ _IN('1.3.14.3.2.29', 'sha1WithRSASignature');
47
47
_IN ( '2.16.840.1.101.3.4.2.1' , 'sha256' ) ;
48
48
_IN ( '2.16.840.1.101.3.4.2.2' , 'sha384' ) ;
49
49
_IN ( '2.16.840.1.101.3.4.2.3' , 'sha512' ) ;
50
+ _IN ( '2.16.840.1.101.3.4.2.4' , 'sha224' ) ;
51
+ _IN ( '2.16.840.1.101.3.4.2.5' , 'sha512-224' ) ;
52
+ _IN ( '2.16.840.1.101.3.4.2.6' , 'sha512-256' ) ;
50
53
_IN ( '1.2.840.113549.2.2' , 'md2' ) ;
51
54
_IN ( '1.2.840.113549.2.5' , 'md5' ) ;
52
55
Original file line number Diff line number Diff line change @@ -1169,14 +1169,18 @@ pki.setRsaPublicKey = pki.rsa.setPublicKey = function(n, e) {
1169
1169
throw error ;
1170
1170
}
1171
1171
// check hash algorithm identifier
1172
+ // see PKCS1-v1-5DigestAlgorithms in RFC 8017
1172
1173
// FIXME: add support to vaidator for strict value choices
1173
1174
var oid = asn1 . derToOid ( capture . algorithmIdentifier ) ;
1174
1175
if ( ! ( oid === forge . oids . md2 ||
1175
1176
oid === forge . oids . md5 ||
1176
1177
oid === forge . oids . sha1 ||
1178
+ oid === forge . oids . sha224 ||
1177
1179
oid === forge . oids . sha256 ||
1178
1180
oid === forge . oids . sha384 ||
1179
- oid === forge . oids . sha512 ) ) {
1181
+ oid === forge . oids . sha512 ||
1182
+ oid === forge . oids [ 'sha512-224' ] ||
1183
+ oid === forge . oids [ 'sha512-256' ] ) ) {
1180
1184
var error = new Error (
1181
1185
'Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.' ) ;
1182
1186
error . oid = oid ;
You can’t perform that action at this time.
0 commit comments