Skip to content

Reject imported EC and RSA keys with trailing bytes#251

Open
harrshita123 wants to merge 1 commit intogoogle:masterfrom
harrshita123:fix-cbs-empty-after-import
Open

Reject imported EC and RSA keys with trailing bytes#251
harrshita123 wants to merge 1 commit intogoogle:masterfrom
harrshita123:fix-cbs-empty-after-import

Conversation

@harrshita123
Copy link

This change ensures that all bytes supplied during key import are consumed by BoringSSL.

EC and RSA private/public key imports now verify that the CBS is empty after parsing, rejecting inputs with trailing bytes. This resolves the TODO in EC public key import and aligns behavior with WebCrypto implementations.

Tests for malformed key bytes are not included here, as generating invalid key material is currently blocked by #55.

Related to #60.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant