1sequence! { procedure, context,
2    Upper Tester ->IUT: ReadLocalOobData {}
3    IUT -> Upper Tester: ReadLocalOobDataComplete {
4       status: ErrorCode::Success,
5        c: [0; 16],
6        r: [0; 16],
7    }
8    // ACL Connection Established
9    Upper Tester -> IUT: AuthenticationRequested {
10        connection_handle: context.peer_handle()
11    }
12    IUT -> Upper Tester: AuthenticationRequestedStatus {
13       num_hci_command_packets: 1,
14       status: ErrorCode::Success,
15    }
16    IUT -> Upper Tester: LinkKeyRequest {
17        bd_addr: context.peer_address(),
18    }
19    Upper Tester -> IUT: LinkKeyRequestNegativeReply {
20        bd_addr: context.peer_address(),
21    }
22    IUT -> Upper Tester: LinkKeyRequestNegativeReplyComplete {
23       num_hci_command_packets: 1,
24       status: ErrorCode::Success,
25       bd_addr: context.peer_address(),
26    }
27    IUT -> Upper Tester: IoCapabilityRequest {
28        bd_addr: context.peer_address(),
29    }
30    Upper Tester -> IUT: IoCapabilityRequestReply {
31        bd_addr: context.peer_address(),
32        io_capability: IoCapability::DisplayYesNo,
33        oob_present: OobDataPresent::P192Present,
34        authentication_requirements: AuthenticationRequirements::NoBondingMitmProtection,
35    }
36    IUT -> Upper Tester: IoCapabilityRequestReplyComplete {
37        num_hci_command_packets: 1,
38        status: ErrorCode::Success,
39        bd_addr: context.peer_address(),
40    }
41    IUT -> Lower Tester: IoCapabilityReq {
42        transaction_id: 0,
43        io_capabilities: 0x01,
44        oob_authentication_data: 0x01,
45        authentication_requirement: 0x01,
46    }
47    Lower Tester -> IUT: IoCapabilityRes {
48        transaction_id: 0,
49        io_capabilities: 0x01,
50        oob_authentication_data: 0x01,
51        authentication_requirement: 0x01,
52    }
53    IUT -> Upper Tester: IoCapabilityResponse {
54        bd_addr: context.peer_address(),
55        io_capability: IoCapability::DisplayYesNo,
56        oob_data_present: OobDataPresent::P192Present,
57        authentication_requirements: AuthenticationRequirements::NoBondingMitmProtection,
58    }
59    // Public Key Exchange
60    IUT -> Lower Tester: EncapsulatedHeader {
61        transaction_id: 0,
62        major_type: 1,
63        minor_type: 1,
64        payload_length: 48,
65    }
66    Lower Tester -> IUT: Accepted {
67        transaction_id: 0,
68        accepted_opcode: Opcode::EncapsulatedHeader,
69    }
70    repeat 3 times with (part in local_p192_public_key(&context)) {
71        IUT -> Lower Tester: EncapsulatedPayload {
72            transaction_id: 0,
73            data: part,
74        }
75        Lower Tester -> IUT: Accepted {
76            transaction_id: 0,
77            accepted_opcode: Opcode::EncapsulatedPayload,
78        }
79    }
80    Lower Tester -> IUT: EncapsulatedHeader {
81        transaction_id: 0,
82        major_type: 1,
83        minor_type: 1,
84        payload_length: 48,
85    }
86    IUT -> Lower Tester: Accepted {
87        transaction_id: 0,
88        accepted_opcode: Opcode::EncapsulatedHeader,
89    }
90    repeat 3 times with (part in peer_p192_public_key()) {
91        Lower Tester -> IUT: EncapsulatedPayload {
92            transaction_id: 0,
93            data: part,
94        }
95        IUT -> Lower Tester: Accepted {
96            transaction_id: 0,
97            accepted_opcode: Opcode::EncapsulatedPayload,
98        }
99    }
100    // Authentication Stage 1: OOB Protocol
101    IUT -> Upper Tester: RemoteOobDataRequest {
102        bd_addr: context.peer_address(),
103    }
104    Upper Tester -> IUT: RemoteOobDataRequestReply {
105        bd_addr: context.peer_address(),
106        c: [0; 16],
107        r: [0; 16],
108    }
109    IUT -> Upper Tester: RemoteOobDataRequestReplyComplete {
110        num_hci_command_packets: 1,
111        status: ErrorCode::Success,
112        bd_addr: context.peer_address(),
113    }
114    IUT -> Lower Tester: SimplePairingNumber {
115        transaction_id: 0,
116        nonce: [0; 16],
117    }
118    Lower Tester -> IUT: Accepted {
119        transaction_id: 0,
120        accepted_opcode: Opcode::SimplePairingNumber,
121    }
122    Lower Tester -> IUT: SimplePairingNumber {
123        transaction_id: 0,
124        nonce: [0; 16],
125    }
126    IUT -> Lower Tester: Accepted {
127        transaction_id: 0,
128        accepted_opcode: Opcode::SimplePairingNumber,
129    }
130    // Authentication Stage 2
131    IUT -> Lower Tester: DhkeyCheck {
132        transaction_id: 0,
133        confirmation_value: [0; 16],
134    }
135    Lower Tester -> IUT: Accepted { transaction_id: 0, accepted_opcode: Opcode::DhkeyCheck }
136    Lower Tester -> IUT: DhkeyCheck {
137        transaction_id: 0,
138        confirmation_value: [0; 16],
139    }
140    IUT -> Lower Tester: Accepted { transaction_id: 0, accepted_opcode: Opcode::DhkeyCheck }
141    IUT -> Upper Tester: SimplePairingComplete {
142        status: ErrorCode::Success,
143        bd_addr: context.peer_address(),
144    }
145    // Link Key Calculation
146    IUT -> Lower Tester: AuRand {
147        transaction_id: 0,
148        random_number: [0; 16],
149    }
150    Lower Tester -> IUT: Sres {
151        transaction_id: 0,
152        authentication_rsp: [0; 4],
153    }
154    Lower Tester -> IUT: AuRand {
155        transaction_id: 0,
156        random_number: [0; 16],
157    }
158    IUT -> Lower Tester: Sres {
159        transaction_id: 0,
160        authentication_rsp: [0; 4],
161    }
162    IUT -> Upper Tester: LinkKeyNotification {
163        bd_addr: context.peer_address(),
164        key_type: KeyType::AuthenticatedP192,
165        link_key: [0; 16],
166    }
167    IUT -> Upper Tester: AuthenticationComplete {
168        status: ErrorCode::Success,
169        connection_handle: context.peer_handle(),
170    }
171}
172