Skip to content

Commit 2199511

Browse files
msirringhausiinuwa
authored andcommitted
Run cargo fmt
1 parent bdd55f7 commit 2199511

1 file changed

Lines changed: 24 additions & 9 deletions

File tree

libwebauthn/src/fido.rs

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -257,14 +257,23 @@ mod tests {
257257
#[test]
258258
fn test_serialize_auth_data() {
259259
// SHA-256 'example.com'
260-
let rp_id_hash = [0xa3, 0x79, 0xa6, 0xf6, 0xee, 0xaf, 0xb9, 0xa5, 0x5e, 0x37, 0x8c, 0x11, 0x80, 0x34, 0xe2, 0x75, 0x1e, 0x68, 0x2f, 0xab, 0x9f, 0x2d, 0x30, 0xab, 0x13, 0xd2, 0x12, 0x55, 0x86, 0xce, 0x19, 0x47,];
260+
let rp_id_hash = [
261+
0xa3, 0x79, 0xa6, 0xf6, 0xee, 0xaf, 0xb9, 0xa5, 0x5e, 0x37, 0x8c, 0x11, 0x80, 0x34,
262+
0xe2, 0x75, 0x1e, 0x68, 0x2f, 0xab, 0x9f, 0x2d, 0x30, 0xab, 0x13, 0xd2, 0x12, 0x55,
263+
0x86, 0xce, 0x19, 0x47,
264+
];
261265
let flag_bits = 0b0100_0101;
262266
let flags = AuthenticatorDataFlags::from_bits(flag_bits).unwrap();
263267
let signature_count = 0;
264-
let aaguid = [0x24, 0x38, 0x65, 0x2a, 0xbe, 0x9f, 0xbd, 0x84, 0x81, 0x0a, 0x84, 0x0d, 0x6f, 0xc4, 0x42, 0xa8, ];
268+
let aaguid = [
269+
0x24, 0x38, 0x65, 0x2a, 0xbe, 0x9f, 0xbd, 0x84, 0x81, 0x0a, 0x84, 0x0d, 0x6f, 0xc4,
270+
0x42, 0xa8,
271+
];
265272
let credential_id = vec![0x01, 0x01, 0x03, 0x03, 0x05, 0x05, 0x07, 0x07];
266273
let pub_key_bytes = b"]\"\xff\xc5\x932x(\xd6-:1\xbb}\x8c$7\xf1&\xd4\xb4&\x02\x02\xa3\xd9\xe2\xba1\x1f\xec\xba";
267-
let credential_public_key = cosey::PublicKey::Ed25519Key(Ed25519PublicKey { x: Bytes::from_slice(pub_key_bytes).unwrap() });
274+
let credential_public_key = cosey::PublicKey::Ed25519Key(Ed25519PublicKey {
275+
x: Bytes::from_slice(pub_key_bytes).unwrap(),
276+
});
268277
/*
269278
* A4 # map(4)
270279
* 01 # unsigned(1) kty
@@ -280,9 +289,9 @@ mod tests {
280289
let mut cose_bytes = vec![0xa4, 0x01, 0x01, 0x03, 0x27, 0x20, 0x06, 0x21, 0x58, 0x20];
281290
cose_bytes.extend(pub_key_bytes);
282291
let attested_credential = Some(AttestedCredentialData {
283-
aaguid,
284-
credential_id: credential_id.clone(),
285-
credential_public_key,
292+
aaguid,
293+
credential_id: credential_id.clone(),
294+
credential_public_key,
286295
});
287296
let auth_data: AuthenticatorData<()> = AuthenticatorData {
288297
rp_id_hash,
@@ -294,9 +303,15 @@ mod tests {
294303
let webauthn_auth_data = auth_data.to_response_bytes().unwrap();
295304
assert_eq!(rp_id_hash, &webauthn_auth_data[..32]);
296305
assert_eq!(flag_bits, webauthn_auth_data[32]);
297-
assert_eq!(u32::to_be_bytes(signature_count), webauthn_auth_data[33..37]);
306+
assert_eq!(
307+
u32::to_be_bytes(signature_count),
308+
webauthn_auth_data[33..37]
309+
);
298310
assert_eq!(aaguid, &webauthn_auth_data[37..37 + 16]);
299-
assert_eq!(&credential_id, &webauthn_auth_data[55..55 + &credential_id.len()]);
311+
assert_eq!(
312+
&credential_id,
313+
&webauthn_auth_data[55..55 + &credential_id.len()]
314+
);
300315
assert_eq!(cose_bytes, &webauthn_auth_data[55 + credential_id.len()..]);
301316
}
302-
}
317+
}

0 commit comments

Comments
 (0)