Skip to content

Commit d62d602

Browse files
Martin Sirringhausjschanck
authored andcommitted
Adding tests (and some minor fixes the tests revealed)
1 parent 170217a commit d62d602

File tree

7 files changed

+449
-10
lines changed

7 files changed

+449
-10
lines changed

examples/ctap2_discoverable_creds.rs

Lines changed: 1 addition & 1 deletion
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

Lines changed: 3 additions & 0 deletions
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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,6 +1104,7 @@ pub mod test {
11041104
),
11051105
)),
11061106
cred_blob: None,
1107+
large_blob_key: None,
11071108
},
11081109
options: GetAssertionOptions {
11091110
user_presence: Some(true),
@@ -1162,6 +1163,7 @@ pub mod test {
11621163
),
11631164
)),
11641165
cred_blob: None,
1166+
large_blob_key: None,
11651167
},
11661168
options: GetAssertionOptions {
11671169
user_presence: None,
@@ -1208,6 +1210,7 @@ pub mod test {
12081210
},
12091211
)),
12101212
cred_blob: None,
1213+
large_blob_key: None,
12111214
},
12121215
options: GetAssertionOptions {
12131216
user_presence: None,
@@ -1230,6 +1233,7 @@ pub mod test {
12301233
app_id: None,
12311234
hmac_secret: Some(HmacGetSecretOrPrf::PrfUnmatched),
12321235
cred_blob: None,
1236+
large_blob_key: None,
12331237
},
12341238
options: GetAssertionOptions {
12351239
user_presence: None,
@@ -2901,6 +2905,9 @@ pub mod test {
29012905
},
29022906
attachment: AuthenticatorAttachment::Unknown,
29032907
extensions: AuthenticationExtensionsClientOutputs::default(),
2908+
user_selected: None,
2909+
large_blob_key: None,
2910+
large_blob_array: None,
29042911
};
29052912

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

0 commit comments

Comments
 (0)