INNER CODE UNIT · Rust

test_verify_ignore_expiry_on_expired_signature

cloudflare/web-bot-auth · crates/web-bot-auth/src/lib.rs:464

    fn test_verify_ignore_expiry_on_expired_signature() {
        let test = StandardTestVector {};
        let public_key: [u8; ed25519_dalek::PUBLIC_KEY_LENGTH] = [
            0x26, 0xb4, 0x0b, 0x8f, 0x93, 0xff, 0xf3, 0xd8, 0x97, 0x11, 0x2f, 0x7e, 0xbc, 0x58,
            0x2b, 0x23, 0x2d, 0xbd, 0x72, 0x51, 0x7d, 0x08, 0x2f, 0xe8, 0x3c, 0xfb, 0x30, 0xdd,
            0xce, 0x43, 0xd1, 0xbb,
        ];
        let mut keyring = KeyRing::default();
        keyring.import_raw(
            "poqkLGiymh_W0uP6PZFw-dvez3QJT5SolqXBCW38r0U".to_string(),
            Algorithm::Ed25519,
            public_key.to_vec(),
        );
        let verifier = WebBotAuthVerifier::parse(&test).unwrap();
        // Opt-in path: full cryptographic verification runs despite the expired
        // window, and the expiry surfaces as an advisory instead of an error.
        let outcome = verifier.verify_ignore_expiry(&keyring, None).unwrap();
        assert!(outcome.advisory.is_expired.unwrap_or(true));

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…