|
50 | 50 |
|
51 | 51 | context "when fido-u2f attestation" do |
52 | 52 | let(:original_challenge) do |
53 | | - Base64.strict_decode64(seeds[:security_key_direct][:credential_creation_options][:challenge]) |
| 53 | + base64_strict_decode64(seeds[:security_key_direct][:credential_creation_options][:challenge]) |
54 | 54 | end |
55 | 55 |
|
56 | 56 | let(:origin) { "http://localhost:3000" } |
|
59 | 59 | response = seeds[:security_key_direct][:authenticator_attestation_response] |
60 | 60 |
|
61 | 61 | WebAuthn::AuthenticatorAttestationResponse.new( |
62 | | - attestation_object: Base64.strict_decode64(response[:attestation_object]), |
63 | | - client_data_json: Base64.strict_decode64(response[:client_data_json]) |
| 62 | + attestation_object: base64_strict_decode64(response[:attestation_object]), |
| 63 | + client_data_json: base64_strict_decode64(response[:client_data_json]) |
64 | 64 | ) |
65 | 65 | end |
66 | 66 |
|
|
98 | 98 | let(:origin) { "https://localhost:13010" } |
99 | 99 |
|
100 | 100 | let(:original_challenge) do |
101 | | - Base64.strict_decode64( |
| 101 | + base64_strict_decode64( |
102 | 102 | seeds[:security_key_packed_self][:credential_creation_options][:challenge] |
103 | 103 | ) |
104 | 104 | end |
|
107 | 107 | response = seeds[:security_key_packed_self][:authenticator_attestation_response] |
108 | 108 |
|
109 | 109 | WebAuthn::AuthenticatorAttestationResponse.new( |
110 | | - attestation_object: Base64.strict_decode64(response[:attestation_object]), |
111 | | - client_data_json: Base64.strict_decode64(response[:client_data_json]) |
| 110 | + attestation_object: base64_strict_decode64(response[:attestation_object]), |
| 111 | + client_data_json: base64_strict_decode64(response[:client_data_json]) |
112 | 112 | ) |
113 | 113 | end |
114 | 114 |
|
|
140 | 140 | let(:origin) { "http://localhost:3000" } |
141 | 141 |
|
142 | 142 | let(:original_challenge) do |
143 | | - Base64.strict_decode64( |
| 143 | + base64_strict_decode64( |
144 | 144 | seeds[:security_key_packed_x5c][:credential_creation_options][:challenge] |
145 | 145 | ) |
146 | 146 | end |
|
149 | 149 | response = seeds[:security_key_packed_x5c][:authenticator_attestation_response] |
150 | 150 |
|
151 | 151 | WebAuthn::AuthenticatorAttestationResponse.new( |
152 | | - attestation_object: Base64.strict_decode64(response[:attestation_object]), |
153 | | - client_data_json: Base64.strict_decode64(response[:client_data_json]) |
| 152 | + attestation_object: base64_strict_decode64(response[:attestation_object]), |
| 153 | + client_data_json: base64_strict_decode64(response[:client_data_json]) |
154 | 154 | ) |
155 | 155 | end |
156 | 156 |
|
|
185 | 185 | context "when TPM attestation" do |
186 | 186 | let(:origin) { seeds[:tpm][:origin] } |
187 | 187 | let(:time) { Time.utc(2019, 8, 13, 22, 6) } |
188 | | - let(:challenge) { Base64.strict_decode64(seeds[:tpm][:credential_creation_options][:challenge]) } |
| 188 | + let(:challenge) { base64_strict_decode64(seeds[:tpm][:credential_creation_options][:challenge]) } |
189 | 189 |
|
190 | 190 | let(:attestation_response) do |
191 | 191 | response = seeds[:tpm][:authenticator_attestation_response] |
192 | 192 |
|
193 | 193 | WebAuthn::AuthenticatorAttestationResponse.new( |
194 | | - attestation_object: Base64.strict_decode64(response[:attestation_object]), |
195 | | - client_data_json: Base64.strict_decode64(response[:client_data_json]) |
| 194 | + attestation_object: base64_strict_decode64(response[:attestation_object]), |
| 195 | + client_data_json: base64_strict_decode64(response[:client_data_json]) |
196 | 196 | ) |
197 | 197 | end |
198 | 198 |
|
|
244 | 244 | let(:origin) { "https://7f41ac45.ngrok.io" } |
245 | 245 |
|
246 | 246 | let(:original_challenge) do |
247 | | - Base64.strict_decode64(seeds[:android_safetynet_direct][:credential_creation_options][:challenge]) |
| 247 | + base64_strict_decode64(seeds[:android_safetynet_direct][:credential_creation_options][:challenge]) |
248 | 248 | end |
249 | 249 |
|
250 | 250 | let(:attestation_response) do |
251 | 251 | response = seeds[:android_safetynet_direct][:authenticator_attestation_response] |
252 | 252 |
|
253 | 253 | WebAuthn::AuthenticatorAttestationResponse.new( |
254 | | - attestation_object: Base64.strict_decode64(response[:attestation_object]), |
255 | | - client_data_json: Base64.strict_decode64(response[:client_data_json]) |
| 254 | + attestation_object: base64_strict_decode64(response[:attestation_object]), |
| 255 | + client_data_json: base64_strict_decode64(response[:client_data_json]) |
256 | 256 | ) |
257 | 257 | end |
258 | 258 |
|
|
288 | 288 | let(:origin) { seeds[:android_key_direct][:origin] } |
289 | 289 |
|
290 | 290 | let(:original_challenge) do |
291 | | - Base64.urlsafe_decode64(seeds[:android_key_direct][:credential_creation_options][:challenge]) |
| 291 | + base64_urlsafe_decode64(seeds[:android_key_direct][:credential_creation_options][:challenge]) |
292 | 292 | end |
293 | 293 |
|
294 | 294 | let(:attestation_response) do |
295 | 295 | response = seeds[:android_key_direct][:authenticator_attestation_response] |
296 | 296 |
|
297 | 297 | WebAuthn::AuthenticatorAttestationResponse.new( |
298 | | - attestation_object: Base64.urlsafe_decode64(response[:attestation_object]), |
299 | | - client_data_json: Base64.urlsafe_decode64(response[:client_data_json]) |
| 298 | + attestation_object: base64_urlsafe_decode64(response[:attestation_object]), |
| 299 | + client_data_json: base64_urlsafe_decode64(response[:client_data_json]) |
300 | 300 | ) |
301 | 301 | end |
302 | 302 |
|
|
332 | 332 | let(:origin) { seeds[:macbook_touch_id][:origin] } |
333 | 333 |
|
334 | 334 | let(:original_challenge) do |
335 | | - Base64.urlsafe_decode64(seeds[:macbook_touch_id][:credential_creation_options][:challenge]) |
| 335 | + base64_urlsafe_decode64(seeds[:macbook_touch_id][:credential_creation_options][:challenge]) |
336 | 336 | end |
337 | 337 |
|
338 | 338 | let(:attestation_response) do |
339 | 339 | response = seeds[:macbook_touch_id][:authenticator_attestation_response] |
340 | 340 |
|
341 | 341 | WebAuthn::AuthenticatorAttestationResponse.new( |
342 | | - attestation_object: Base64.urlsafe_decode64(response[:attestation_object]), |
343 | | - client_data_json: Base64.urlsafe_decode64(response[:client_data_json]) |
| 342 | + attestation_object: base64_urlsafe_decode64(response[:attestation_object]), |
| 343 | + client_data_json: base64_urlsafe_decode64(response[:client_data_json]) |
344 | 344 | ) |
345 | 345 | end |
346 | 346 |
|
|
546 | 546 |
|
547 | 547 | describe "attestation statement verification" do |
548 | 548 | let(:original_challenge) do |
549 | | - Base64.strict_decode64(seeds[:security_key_direct][:credential_creation_options][:challenge]) |
| 549 | + base64_strict_decode64(seeds[:security_key_direct][:credential_creation_options][:challenge]) |
550 | 550 | end |
551 | 551 |
|
552 | 552 | let(:origin) { "http://localhost:3000" } |
|
555 | 555 | response = seeds[:security_key_direct][:authenticator_attestation_response] |
556 | 556 |
|
557 | 557 | WebAuthn::AuthenticatorAttestationResponse.new( |
558 | | - attestation_object: Base64.strict_decode64(response[:attestation_object]), |
559 | | - client_data_json: Base64.strict_decode64(response[:client_data_json]) |
| 558 | + attestation_object: base64_strict_decode64(response[:attestation_object]), |
| 559 | + client_data_json: base64_strict_decode64(response[:client_data_json]) |
560 | 560 | ) |
561 | 561 | end |
562 | 562 |
|
|
0 commit comments