-
Notifications
You must be signed in to change notification settings - Fork 7
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
Conversation
@@ -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}, |
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.
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 { |
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.
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
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.
👍
use aws_nitro_enclaves_nsm_api::api::AttestationDoc; | ||
use p384::{ | ||
ecdsa::{signature::hazmat::PrehashVerifier, Signature, VerifyingKey}, |
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.
hazmat
is very ominous... should we be worried about this??
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.
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)) |
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.
Have you done any research to know that this will always be the case?
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.
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
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.
Looks solid to me. Left a couple comments, but nothing blocking this from getting merged
No description provided.