Skip to content

Remove openssl from qos_attest #156

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

Merged
merged 6 commits into from
Nov 1, 2022
Merged

Conversation

emostov
Copy link
Contributor

@emostov emostov commented Nov 1, 2022

No description provided.

@emostov emostov requested a review from jack-kearney November 1, 2022 02:48
@@ -1,17 +1,22 @@
//! Logic for decoding and validating the Nitro Secure Module Attestation
//! Document.

use aws_nitro_enclaves_cose::CoseSign1;
use aws_nitro_enclaves_cose::{
crypto::{Hash, MessageDigest, SignatureAlgorithm, SigningPublicKey},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that SigningPublicKey is a trait we implement to allow us to use an arbitrary public key to verify signatures against for the COSE Sign1 crate.

.map_err(|e| CoseError::SignatureError(Box::new(e)))
}
}
impl SigningPublicKey for P384PrivateKey {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case this is confusing, SigningPrivateKey is a super trait of SigningPublicKey, so we need to implement both for the private key to get things to compile

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

use aws_nitro_enclaves_nsm_api::api::AttestationDoc;
use p384::{
ecdsa::{signature::hazmat::PrehashVerifier, Signature, VerifyingKey},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hazmat is very ominous... should we be worried about this??

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically a warning that these are low-level API's that should only be used by experts: https://docs.rs/ecdsa/0.11.1/ecdsa/hazmat/index.html

fn get_parameters(
&self,
) -> Result<(SignatureAlgorithm, MessageDigest), CoseError> {
Ok((SignatureAlgorithm::ES384, MessageDigest::Sha384))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you done any research to know that this will always be the case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't have research other then talking to Lance and knowing this it what works with all the attestation docs we have gotten. Important to note that verification will fail if it is signed with a different type of key so its not really a security issue but more of a liveliness issue if this ever changes

Copy link
Contributor

@jack-kearney jack-kearney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks solid to me. Left a couple comments, but nothing blocking this from getting merged

@emostov emostov merged commit 7e972bf into master Nov 1, 2022
@emostov emostov deleted the zeke-remove-openssl-from-attest branch November 1, 2022 17:05
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.

2 participants