Commit Graph
6 Commits
Author SHA1 Message Date
Vũ Thế Huy 69e8bf1ac3 fix(kms): validate KeyUsage against KeySpec on CreateKey (#2787) (#3004)
* fix(kms): validate KeyUsage against KeySpec on CreateKey (#2787)

* test(kms): boto3 coverage for CreateKey KeyUsage rejection (#2787)
2026-09-03 22:19:19 -04:00
TATSUNO “Taz” Yasuhiro ffe8a92635 perf(build): replace BouncyCastle with JDK crypto API as much as possible (#2988)
* perf(security): stop registering the BouncyCastle JCE provider

ACM signs through the JDK and builds PBES2 there, and KMS PSS
uses RSASSA-PSS with the parameters AWS specifies.
Downsize Docker image from 88.7 to 83.9 MB gzipped.

* test(compat): verify the native image's KMS and ACM crypto from outside Floci

Floci verifying its own signature proves nothing. Signatures now check against
GetPublicKey with an outside library, exported keys are decrypted, and issued
certificates verify their own signature.

* fix(kms): apply real PSS padding when signing a digest with RSASSA_PSS

* fix(acm): set the PBES2 salt and iteration count explicitly

* perf(kms): reuse the shared SecureRandom when signing a PSS digest

* fix(kms): let AwsException pass through the sign and verify catch blocks

* perf(native): drop the native-image config the BouncyCastle provider needed

Five --initialize-at-run-time entries and 21 reflect-config entries existed
for the BouncyCastle JCE provider. Nothing registers that provider any more,
so they only kept dead initialization code in the image.

The run-time initialization entries are what cost size. Removing them takes
the binary from 204.6 to 203.1 MB and gzip -9 from 79.5 to 78.9 MB. The
reflect-config entries measured as noise, because those classes stay
registered through another path, but they still describe a provider Floci
no longer installs.

Verified on a native build. The Python suite passes 354 tests, the Java SDK
suite passes 61 including CloudHSM v2 and ACM, and a TLS run generates its
self-signed certificate and signs with secp256k1 over HTTPS.
2026-09-03 21:49:52 -04:00
TATSUNO “Taz” Yasuhiro 146753b094 fix(kms): give ECC_NIST_EDWARDS25519 an actual Ed25519 key (#2930)
* fix(kms): give ECC_NIST_EDWARDS25519 an actual Ed25519 key

The spec carried secp521r1 from the line above it, so it made an EC key and every
Sign failed. Ed25519 now has its own key type. Message type rules and errors match
real KMS, measured in ap-northeast-1.

Closes #2924

* fix(kms): reject an ED25519_PH_SHA_512 digest of the wrong length

Sign and Verify took any DIGEST value, where real KMS requires exactly one
SHA-512 digest and answers otherwise with a ValidationException. Measured in
ap-northeast-1 against both operations.
2026-09-02 11:29:15 -04:00
nblomquist 30a598f080 feat(kms): add GenerateRandom action (#1036)
- Add GenerateRandom action routing and handler in KmsJsonHandler
- Add SecureRandom field, constructor overload, and generateRandom() method with bounds validation
- Reject unsupported Recipient and CustomKeyStoreId fields
- Add integration tests for happy path, boundaries, validation, and unsupported fields
- Add SDK compatibility tests for Java, Python, and Node
2026-06-03 17:42:40 -05:00
nblomquist 9d1e24a582 feat(kms) Add KMS Grant APIs (#1073)
* test(kms): add grant compatibility contracts

* feat(kms): support empty ListGrants

* feat(kms): add CreateGrant and persisted ListGrants round trip

* test(kms): add create grant round trip coverage

* feat(kms): add grant pagination, filters, and ListRetirableGrants

* test(kms): add pagination, filter, and retirable grant coverage

* feat(kms): add RevokeGrant administrative delete

* test(kms): add RevokeGrant unit and integration coverage

* feat(kms): add RetireGrant with token and key+grant retirement paths

* docs(kms): document grant lifecycle operations and enforcement scope

* fix(kms): include RetiringPrincipal in ListGrants response

The handleListGrants handler was omitting RetiringPrincipal from the
JSON response even when the grant had one set. This meant grants
created with a retiring principal were invisible through ListGrants,
while ListRetirableGrants worked fine. Adds the missing serialization
to match the GrantListEntry AWS spec.
2026-05-28 18:36:02 -05:00
Conor Heine eeefb729c4 test: move compatibility tests into this repo (#225)
* test: move compatibility tests into this repo
* fix: add StatisticValues parsing to CloudWatchMetricsJsonHandler
* fix: add missing required abstract methods to EmulatorConfig in EventBridgeSchedulerIntegrationTest
* test: add sdk tests for multipart S3 copy coverage
* fix: cover and fix smithy cbor and multipart s3 copy regressions
* test: migrate more test coverage to new folder
* test: add missing ec2 expectation in healthcheck test
* docs: update READMEs in `./compatibility-tests`
2026-04-06 09:35:53 -05:00