DescriptionCheck trailing data when parsing ASN.1.
Properly check that the entire buffer was consumed. d2i_* may process only a
prefix of its input. In addition, don't bother using a memory BIO when the
buffer can be parsed directly.
This aligns the NSS and OpenSSL port's behavior in most places:
SEC_QuickDERDecodeItem fails with SEC_ERROR_EXTRA_INPUT if there is excess data.
Add tests. Both for testing and to verify this is the NSS port's behavior.
For a PKCS #8 PrivateKeyInfo, NSS will silently accept trailing data. Fix
WebCrypto in NSS to align with the spec. RSAPrivateKey is left for a follow-up. (This includes an NSS roll to pick up a symbol export.)
BUG=430200
Committed: https://crrev.com/40af916dfb14ca12890e3a7cf8b50d8e62c69695
Cr-Commit-Position: refs/heads/master@{#303546}
Patch Set 1 : just the tests #Patch Set 2 : actually do the change #Patch Set 3 : actually append junk to the data #Patch Set 4 : Bah, NSS #Patch Set 5 : rebase #Patch Set 6 : NSS... #
Total comments: 2
Patch Set 7 : Roll NSS #Patch Set 8 : rebase #
Messages
Total messages: 14 (6 generated)
|