From 04bbd2b7e179994913e0b1e66792b30db4c0f18a Mon Sep 17 00:00:00 2001 From: bordumb Date: Tue, 3 Mar 2026 21:19:28 +0000 Subject: [PATCH 1/3] test: add FFI smoke tests for auths-verifier Cover all 4 FFI entry points: - ffi_verify_attestation_json: happy path, null ptrs, bad pk len, malformed JSON, wrong pk - ffi_verify_chain_json: happy path, null ptrs, malformed JSON, bad pk len - ffi_verify_device_authorization_json: happy path, null ptr, bad pk len - ffi_verify_chain_with_witnesses: null ptr, bad pk len, zero-threshold happy path Uses same pre-computed fixture as WASM binding tests (deterministic ring keypairs). All tests use plain #[test] (not #[tokio::test]) since FFI creates its own tokio runtime. --- .../auths-verifier/tests/cases/ffi_smoke.rs | 339 ++++++++++++++++++ crates/auths-verifier/tests/cases/mod.rs | 2 + 2 files changed, 341 insertions(+) create mode 100644 crates/auths-verifier/tests/cases/ffi_smoke.rs diff --git a/crates/auths-verifier/tests/cases/ffi_smoke.rs b/crates/auths-verifier/tests/cases/ffi_smoke.rs new file mode 100644 index 00000000..6a041f3e --- /dev/null +++ b/crates/auths-verifier/tests/cases/ffi_smoke.rs @@ -0,0 +1,339 @@ +use auths_verifier::ffi::*; +use std::ptr; + +// Same fixture as wasm_bindings.rs — generated with deterministic ring keypairs. +const FIXTURE_ISSUER_PK_HEX: &str = + "8a88e3dd7409f195fd52db2d3cba5d72ca6709bf1d94121bf3748801b40f6f5c"; + +const FIXTURE_ATTESTATION_JSON: &str = r#"{"version":1,"rid":"test-rid","issuer":"did:key:z6Mkon3Necd6NkkyfoGoHxid2znGc59LU3K7mubaRcFbLfLX","subject":"did:key:z6Mko9hTggMwjSTEaJaPUfE6tqcy2xvU6BnNq3e3o8qVBiyH","device_public_key":"8139770ea87d175f56a35466c34c7ecccb8d8a91b4ee37a25df60f5b8fc9b394","identity_signature":"1690dee2371b2bd586e696c6f891c509140ff808b82cda8c83ecfa0ea396cb3e295006ad2e6498389b5e3b1ff9d089a9ab654c30adb68d55bde04a64d7e80208","device_signature":"df199539fd0367b3684fef8b484f829c679c1d02373acf9787150032a573a3e79c878e3c4c403dfeffc25f5d4695aecb64ea67a286068ed7ca4a51f042adfc08","timestamp":null}"#; + +const FIXTURE_ISSUER_DID: &str = "did:key:z6Mkon3Necd6NkkyfoGoHxid2znGc59LU3K7mubaRcFbLfLX"; +const FIXTURE_SUBJECT_DID: &str = "did:key:z6Mko9hTggMwjSTEaJaPUfE6tqcy2xvU6BnNq3e3o8qVBiyH"; + +fn issuer_pk_bytes() -> Vec { + hex::decode(FIXTURE_ISSUER_PK_HEX).unwrap() +} + +fn chain_json() -> Vec { + format!("[{}]", FIXTURE_ATTESTATION_JSON).into_bytes() +} + +// ---- ffi_verify_attestation_json ---- + +#[test] +fn attestation_happy_path() { + let json = FIXTURE_ATTESTATION_JSON.as_bytes(); + let pk = issuer_pk_bytes(); + let rc = unsafe { + ffi_verify_attestation_json(json.as_ptr(), json.len(), pk.as_ptr(), pk.len()) + }; + assert_eq!(rc, VERIFY_SUCCESS); +} + +#[test] +fn attestation_null_json_ptr() { + let pk = issuer_pk_bytes(); + let rc = unsafe { ffi_verify_attestation_json(ptr::null(), 0, pk.as_ptr(), pk.len()) }; + assert_eq!(rc, ERR_VERIFY_NULL_ARGUMENT); +} + +#[test] +fn attestation_null_pk_ptr() { + let json = FIXTURE_ATTESTATION_JSON.as_bytes(); + let rc = unsafe { ffi_verify_attestation_json(json.as_ptr(), json.len(), ptr::null(), 32) }; + assert_eq!(rc, ERR_VERIFY_NULL_ARGUMENT); +} + +#[test] +fn attestation_invalid_pk_len() { + let json = FIXTURE_ATTESTATION_JSON.as_bytes(); + let short_pk = [0u8; 16]; + let rc = unsafe { + ffi_verify_attestation_json( + json.as_ptr(), + json.len(), + short_pk.as_ptr(), + short_pk.len(), + ) + }; + assert_eq!(rc, ERR_VERIFY_INVALID_PK_LEN); +} + +#[test] +fn attestation_malformed_json() { + let bad_json = b"not valid json {{{{"; + let pk = issuer_pk_bytes(); + let rc = unsafe { + ffi_verify_attestation_json(bad_json.as_ptr(), bad_json.len(), pk.as_ptr(), pk.len()) + }; + assert_eq!(rc, ERR_VERIFY_JSON_PARSE); +} + +#[test] +fn attestation_wrong_pk_returns_sig_fail() { + let json = FIXTURE_ATTESTATION_JSON.as_bytes(); + let wrong_pk = [0u8; 32]; + let rc = unsafe { + ffi_verify_attestation_json(json.as_ptr(), json.len(), wrong_pk.as_ptr(), wrong_pk.len()) + }; + assert!(rc < 0, "expected negative error code, got {}", rc); +} + +// ---- ffi_verify_chain_json ---- + +#[test] +fn chain_happy_path() { + let chain = chain_json(); + let pk = issuer_pk_bytes(); + let mut buf = vec![0u8; 16384]; + let mut buf_len: usize = buf.len(); + let rc = unsafe { + ffi_verify_chain_json( + chain.as_ptr(), + chain.len(), + pk.as_ptr(), + pk.len(), + buf.as_mut_ptr(), + &mut buf_len, + ) + }; + assert_eq!(rc, VERIFY_SUCCESS); + assert!(buf_len > 0, "report should be non-empty"); + + let report: serde_json::Value = serde_json::from_slice(&buf[..buf_len]).unwrap(); + assert_eq!(report["status"]["type"], "Valid"); +} + +#[test] +fn chain_null_chain_ptr() { + let pk = issuer_pk_bytes(); + let mut buf = vec![0u8; 4096]; + let mut buf_len: usize = buf.len(); + let rc = unsafe { + ffi_verify_chain_json( + ptr::null(), + 0, + pk.as_ptr(), + pk.len(), + buf.as_mut_ptr(), + &mut buf_len, + ) + }; + assert_eq!(rc, ERR_VERIFY_NULL_ARGUMENT); +} + +#[test] +fn chain_null_result_ptr() { + let chain = chain_json(); + let pk = issuer_pk_bytes(); + let mut buf_len: usize = 4096; + let rc = unsafe { + ffi_verify_chain_json( + chain.as_ptr(), + chain.len(), + pk.as_ptr(), + pk.len(), + ptr::null_mut(), + &mut buf_len, + ) + }; + assert_eq!(rc, ERR_VERIFY_NULL_ARGUMENT); +} + +#[test] +fn chain_malformed_json() { + let bad = b"[not json"; + let pk = issuer_pk_bytes(); + let mut buf = vec![0u8; 4096]; + let mut buf_len: usize = buf.len(); + let rc = unsafe { + ffi_verify_chain_json( + bad.as_ptr(), + bad.len(), + pk.as_ptr(), + pk.len(), + buf.as_mut_ptr(), + &mut buf_len, + ) + }; + assert_eq!(rc, ERR_VERIFY_JSON_PARSE); +} + +#[test] +fn chain_invalid_pk_len() { + let chain = chain_json(); + let short_pk = [0u8; 16]; + let mut buf = vec![0u8; 4096]; + let mut buf_len: usize = buf.len(); + let rc = unsafe { + ffi_verify_chain_json( + chain.as_ptr(), + chain.len(), + short_pk.as_ptr(), + short_pk.len(), + buf.as_mut_ptr(), + &mut buf_len, + ) + }; + assert_eq!(rc, ERR_VERIFY_INVALID_PK_LEN); +} + +// ---- ffi_verify_device_authorization_json ---- + +#[test] +fn device_auth_happy_path() { + let identity_did = FIXTURE_ISSUER_DID.as_bytes(); + let device_did = FIXTURE_SUBJECT_DID.as_bytes(); + let chain = chain_json(); + let pk = issuer_pk_bytes(); + let mut buf = vec![0u8; 16384]; + let mut buf_len: usize = buf.len(); + let rc = unsafe { + ffi_verify_device_authorization_json( + identity_did.as_ptr(), + identity_did.len(), + device_did.as_ptr(), + device_did.len(), + chain.as_ptr(), + chain.len(), + pk.as_ptr(), + pk.len(), + buf.as_mut_ptr(), + &mut buf_len, + ) + }; + assert_eq!(rc, VERIFY_SUCCESS); + assert!(buf_len > 0); + + let report: serde_json::Value = serde_json::from_slice(&buf[..buf_len]).unwrap(); + assert_eq!(report["status"]["type"], "Valid"); +} + +#[test] +fn device_auth_null_identity_did() { + let device_did = FIXTURE_SUBJECT_DID.as_bytes(); + let chain = chain_json(); + let pk = issuer_pk_bytes(); + let mut buf = vec![0u8; 4096]; + let mut buf_len: usize = buf.len(); + let rc = unsafe { + ffi_verify_device_authorization_json( + ptr::null(), + 0, + device_did.as_ptr(), + device_did.len(), + chain.as_ptr(), + chain.len(), + pk.as_ptr(), + pk.len(), + buf.as_mut_ptr(), + &mut buf_len, + ) + }; + assert_eq!(rc, ERR_VERIFY_NULL_ARGUMENT); +} + +#[test] +fn device_auth_invalid_pk_len() { + let identity_did = FIXTURE_ISSUER_DID.as_bytes(); + let device_did = FIXTURE_SUBJECT_DID.as_bytes(); + let chain = chain_json(); + let short_pk = [0u8; 16]; + let mut buf = vec![0u8; 4096]; + let mut buf_len: usize = buf.len(); + let rc = unsafe { + ffi_verify_device_authorization_json( + identity_did.as_ptr(), + identity_did.len(), + device_did.as_ptr(), + device_did.len(), + chain.as_ptr(), + chain.len(), + short_pk.as_ptr(), + short_pk.len(), + buf.as_mut_ptr(), + &mut buf_len, + ) + }; + assert_eq!(rc, ERR_VERIFY_INVALID_PK_LEN); +} + +// ---- ffi_verify_chain_with_witnesses ---- + +#[test] +fn chain_with_witnesses_null_chain_ptr() { + let pk = issuer_pk_bytes(); + let receipts = b"[]"; + let keys = b"[]"; + let mut buf = vec![0u8; 4096]; + let mut buf_len: usize = buf.len(); + let rc = unsafe { + ffi_verify_chain_with_witnesses( + ptr::null(), + 0, + pk.as_ptr(), + pk.len(), + receipts.as_ptr(), + receipts.len(), + keys.as_ptr(), + keys.len(), + 0, + buf.as_mut_ptr(), + &mut buf_len, + ) + }; + assert_eq!(rc, ERR_VERIFY_NULL_ARGUMENT); +} + +#[test] +fn chain_with_witnesses_invalid_pk_len() { + let chain = chain_json(); + let short_pk = [0u8; 16]; + let receipts = b"[]"; + let keys = b"[]"; + let mut buf = vec![0u8; 4096]; + let mut buf_len: usize = buf.len(); + let rc = unsafe { + ffi_verify_chain_with_witnesses( + chain.as_ptr(), + chain.len(), + short_pk.as_ptr(), + short_pk.len(), + receipts.as_ptr(), + receipts.len(), + keys.as_ptr(), + keys.len(), + 0, + buf.as_mut_ptr(), + &mut buf_len, + ) + }; + assert_eq!(rc, ERR_VERIFY_INVALID_PK_LEN); +} + +#[test] +fn chain_with_witnesses_happy_path_zero_threshold() { + let chain = chain_json(); + let pk = issuer_pk_bytes(); + let receipts = b"[]"; + let keys = b"[]"; + let mut buf = vec![0u8; 16384]; + let mut buf_len: usize = buf.len(); + let rc = unsafe { + ffi_verify_chain_with_witnesses( + chain.as_ptr(), + chain.len(), + pk.as_ptr(), + pk.len(), + receipts.as_ptr(), + receipts.len(), + keys.as_ptr(), + keys.len(), + 0, + buf.as_mut_ptr(), + &mut buf_len, + ) + }; + assert_eq!(rc, VERIFY_SUCCESS); + assert!(buf_len > 0); +} diff --git a/crates/auths-verifier/tests/cases/mod.rs b/crates/auths-verifier/tests/cases/mod.rs index 42a42618..2d008636 100644 --- a/crates/auths-verifier/tests/cases/mod.rs +++ b/crates/auths-verifier/tests/cases/mod.rs @@ -1,4 +1,6 @@ mod capability_fromstr; +#[cfg(feature = "ffi")] +mod ffi_smoke; mod kel_verification; mod proptest_core; mod revocation_adversarial; From 862b7754046a3f5cdc2b78aab9f9e1832ed0ea1f Mon Sep 17 00:00:00 2001 From: bordumb Date: Tue, 3 Mar 2026 21:20:17 +0000 Subject: [PATCH 2/3] docs: update v1 launch notes --- docs/plans/v1_launch.md | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/docs/plans/v1_launch.md b/docs/plans/v1_launch.md index d44cc191..f19f7d28 100644 --- a/docs/plans/v1_launch.md +++ b/docs/plans/v1_launch.md @@ -49,27 +49,6 @@ type mismatch errors when consumers use both crates. **Effort:** 2 hours (+ fixing downstream imports) **Owner:** Core maintainer -### 0.4 — Add FFI smoke tests - -**File:** `crates/auths-verifier/src/ffi.rs` (450+ lines, zero tests) - -The FFI boundary is the interface for mobile apps (Swift, Kotlin, C). It has: -- Null pointer handling -- Buffer size validation -- Error code mapping -- Panic catch_unwind wrappers - -None of this is tested. A single regression here crashes the host process. - -**Minimum viable test set:** -- `ffi_verify_attestation_json` with valid input returns `VERIFY_SUCCESS` -- `ffi_verify_attestation_json` with null pointer returns error code (not crash) -- `ffi_verify_chain_json` with valid KEL returns success -- `ffi_verify_chain_json` with empty input returns error code - -**Effort:** 1-2 days -**Owner:** Verifier maintainer - --- ## Tier 1: Should Fix Before Launch From 9a840c17a0c824c458371e163db589063d0e5ff4 Mon Sep 17 00:00:00 2001 From: bordumb Date: Tue, 3 Mar 2026 21:21:19 +0000 Subject: [PATCH 3/3] fix: formatting --- crates/auths-crypto/src/webcrypto_provider.rs | 26 +++++-------------- crates/auths-crypto/tests/wasm_provider.rs | 19 ++++++-------- .../auths-verifier/tests/cases/ffi_smoke.rs | 12 +++------ crates/auths-verifier/tests/wasm_bindings.rs | 18 +++++-------- 4 files changed, 24 insertions(+), 51 deletions(-) diff --git a/crates/auths-crypto/src/webcrypto_provider.rs b/crates/auths-crypto/src/webcrypto_provider.rs index 7e125e1a..05a4cd9c 100644 --- a/crates/auths-crypto/src/webcrypto_provider.rs +++ b/crates/auths-crypto/src/webcrypto_provider.rs @@ -57,22 +57,12 @@ impl CryptoProvider for WebCryptoProvider { let usages = js_sys::Array::of1(&wasm_bindgen::JsValue::from_str("verify")); let import_promise = subtle - .import_key_with_str( - "raw", - &key_data, - "Ed25519", - false, - &usages, - ) - .map_err(|e| { - CryptoError::OperationFailed(format!("importKey failed: {e:?}")) - })?; + .import_key_with_str("raw", &key_data, "Ed25519", false, &usages) + .map_err(|e| CryptoError::OperationFailed(format!("importKey failed: {e:?}")))?; let crypto_key: web_sys::CryptoKey = JsFuture::from(import_promise) .await - .map_err(|e| { - CryptoError::OperationFailed(format!("importKey rejected: {e:?}")) - })? + .map_err(|e| CryptoError::OperationFailed(format!("importKey rejected: {e:?}")))? .unchecked_into(); let verify_promise = subtle @@ -82,13 +72,11 @@ impl CryptoProvider for WebCryptoProvider { signature, message, ) - .map_err(|e| { - CryptoError::OperationFailed(format!("verify call failed: {e:?}")) - })?; + .map_err(|e| CryptoError::OperationFailed(format!("verify call failed: {e:?}")))?; - let result = JsFuture::from(verify_promise).await.map_err(|e| { - CryptoError::OperationFailed(format!("verify rejected: {e:?}")) - })?; + let result = JsFuture::from(verify_promise) + .await + .map_err(|e| CryptoError::OperationFailed(format!("verify rejected: {e:?}")))?; if result.as_bool().unwrap_or(false) { Ok(()) diff --git a/crates/auths-crypto/tests/wasm_provider.rs b/crates/auths-crypto/tests/wasm_provider.rs index 73c40cec..9dc9e64d 100644 --- a/crates/auths-crypto/tests/wasm_provider.rs +++ b/crates/auths-crypto/tests/wasm_provider.rs @@ -7,26 +7,23 @@ wasm_bindgen_test_configure!(run_in_browser); // RFC 8032 Section 7.1, Test Vector 2 (single-byte message 0x72) const RFC8032_PUBKEY: [u8; 32] = [ - 0x3d, 0x40, 0x17, 0xc3, 0xe8, 0x43, 0x89, 0x5a, 0x92, 0xb7, 0x0a, 0xa7, 0x4d, 0x1b, 0x7e, - 0xbc, 0x9c, 0x98, 0x2c, 0xcf, 0x2e, 0xc4, 0x96, 0x8c, 0xc0, 0xcd, 0x55, 0xf1, 0x2a, 0xf4, - 0x66, 0x0c, + 0x3d, 0x40, 0x17, 0xc3, 0xe8, 0x43, 0x89, 0x5a, 0x92, 0xb7, 0x0a, 0xa7, 0x4d, 0x1b, 0x7e, 0xbc, + 0x9c, 0x98, 0x2c, 0xcf, 0x2e, 0xc4, 0x96, 0x8c, 0xc0, 0xcd, 0x55, 0xf1, 0x2a, 0xf4, 0x66, 0x0c, ]; const RFC8032_MESSAGE: [u8; 1] = [0x72]; const RFC8032_SIGNATURE: [u8; 64] = [ - 0x92, 0xa0, 0x09, 0xa9, 0xf0, 0xd4, 0xca, 0xb8, 0x72, 0x0e, 0x82, 0x0b, 0x5f, 0x64, 0x25, - 0x40, 0xa2, 0xb2, 0x7b, 0x54, 0x16, 0x50, 0x3f, 0x8f, 0xb3, 0x76, 0x22, 0x23, 0xeb, 0xdb, - 0x69, 0xda, 0x08, 0x5a, 0xc1, 0xe4, 0x3e, 0x15, 0x9c, 0x7e, 0x94, 0xe7, 0xc3, 0x65, 0x0c, - 0x95, 0xb3, 0x9a, 0x2d, 0xd9, 0xe4, 0x4b, 0x5b, 0xe7, 0xcc, 0x20, 0x5f, 0xd3, 0xc1, 0xb5, - 0x7d, 0x52, 0xd3, 0xc1, + 0x92, 0xa0, 0x09, 0xa9, 0xf0, 0xd4, 0xca, 0xb8, 0x72, 0x0e, 0x82, 0x0b, 0x5f, 0x64, 0x25, 0x40, + 0xa2, 0xb2, 0x7b, 0x54, 0x16, 0x50, 0x3f, 0x8f, 0xb3, 0x76, 0x22, 0x23, 0xeb, 0xdb, 0x69, 0xda, + 0x08, 0x5a, 0xc1, 0xe4, 0x3e, 0x15, 0x9c, 0x7e, 0x94, 0xe7, 0xc3, 0x65, 0x0c, 0x95, 0xb3, 0x9a, + 0x2d, 0xd9, 0xe4, 0x4b, 0x5b, 0xe7, 0xcc, 0x20, 0x5f, 0xd3, 0xc1, 0xb5, 0x7d, 0x52, 0xd3, 0xc1, ]; // A different valid public key (RFC 8032, Test Vector 1) const RFC8032_OTHER_PUBKEY: [u8; 32] = [ - 0xd7, 0x5a, 0x98, 0x01, 0x82, 0xb1, 0x0a, 0xb7, 0xd5, 0x4b, 0xfe, 0xd3, 0xc9, 0x64, 0x07, - 0x3a, 0x0e, 0xe1, 0x72, 0xf3, 0xda, 0xa3, 0xf4, 0xa1, 0x84, 0x46, 0xb0, 0xb8, 0xd1, 0x83, - 0xf8, 0xe3, + 0xd7, 0x5a, 0x98, 0x01, 0x82, 0xb1, 0x0a, 0xb7, 0xd5, 0x4b, 0xfe, 0xd3, 0xc9, 0x64, 0x07, 0x3a, + 0x0e, 0xe1, 0x72, 0xf3, 0xda, 0xa3, 0xf4, 0xa1, 0x84, 0x46, 0xb0, 0xb8, 0xd1, 0x83, 0xf8, 0xe3, ]; #[wasm_bindgen_test] diff --git a/crates/auths-verifier/tests/cases/ffi_smoke.rs b/crates/auths-verifier/tests/cases/ffi_smoke.rs index 6a041f3e..d5d2e3e4 100644 --- a/crates/auths-verifier/tests/cases/ffi_smoke.rs +++ b/crates/auths-verifier/tests/cases/ffi_smoke.rs @@ -24,9 +24,8 @@ fn chain_json() -> Vec { fn attestation_happy_path() { let json = FIXTURE_ATTESTATION_JSON.as_bytes(); let pk = issuer_pk_bytes(); - let rc = unsafe { - ffi_verify_attestation_json(json.as_ptr(), json.len(), pk.as_ptr(), pk.len()) - }; + let rc = + unsafe { ffi_verify_attestation_json(json.as_ptr(), json.len(), pk.as_ptr(), pk.len()) }; assert_eq!(rc, VERIFY_SUCCESS); } @@ -49,12 +48,7 @@ fn attestation_invalid_pk_len() { let json = FIXTURE_ATTESTATION_JSON.as_bytes(); let short_pk = [0u8; 16]; let rc = unsafe { - ffi_verify_attestation_json( - json.as_ptr(), - json.len(), - short_pk.as_ptr(), - short_pk.len(), - ) + ffi_verify_attestation_json(json.as_ptr(), json.len(), short_pk.as_ptr(), short_pk.len()) }; assert_eq!(rc, ERR_VERIFY_INVALID_PK_LEN); } diff --git a/crates/auths-verifier/tests/wasm_bindings.rs b/crates/auths-verifier/tests/wasm_bindings.rs index 31981b49..c3fc1b74 100644 --- a/crates/auths-verifier/tests/wasm_bindings.rs +++ b/crates/auths-verifier/tests/wasm_bindings.rs @@ -13,8 +13,7 @@ const FIXTURE_ISSUER_PK_HEX: &str = const FIXTURE_ATTESTATION_JSON: &str = r#"{"version":1,"rid":"test-rid","issuer":"did:key:z6Mkon3Necd6NkkyfoGoHxid2znGc59LU3K7mubaRcFbLfLX","subject":"did:key:z6Mko9hTggMwjSTEaJaPUfE6tqcy2xvU6BnNq3e3o8qVBiyH","device_public_key":"8139770ea87d175f56a35466c34c7ecccb8d8a91b4ee37a25df60f5b8fc9b394","identity_signature":"1690dee2371b2bd586e696c6f891c509140ff808b82cda8c83ecfa0ea396cb3e295006ad2e6498389b5e3b1ff9d089a9ab654c30adb68d55bde04a64d7e80208","device_signature":"df199539fd0367b3684fef8b484f829c679c1d02373acf9787150032a573a3e79c878e3c4c403dfeffc25f5d4695aecb64ea67a286068ed7ca4a51f042adfc08","timestamp":null}"#; // RFC 8032 Section 7.1, Test Vector 2 — used for artifact signature tests. -const RFC8032_PUBKEY_HEX: &str = - "3d4017c3e843895a92b70aa74d1b7ebc9c982ccf2ec4968cc0cd55f12af4660c"; +const RFC8032_PUBKEY_HEX: &str = "3d4017c3e843895a92b70aa74d1b7ebc9c982ccf2ec4968cc0cd55f12af4660c"; const RFC8032_MESSAGE_HEX: &str = "72"; @@ -31,15 +30,13 @@ async fn attestation_json_happy_path() { #[wasm_bindgen_test] async fn attestation_json_malformed_json() { - let result = - wasm_verify_attestation_json("not valid json {{{{", FIXTURE_ISSUER_PK_HEX).await; + let result = wasm_verify_attestation_json("not valid json {{{{", FIXTURE_ISSUER_PK_HEX).await; assert!(result.is_err()); } #[wasm_bindgen_test] async fn attestation_json_invalid_hex_pubkey() { - let result = - wasm_verify_attestation_json(FIXTURE_ATTESTATION_JSON, "not-hex!@#$").await; + let result = wasm_verify_attestation_json(FIXTURE_ATTESTATION_JSON, "not-hex!@#$").await; assert!(result.is_err()); } @@ -58,12 +55,9 @@ async fn artifact_signature_happy_path() { #[wasm_bindgen_test] async fn artifact_signature_invalid_signature() { - let invalid = wasm_verify_artifact_signature( - RFC8032_MESSAGE_HEX, - &"00".repeat(64), - RFC8032_PUBKEY_HEX, - ) - .await; + let invalid = + wasm_verify_artifact_signature(RFC8032_MESSAGE_HEX, &"00".repeat(64), RFC8032_PUBKEY_HEX) + .await; assert!(!invalid); }