-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
KMS: fix HMAC key import and add validated tests for HMAC and ECC key specs #12952
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
LocalStack Community integration with Pro 2 files ± 0 2 suites ±0 4m 37s ⏱️ - 1h 36m 51s Results for commit 875f432. ± Comparison against base commit 29690c2. This pull request removes 3897 and adds 8 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
Test Results (amd64) - Integration, Bootstrap 5 files 5 suites 17m 7s ⏱️ Results for commit 875f432. ♻️ This comment has been updated with latest results. |
ef901ca
to
875f432
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice fix, LGTM 🚀
Motivation
Fix key import for all HMAC key specs
HMAC_224
,HMAC_256
,HMAC_384
,HMAC_512
. Previously, importingEXTERNAL
origin HMAC keys failed with the following error:An error occurred (InternalError) when calling the ImportKeyMaterial operation (reached max retries: 2): exception while calling kms.ImportKeyMaterial: ('Could not deserialize key data. The data may be in an incorrect format, it may be encrypted with an unsupported algorithm, or it may be an unsupported key type (e.g. EC curves with explicit parameters).', [<OpenSSLError(code=109052072, lib=13, reason=168, reason_text=wrong tag)>, <OpenSSLError(code=109576458, lib=13, reason=524554, reason_text=nested asn1 error)>])
Changes
The key material gets loaded correctly and accepts raw key material for all HMAC specs and not just
SYMMETRIC_DEFAULT
and add AWS validated testtest_import_key_hmac_keys
covering import, mac generation and verification for all HMAC key specs.This PR also adds test
test_import_key_ecc_keys
to validate correct import, sign, verification and usage for all ECC key specs:ECC_NIST_P256
,ECC_NIST_P384
,ECC_NIST_P521
,ECC_SECG_P256K1
as a user reported issues with it in a github issue comments and Localstack community channel.Closes #10909