feat: updates
This commit is contained in:
@@ -57,6 +57,7 @@ pub fn secure_enclave_p256_dh(
|
||||
)
|
||||
};
|
||||
let dh_result_str = dh_result.as_str();
|
||||
debugging!("DH result: {}", &dh_result_str);
|
||||
if !dh_result_str.starts_with("ok:SharedSecret:") {
|
||||
return simple_error!("ECDH P256 in secure enclave failed: {}", dh_result_str);
|
||||
}
|
||||
@@ -82,6 +83,7 @@ pub fn secure_enclave_p256_sign(private_key: &str, content: &[u8]) -> XResult<Ve
|
||||
)
|
||||
};
|
||||
let signature_result_str = signature_result.as_str();
|
||||
debugging!("Signature result: {}", &signature_result_str);
|
||||
if !signature_result_str.starts_with("ok:") {
|
||||
return simple_error!(
|
||||
"Sign P256 in secure enclave failed: {}",
|
||||
@@ -89,5 +91,6 @@ pub fn secure_enclave_p256_sign(private_key: &str, content: &[u8]) -> XResult<Ve
|
||||
);
|
||||
}
|
||||
let signature = signature_result_str.chars().skip(3).collect::<String>();
|
||||
debugging!("Signature: {}", &signature);
|
||||
Ok(base64_decode(&signature)?)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user