@@ -20,7 +20,7 @@ public class AuthenticatorResponse
20
20
[ InlineData ( "https://www.passwordless.dev:443" , "https://www.passwordless.dev:443" ) ]
21
21
[ InlineData ( "https://www.passwordless.dev" , "https://www.passwordless.dev:443" ) ]
22
22
[ InlineData ( "https://www.passwordless.dev:443" , "https://www.passwordless.dev" ) ]
23
- [ InlineData ( "https://www.passwordless.dev:443/foo/bar.html" , "https://www.passwordless.dev:443/foo/bar.html" ) ]
23
+ [ InlineData ( "https://www.passwordless.dev:443/foo/bar.html" , "https://www.passwordless.dev:443/foo/bar.html" ) ]
24
24
[ InlineData ( "https://www.passwordless.dev:443/foo/bar.html" , "https://www.passwordless.dev:443/bar/foo.html" ) ]
25
25
[ InlineData ( "https://www.passwordless.dev:443/foo/bar.html" , "https://www.passwordless.dev/bar/foo.html" ) ]
26
26
[ InlineData ( "https://www.passwordless.dev:443/foo/bar.html" , "https://www.passwordless.dev" ) ]
@@ -38,7 +38,7 @@ public class AuthenticatorResponse
38
38
[ InlineData ( "lorem://ipsum:1234" , "lorem://ipsum:1234" ) ]
39
39
[ InlineData ( "lorem://ipsum:9876/sit" , "lorem://ipsum:9876/sit" ) ]
40
40
[ InlineData ( "foo://bar:321/path/" , "foo://bar:321/path/" ) ]
41
- [ InlineData ( "foo://bar:321/path" , "foo://bar:321/path" ) ]
41
+ [ InlineData ( "foo://bar:321/path" , "foo://bar:321/path" ) ]
42
42
[ InlineData ( "http://[0:0:0:0:0:0:0:1]" , "http://[0:0:0:0:0:0:0:1]" ) ]
43
43
[ InlineData ( "http://[0:0:0:0:0:0:0:1]" , "http://[0:0:0:0:0:0:0:1]:80" ) ]
44
44
[ InlineData ( "https://[0:0:0:0:0:0:0:1]" , "https://[0:0:0:0:0:0:0:1]" ) ]
@@ -55,7 +55,7 @@ public async Task TestAuthenticatorOriginsAsync(string origin, string expectedOr
55
55
acd
56
56
) . ToByteArray ( ) ;
57
57
58
- byte [ ] clientDataJson = JsonSerializer . SerializeToUtf8Bytes ( new
58
+ byte [ ] clientDataJson = JsonSerializer . SerializeToUtf8Bytes ( new
59
59
{
60
60
type = "webauthn.create" ,
61
61
challenge = challenge ,
@@ -257,6 +257,15 @@ public void TestAuthenticatorAttestationRawResponse()
257
257
4 // USER_VERIFY_PASSCODE_INTERNAL
258
258
} ,
259
259
} ,
260
+ PRF = new AuthenticationExtensionsPRFOutputs
261
+ {
262
+ Enabled = true ,
263
+ Results = new AuthenticationExtensionsPRFValues
264
+ {
265
+ First = new byte [ ] { 0xf1 , 0xd0 } ,
266
+ Second = new byte [ ] { 0xf1 , 0xd0 }
267
+ }
268
+ }
260
269
}
261
270
} ;
262
271
Assert . Equal ( PublicKeyCredentialType . PublicKey , rawResponse . Type ) ;
@@ -269,6 +278,9 @@ public void TestAuthenticatorAttestationRawResponse()
269
278
Assert . Equal ( rawResponse . Extensions . Extensions , new string [ ] { "foo" , "bar" } ) ;
270
279
Assert . Equal ( "test" , rawResponse . Extensions . Example ) ;
271
280
Assert . Equal ( ( ulong ) 4 , rawResponse . Extensions . UserVerificationMethod [ 0 ] [ 0 ] ) ;
281
+ Assert . True ( rawResponse . Extensions . PRF . Enabled ) ;
282
+ Assert . True ( rawResponse . Extensions . PRF . Results . First . SequenceEqual ( new byte [ ] { 0xf1 , 0xd0 } ) ) ;
283
+ Assert . True ( rawResponse . Extensions . PRF . Results . Second . SequenceEqual ( new byte [ ] { 0xf1 , 0xd0 } ) ) ;
272
284
}
273
285
274
286
[ Fact ]
@@ -357,7 +369,7 @@ public void TestAuthenticatorAttestationResponseInvalidType()
357
369
{
358
370
var challenge = RandomNumberGenerator . GetBytes ( 128 ) ;
359
371
var rp = "https://www.passwordless.dev" ;
360
- var clientDataJson = JsonSerializer . SerializeToUtf8Bytes ( new
372
+ var clientDataJson = JsonSerializer . SerializeToUtf8Bytes ( new
361
373
{
362
374
Type = "webauthn.get" ,
363
375
Challenge = challenge ,
@@ -429,7 +441,8 @@ public void TestAuthenticatorAttestationResponseInvalidRawId(byte[] value)
429
441
{
430
442
var challenge = RandomNumberGenerator . GetBytes ( 128 ) ;
431
443
var rp = "https://www.passwordless.dev" ;
432
- byte [ ] clientDataJson = JsonSerializer . SerializeToUtf8Bytes ( new {
444
+ byte [ ] clientDataJson = JsonSerializer . SerializeToUtf8Bytes ( new
445
+ {
433
446
type = "webauthn.create" ,
434
447
challenge = challenge ,
435
448
origin = rp ,
@@ -498,7 +511,8 @@ public void TestAuthenticatorAttestationResponseInvalidRawType()
498
511
{
499
512
var challenge = RandomNumberGenerator . GetBytes ( 128 ) ;
500
513
var rp = "https://www.passwordless.dev" ;
501
- var clientDataJson = JsonSerializer . SerializeToUtf8Bytes ( new {
514
+ var clientDataJson = JsonSerializer . SerializeToUtf8Bytes ( new
515
+ {
502
516
type = "webauthn.create" ,
503
517
challenge = challenge ,
504
518
origin = rp ,
@@ -652,7 +666,7 @@ public async Task TestAuthenticatorAttestationResponseNotUserPresentAsync()
652
666
null
653
667
) . ToByteArray ( ) ;
654
668
655
- var clientDataJson = JsonSerializer . SerializeToUtf8Bytes ( new
669
+ var clientDataJson = JsonSerializer . SerializeToUtf8Bytes ( new
656
670
{
657
671
type = "webauthn.create" ,
658
672
challenge = challenge ,
@@ -972,7 +986,7 @@ public void TestAuthenticatorAttestationResponseUnknownAttestationType()
972
986
challenge = challenge ,
973
987
origin = rp ,
974
988
} ) ;
975
-
989
+
976
990
var rawResponse = new AuthenticatorAttestationRawResponse
977
991
{
978
992
Type = PublicKeyCredentialType . PublicKey ,
@@ -1224,6 +1238,15 @@ public void TestAuthenticatorAssertionRawResponse()
1224
1238
4 // USER_VERIFY_PASSCODE_INTERNAL
1225
1239
} ,
1226
1240
} ,
1241
+ PRF = new AuthenticationExtensionsPRFOutputs
1242
+ {
1243
+ Enabled = true ,
1244
+ Results = new AuthenticationExtensionsPRFValues
1245
+ {
1246
+ First = new byte [ ] { 0xf1 , 0xd0 } ,
1247
+ Second = new byte [ ] { 0xf1 , 0xd0 }
1248
+ }
1249
+ }
1227
1250
}
1228
1251
} ;
1229
1252
Assert . Equal ( PublicKeyCredentialType . PublicKey , assertionResponse . Type ) ;
@@ -1238,6 +1261,9 @@ public void TestAuthenticatorAssertionRawResponse()
1238
1261
Assert . Equal ( assertionResponse . Extensions . Extensions , new string [ ] { "foo" , "bar" } ) ;
1239
1262
Assert . Equal ( "test" , assertionResponse . Extensions . Example ) ;
1240
1263
Assert . Equal ( ( ulong ) 4 , assertionResponse . Extensions . UserVerificationMethod [ 0 ] [ 0 ] ) ;
1264
+ Assert . True ( assertionResponse . Extensions . PRF . Enabled ) ;
1265
+ Assert . True ( assertionResponse . Extensions . PRF . Results . First . SequenceEqual ( new byte [ ] { 0xf1 , 0xd0 } ) ) ;
1266
+ Assert . True ( assertionResponse . Extensions . PRF . Results . Second . SequenceEqual ( new byte [ ] { 0xf1 , 0xd0 } ) ) ;
1241
1267
}
1242
1268
1243
1269
[ Fact ]
0 commit comments