Move out check credProtectPolicy logic (#516)
* Move out check credProtectPolicy logic Move the credProtectPolicy check outside credential ID decryption & discoverable credential finding. Modify the unit tests, and add unit tests for credProtectPolicy checking in non resident flows that were originally missing.
This commit is contained in:
@@ -309,7 +309,7 @@ impl Ctap1Command {
|
||||
flags: Ctap1Flags,
|
||||
ctap_state: &mut CtapState,
|
||||
) -> Result<Vec<u8>, Ctap1StatusCode> {
|
||||
let credential_source = decrypt_credential_id(env, key_handle, &application, false)
|
||||
let credential_source = decrypt_credential_id(env, key_handle, &application)
|
||||
.map_err(|_| Ctap1StatusCode::SW_WRONG_DATA)?;
|
||||
if let Some(credential_source) = credential_source {
|
||||
let ecdsa_key = credential_source
|
||||
@@ -440,7 +440,6 @@ mod test {
|
||||
&mut env,
|
||||
response[67..67 + CBOR_CREDENTIAL_ID_SIZE].to_vec(),
|
||||
&application,
|
||||
false
|
||||
)
|
||||
.unwrap()
|
||||
.is_some());
|
||||
|
||||
Reference in New Issue
Block a user