1sequence! { procedure, context,
2    // ACL Connection Established
3    Upper Tester -> IUT: AuthenticationRequested {
4        connection_handle: context.peer_handle()
5    }
6    IUT -> Upper Tester: AuthenticationRequestedStatus {
7       num_hci_command_packets: 1,
8       status: ErrorCode::Success,
9    }
10    IUT -> Upper Tester: LinkKeyRequest {
11        bd_addr: context.peer_address(),
12    }
13    Upper Tester -> IUT: LinkKeyRequestNegativeReply {
14        bd_addr: context.peer_address(),
15    }
16    IUT -> Upper Tester: LinkKeyRequestNegativeReplyComplete {
17       num_hci_command_packets: 1,
18       status: ErrorCode::Success,
19       bd_addr: context.peer_address(),
20    }
21    IUT -> Upper Tester: IoCapabilityRequest {
22        bd_addr: context.peer_address(),
23    }
24    Upper Tester -> IUT: IoCapabilityRequestReply {
25        bd_addr: context.peer_address(),
26        io_capability: IoCapability::DisplayYesNo,
27        oob_present: OobDataPresent::NotPresent,
28        authentication_requirements: AuthenticationRequirements::NoBondingMitmProtection,
29    }
30    IUT -> Upper Tester: IoCapabilityRequestReplyComplete {
31        num_hci_command_packets: 1,
32        status: ErrorCode::Success,
33        bd_addr: context.peer_address(),
34    }
35    IUT -> Lower Tester: IoCapabilityReq {
36        transaction_id: 0,
37        io_capabilities: 0x01,
38        oob_authentication_data: 0x00,
39        authentication_requirement: 0x01,
40    }
41    Lower Tester -> IUT: NotAcceptedExt {
42        transaction_id: 0,
43        not_accepted_opcode: ExtendedOpcode::IoCapabilityReq,
44        error_code: 0x37,
45    }
46    IUT -> Upper Tester: SimplePairingComplete {
47        status: ErrorCode::AuthenticationFailure,
48        bd_addr: context.peer_address(),
49    }
50    IUT -> Upper Tester: PinCodeRequest {
51        bd_addr: context.peer_address(),
52    }
53    IUT -> Upper Tester: PinCodeRequestReply {
54        bd_addr: context.peer_address(),
55        pin_code_length: 1,
56        pin_code: "0".as_bytes(),
57    }
58    IUT -> Upper Tester: PinCodeRequestReplyComplete {
59        num_hci_command_packets: 1,
60        status: ErrorCode::Success,
61        bd_addr: context.peer_address(),
62    }
63    IUT -> Lower Tester: InRand {
64        transaction_id: 0,
65        random_number: [0; 16],
66    }
67    Lower Tester -> IUT: Accepted {
68        transaction_id: 0,
69        accepted_opcode: Opcode::InRand,
70    }
71    IUT -> Lower Tester: CombKey {
72        transaction_id: 0,
73        random_number: [0; 16],
74    }
75    Lower Tester -> IUT: CombKey {
76        transaction_id: 0,
77        random_number: [0; 16],
78    }
79    // TODO: It's also valid to send it just
80    // before AuthenticationComplete
81    IUT -> Upper Tester: LinkKeyNotification {
82        bd_addr: context.peer_address(),
83        key_type: KeyType::AuthenticatedP192,
84        link_key: [0; 16],
85    }
86    IUT -> Lower Tester: AuRand {
87        transaction_id: 0,
88        random_number: [0; 16],
89    }
90    Lower Tester -> IUT: Sres {
91        transaction_id: 0,
92        authentication_rsp: [0; 4],
93    }
94    Lower Tester -> IUT: AuRand {
95        transaction_id: 0,
96        random_number: [0; 16],
97    }
98    IUT -> Lower Tester: Sres {
99        transaction_id: 0,
100        authentication_rsp: [0; 4],
101    }
102    IUT -> Upper Tester: AuthenticationComplete {
103        status: ErrorCode::Success,
104        connection_handle: context.peer_handle(),
105    }
106}
107