Skip to content
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

Supported signature algorithms and key types are not documented - using unsupported key type leads to CLI panicking #631

Open
foersleo opened this issue Jun 27, 2024 · 0 comments
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@foersleo
Copy link
Contributor

For signing enclave images nitro-cli supports signatures using ECDSA as supported by COSE Sign1 (described in the RFC8152).

The implementation for that is in https://github.com/awslabs/aws-nitro-enclaves-cose

When using other key types (e.g. RSA) nitro-cli will panic:

$ sudo nitro-cli build-enclave --docker-uri  <dockeruri> --output-file test.eif --private-key rsa.pem --signing-certificate cert.pem

Start building the Enclave Image...
Using the locally available Docker image...
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: UnsupportedError("Non-EC keys are not supported")', /builddir/build/BUILD/aws-nitro-enclaves-cli-1.3.1/crates-dependencies/aws-nitro-enclaves-image-format/src/utils/mod.rs:298:18
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

The error is actually created in https://github.com/awslabs/aws-nitro-enclaves-cose/blob/main/src/crypto/openssl_pkey.rs#L62 and not properly propagated up through https://github.com/aws/aws-nitro-enclaves-image-format/blob/main/src/utils/mod.rs#L297-L301 to fail gracefully and provide a proper error message.

Further, this constraint on signing key types is not documented appropriately and needs to be called out.

@foersleo foersleo added bug Something isn't working documentation Improvements or additions to documentation labels Jun 27, 2024
@foersleo foersleo self-assigned this Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant