diff --git a/Cargo.lock b/Cargo.lock index 1d7418a..6cdf78e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -511,7 +511,7 @@ dependencies = [ [[package]] name = "card-cli" -version = "1.11.0" +version = "1.11.1" dependencies = [ "aes-gcm-stream", "authenticator 0.3.1", @@ -3689,9 +3689,9 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "swift-secure-enclave-tool-rs" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cc8ba06af10bf59b2f47fb46238a0c62c2ac927184253b4fb998b3b3f68950a" +checksum = "1de60ab30b0f344a083df555373a2f419a0682f1a5d76c9f845abe696230caba" dependencies = [ "base64 0.22.1", "hex", diff --git a/Cargo.toml b/Cargo.toml index 1270d9d..9c3bae8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "card-cli" -version = "1.11.0" +version = "1.11.1" authors = ["Hatter Jiang "] edition = "2018" @@ -50,8 +50,8 @@ secrecy = "0.8" der-parser = "9.0" sshcerts = "0.13" regex = "1.4.6" -aes-gcm-stream = "0.2.4" -swift-secure-enclave-tool-rs = "0.1.0" +aes-gcm-stream = "0.2" +swift-secure-enclave-tool-rs = "0.1" #lazy_static = "1.4.0" #ssh-key = "0.4.0" #ctap-hid-fido2 = "2.1.3" diff --git a/src/seutil.rs b/src/seutil.rs index 7eeab38..eb0701a 100644 --- a/src/seutil.rs +++ b/src/seutil.rs @@ -9,9 +9,9 @@ pub fn is_support_se() -> bool { pub fn generate_secure_enclave_p256_keypair(sign: bool) -> XResult<(Vec, Vec, String)> { let key_material = if sign { - swift_secure_enclave_tool_rs::generate_ecdsa_keypair(KeyPurpose::Signing, true)? + swift_secure_enclave_tool_rs::generate_keypair(KeyPurpose::Signing, true)? } else { - swift_secure_enclave_tool_rs::generate_ecdsa_keypair(KeyPurpose::KeyAgreement, true)? + swift_secure_enclave_tool_rs::generate_keypair(KeyPurpose::KeyAgreement, true)? }; Ok(( key_material.public_key_point, @@ -26,12 +26,12 @@ pub fn recover_secure_enclave_p256_public_key( ) -> XResult<(Vec, Vec, String)> { let private_key_representation = STANDARD.decode(private_key)?; let key_material = if sign { - swift_secure_enclave_tool_rs::recover_ecdsa_keypair( + swift_secure_enclave_tool_rs::recover_keypair( KeyPurpose::Signing, &private_key_representation, ) } else { - swift_secure_enclave_tool_rs::recover_ecdsa_keypair( + swift_secure_enclave_tool_rs::recover_keypair( KeyPurpose::KeyAgreement, &private_key_representation, ) @@ -58,6 +58,6 @@ pub fn secure_enclave_p256_dh( pub fn secure_enclave_p256_sign(private_key: &str, content: &[u8]) -> XResult> { let private_key_representation = STANDARD.decode(private_key)?; let signature = - swift_secure_enclave_tool_rs::private_key_ecdsa_sign(&private_key_representation, content)?; + swift_secure_enclave_tool_rs::private_key_sign(&private_key_representation, content)?; Ok(signature) }