INNER CODE UNIT · Rust

lock_packet

google/OpenSK · libraries/opensk/src/lib.rs:155

    fn lock_packet(cid: &[u8; 4]) -> HidPacket {
        assemble_packet(cid, 0x04, &[0x01; 1])
    }

    fn wink_packet(cid: &[u8; 4]) -> HidPacket {
        assemble_packet(cid, 0x08, &[])
    }

    #[test]
    fn test_wink() {
        let env = TestEnv::default();
        let mut ctap = Ctap::<TestEnv>::new(env);

        // Send Init, receive Init response and check wink if disabled.
        let mut init_response = ctap.process_hid_packet(&init_packet(), Transport::MainHid);
        let response_packet = init_response.next().unwrap();
        assert_eq!(response_packet[4], 0x86);
        let cid = *array_ref!(response_packet, 15, 4);

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…