コード例 #1
0
ファイル: test_pcsc.py プロジェクト: worr/python-fido2
    def test_pcsc_call_u2f(self):
        connection = mock.Mock()
        connection.transmit.side_effect = [(b'U2F_V2', 0x90, 0x00),
                                           (b'', 0x90, 0x00),
                                           (b'u2f_resp', 0x90, 0x00)]

        dev = CtapPcscDevice(connection, 'Mock')
        res = dev.call(CTAPHID.MSG,
                       b'\x00\x01\x00\x00\x05' + b'\x01' * 5 + b'\x00')

        connection.transmit.assert_called_with(
            [0x00, 0x01, 0x00, 0x00, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00],
            None)
        self.assertEqual(res, b'u2f_resp\x90\x00')
コード例 #2
0
ファイル: test_pcsc.py プロジェクト: rgerganov/python-fido2
    def test_pcsc_call_u2f(self):
        connection = mock.Mock()
        connection.transmit.side_effect = [
            (b"U2F_V2", 0x90, 0x00),
            (b"", 0x90, 0x00),
            (b"u2f_resp", 0x90, 0x00),
        ]

        dev = CtapPcscDevice(connection, "Mock")
        res = dev.call(CTAPHID.MSG,
                       b"\x00\x01\x00\x00\x05" + b"\x01" * 5 + b"\x00")

        connection.transmit.assert_called_with(
            [0x00, 0x01, 0x00, 0x00, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00],
            None)
        self.assertEqual(res, b"u2f_resp\x90\x00")