Skip to content

Commit

Permalink
rust: bump rsa from 0.4.0 to 0.5.0
Browse files Browse the repository at this point in the history
Bumps [rsa](https://github.com/RustCrypto/RSA) from 0.4.0 to 0.5.0.
- [Release notes](https://github.com/RustCrypto/RSA/releases)
- [Changelog](https://github.com/RustCrypto/RSA/blob/master/release.toml)
- [Commits](RustCrypto/RSA@v0.4.0...v0.5.0)

---
updated-dependencies:
- dependency-name: rsa
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
  • Loading branch information
dependabot[bot] authored and Yawning committed Jul 27, 2021
1 parent 4e0a590 commit 138662b
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 42 deletions.
1 change: 1 addition & 0 deletions .changelog/4147.internal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rust: bump rsa from 0.4.0 to 0.5.0
111 changes: 74 additions & 37 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ bech32 = "0.8.1"
impl-trait-for-tuples = "0.2.1"
x509-parser = "0.9.2"
oid-registry = "0.1.5"
rsa = "0.4.0"
rsa = "0.5.0"
base64-serde = "0.6.1"

[dev-dependencies]
Expand Down
8 changes: 4 additions & 4 deletions runtime/src/common/sgx/avr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use chrono::prelude::*;
use lazy_static::lazy_static;
use oid_registry::{OID_PKCS1_RSAENCRYPTION, OID_PKCS1_SHA256WITHRSA};
use percent_encoding;
use rsa::{padding::PaddingScheme, Hash, PublicKey, RSAPublicKey};
use rsa::{padding::PaddingScheme, pkcs1::FromRsaPublicKey, Hash, PublicKey, RsaPublicKey};
use serde_json;
use sgx_isa::{AttributesFlags, Report};
use sha2::{Digest, Sha256};
Expand Down Expand Up @@ -450,19 +450,19 @@ fn validate_avr_signature(
}
}

fn extract_certificate_rsa_public_key(cert: &X509Certificate) -> Result<RSAPublicKey> {
fn extract_certificate_rsa_public_key(cert: &X509Certificate) -> Result<RsaPublicKey> {
let cert_spki = &cert.tbs_certificate.subject_pki;
if cert_spki.algorithm.algorithm != OID_PKCS1_RSAENCRYPTION {
return Err(anyhow!("invalid certificate public key algorithm"));
}

match RSAPublicKey::from_pkcs1(cert_spki.subject_public_key.data) {
match RsaPublicKey::from_pkcs1_der(cert_spki.subject_public_key.data) {
Ok(pk) => Ok(pk),
Err(err) => return Err(anyhow!("invalid certificate public key: {:?}", err)),
}
}

fn check_certificate_rsa_signature(cert: &X509Certificate, public_key: &RSAPublicKey) -> bool {
fn check_certificate_rsa_signature(cert: &X509Certificate, public_key: &RsaPublicKey) -> bool {
if cert.signature_algorithm.algorithm != OID_PKCS1_SHA256WITHRSA {
return false;
}
Expand Down

0 comments on commit 138662b

Please sign in to comment.