Skip to content

Commit

Permalink
chore: replace final Ring code with RustCrypto
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Zak <[email protected]>
  • Loading branch information
rjzak authored and npmccallum committed Sep 29, 2022
1 parent ccfea94 commit b775ff9
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 121 deletions.
107 changes: 0 additions & 107 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ spki = { version = "0.6" }
x509 = { version = "0.1", features = ["std"], package = "x509-cert" }
rustls-pemfile = "0.3.0"
sha2 = "^0.10.2"
ring = { version = "0.16.20", features = ["std"] }
zeroize = { version = "^1.5.2", features = ["alloc"] }
flagset = "0.4.3"
sgx = { version = "0.5.0" }
Expand Down
9 changes: 0 additions & 9 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,9 @@ unlicensed = "deny"
copyleft = "deny"
default = "deny"
allow = [
"ISC",
"MIT",
"OpenSSL",
"AGPL-3.0",
"Apache-2.0",
"BSD-3-Clause",
"Unicode-DFS-2016",
]

[[licenses.clarify]]
name = "ring"
expression = "MIT AND ISC AND OpenSSL"
license-files = [
{ path = "LICENSE", hash = 0xbd0eed23 }
]
8 changes: 4 additions & 4 deletions src/ext/sgx/quote/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use body::Body;
use traits::{FromBytes, ParseBytes, Steal};

use der::Encode;
use ring::signature::UnparsedPublicKey;
use p256::ecdsa::signature::Verifier;
use sgx::ReportBody;
use sha2::{digest::DynDigest, Sha256};
use x509::TbsCertificate;
Expand Down Expand Up @@ -80,9 +80,9 @@ impl<'a> Quote<'a> {
}

// Verify the signature on the enclave report.
let alg = &ring::signature::ECDSA_P256_SHA256_ASN1;
let upk = UnparsedPublicKey::new(alg, self.sign.key.sec1());
upk.verify(self.body.as_ref(), &self.sign.sig.to_vec()?)?;
let vkey = p256::ecdsa::VerifyingKey::from_sec1_bytes(self.sign.key.sec1())?;
let sig = p256::ecdsa::Signature::from_der(&self.sign.sig.to_vec()?)?;
vkey.verify(self.body.as_ref(), &sig)?;

// Verify the PCE security version.
if self.body.pce_svn() < Body::PCE_SVN {
Expand Down

0 comments on commit b775ff9

Please sign in to comment.