kjur / jsrsasign

The 'jsrsasign' (RSA-Sign JavaScript Library) is an opensource free cryptography library supporting RSA/RSAPSS/ECDSA/DSA signing/validation, ASN.1, PKCS#1/5/8 private/public key, X.509 certificate, CRL, OCSP, CMS SignedData, TimeStamp, CAdES and JSON Web Signature/Token in pure JavaScript.
https://kjur.github.io/jsrsasign
Other
3.25k stars 646 forks source link

Uppercase hex string support #567

Closed mikecat closed 1 year ago

mikecat commented 1 year ago

In current version, uppercase hex string doesn't looks supported in functions that parses hex strings.

For example, looking at the code of ASN1HEX.dump():

The tag is compared to only lowercase string:

https://github.com/kjur/jsrsasign/blob/c665ebcebc62cc7e55ffadbf2efec7ef89279b00/src/asn1hex-1.1.js#L914

The tag is not converted to lowercase before comparing:

https://github.com/kjur/jsrsasign/blob/c665ebcebc62cc7e55ffadbf2efec7ef89279b00/src/asn1hex-1.1.js#L846-L866

There looks other functions that has similar problem.

kjur commented 1 year ago

Please use lower case hexadecimal in jsrsasign because most part of jsrsasign assumes so. I'll add notes for it in the all part of API document in the future. Thank you.