Skip to content

Commit 77572e2

Browse files
Martin Sirringhausmsirringhaus
Martin Sirringhaus
authored andcommitted
Adding tests (and some minor fixes the tests revealed)
1 parent 06785ff commit 77572e2

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
@@ -1100,6 +1100,7 @@ pub mod test {
11001100
),
11011101
)),
11021102
cred_blob: None,
1103+
large_blob_key: None,
11031104
},
11041105
options: GetAssertionOptions {
11051106
user_presence: Some(true),
@@ -1158,6 +1159,7 @@ pub mod test {
11581159
),
11591160
)),
11601161
cred_blob: None,
1162+
large_blob_key: None,
11611163
},
11621164
options: GetAssertionOptions {
11631165
user_presence: None,
@@ -1204,6 +1206,7 @@ pub mod test {
12041206
},
12051207
)),
12061208
cred_blob: None,
1209+
large_blob_key: None,
12071210
},
12081211
options: GetAssertionOptions {
12091212
user_presence: None,
@@ -1226,6 +1229,7 @@ pub mod test {
12261229
app_id: None,
12271230
hmac_secret: Some(HmacGetSecretOrPrf::PrfUnmatched),
12281231
cred_blob: None,
1232+
large_blob_key: None,
12291233
},
12301234
options: GetAssertionOptions {
12311235
user_presence: None,
@@ -2897,6 +2901,9 @@ pub mod test {
28972901
},
28982902
attachment: AuthenticatorAttachment::Unknown,
28992903
extensions: AuthenticationExtensionsClientOutputs::default(),
2904+
user_selected: None,
2905+
large_blob_key: None,
2906+
large_blob_array: None,
29002907
};
29012908

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

0 commit comments

Comments
 (0)