Skip to content

Commit 3599d70

Browse files
Martin Sirringhausmsirringhaus
Martin Sirringhaus
authored andcommitted
Adding tests (and some minor fixes the tests revealed)
1 parent fbdb685 commit 3599d70

File tree

7 files changed

+449
-10
lines changed

7 files changed

+449
-10
lines changed

examples/ctap2_discoverable_creds.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ fn extract_associated_large_blobs(key: Vec<u8>, array: Vec<LargeBlobArrayElement
269269
let plaintext = cipher.decrypt(e.nonce.as_slice().into(), payload).ok();
270270
plaintext
271271
})
272-
.map(|d| flate3::inflate(&d))
272+
.map(|d| flate3::inflate(&d)) // TODO: Check resulting length and compare to orig_size
273273
.map(|d| String::from_utf8_lossy(&d).to_string())
274274
.collect();
275275
valid_elements

examples/prf.rs

+3
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ fn main() {
149149
Ok(StatusUpdate::SelectResultNotice(_, _)) => {
150150
panic!("Unexpected select device notice")
151151
}
152+
Ok(StatusUpdate::LargeBlobData(..)) => {
153+
panic!("Unexpected large blob data request")
154+
}
152155
Err(RecvError) => {
153156
println!("STATUS: end");
154157
return;

src/ctap2/commands/get_assertion.rs

+7
Original file line numberDiff line numberDiff line change
@@ -1101,6 +1101,7 @@ pub mod test {
11011101
),
11021102
)),
11031103
cred_blob: None,
1104+
large_blob_key: None,
11041105
},
11051106
options: GetAssertionOptions {
11061107
user_presence: Some(true),
@@ -1159,6 +1160,7 @@ pub mod test {
11591160
),
11601161
)),
11611162
cred_blob: None,
1163+
large_blob_key: None,
11621164
},
11631165
options: GetAssertionOptions {
11641166
user_presence: None,
@@ -1205,6 +1207,7 @@ pub mod test {
12051207
},
12061208
)),
12071209
cred_blob: None,
1210+
large_blob_key: None,
12081211
},
12091212
options: GetAssertionOptions {
12101213
user_presence: None,
@@ -1227,6 +1230,7 @@ pub mod test {
12271230
app_id: None,
12281231
hmac_secret: Some(HmacGetSecretOrPrf::PrfUnmatched),
12291232
cred_blob: None,
1233+
large_blob_key: None,
12301234
},
12311235
options: GetAssertionOptions {
12321236
user_presence: None,
@@ -2898,6 +2902,9 @@ pub mod test {
28982902
},
28992903
attachment: AuthenticatorAttachment::Unknown,
29002904
extensions: AuthenticationExtensionsClientOutputs::default(),
2905+
user_selected: None,
2906+
large_blob_key: None,
2907+
large_blob_array: None,
29012908
};
29022909

29032910
let mut dev = Device::new_skipping_serialization("commands/get_assertion")

0 commit comments

Comments
 (0)