mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-12-13 15:41:51 +00:00
Update RustCrypto dependencies
This commit is contained in:
@@ -24,10 +24,9 @@ digest = { workspace = true }
|
||||
p256 = { workspace = true }
|
||||
p384 = { workspace = true }
|
||||
p521 = { workspace = true }
|
||||
ecdsa = { workspace = true }
|
||||
rsa = { workspace = true, features = ["sha2"] }
|
||||
x509-cert = { workspace = true }
|
||||
der = { workspace = true, features = ["derive"] }
|
||||
der = { workspace = true, features = ["derive", "pem"] }
|
||||
fdt = { workspace = true }
|
||||
bytemuck = { workspace = true, features = ["derive", "min_const_generics"] }
|
||||
num-traits = { workspace = true }
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
use der::referenced::OwnedToRef;
|
||||
use der::{Decode, DecodePem, Encode, Sequence, SliceReader};
|
||||
use digest::DynDigest;
|
||||
use ecdsa;
|
||||
use p256::ecdsa::{
|
||||
Signature as P256Signature, SigningKey as P256SigningKey, VerifyingKey as P256VerifyingKey,
|
||||
};
|
||||
@@ -9,9 +8,8 @@ use p256::pkcs8::DecodePrivateKey;
|
||||
use p384::ecdsa::{
|
||||
Signature as P384Signature, SigningKey as P384SigningKey, VerifyingKey as P384VerifyingKey,
|
||||
};
|
||||
use p521::{
|
||||
ecdsa::{Signature as P521Signature, SigningKey as P521SigningKey},
|
||||
NistP521,
|
||||
use p521::ecdsa::{
|
||||
Signature as P521Signature, SigningKey as P521SigningKey, VerifyingKey as P521VerifyingKey,
|
||||
};
|
||||
use rsa::pkcs1v15::{
|
||||
Signature as RsaSignature, SigningKey as RsaSigningKey, VerifyingKey as RsaVerifyingKey,
|
||||
@@ -32,8 +30,6 @@ use base::{log_err, LoggedResult, MappedFile, ResultExt, StrErr, Utf8CStr};
|
||||
|
||||
use crate::ffi::BootImage;
|
||||
|
||||
type P521VerifyingKey = ecdsa::VerifyingKey<NistP521>;
|
||||
|
||||
#[allow(clippy::upper_case_acronyms)]
|
||||
pub enum SHA {
|
||||
SHA1(Sha1),
|
||||
@@ -170,9 +166,9 @@ impl Signer {
|
||||
} else if let Ok(ec) = P384SigningKey::from_pkcs8_der(key) {
|
||||
digest = Box::<Sha384>::default();
|
||||
SigningKey::SHA384withECDSA(ec)
|
||||
} else if let Ok(ec) = ecdsa::SigningKey::<NistP521>::from_pkcs8_der(key) {
|
||||
} else if let Ok(ec) = P521SigningKey::from_pkcs8_der(key) {
|
||||
digest = Box::<Sha512>::default();
|
||||
SigningKey::SHA521withECDSA(P521SigningKey::from(ec))
|
||||
SigningKey::SHA521withECDSA(ec)
|
||||
} else {
|
||||
return Err(log_err!("Unsupported private key"));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user