@@ -20,7 +20,7 @@ public class AuthenticatorResponse
2020 [ InlineData ( "https://www.passwordless.dev:443" , "https://www.passwordless.dev:443" ) ]
2121 [ InlineData ( "https://www.passwordless.dev" , "https://www.passwordless.dev:443" ) ]
2222 [ 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" ) ]
2424 [ InlineData ( "https://www.passwordless.dev:443/foo/bar.html" , "https://www.passwordless.dev:443/bar/foo.html" ) ]
2525 [ InlineData ( "https://www.passwordless.dev:443/foo/bar.html" , "https://www.passwordless.dev/bar/foo.html" ) ]
2626 [ InlineData ( "https://www.passwordless.dev:443/foo/bar.html" , "https://www.passwordless.dev" ) ]
@@ -38,7 +38,7 @@ public class AuthenticatorResponse
3838 [ InlineData ( "lorem://ipsum:1234" , "lorem://ipsum:1234" ) ]
3939 [ InlineData ( "lorem://ipsum:9876/sit" , "lorem://ipsum:9876/sit" ) ]
4040 [ 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" ) ]
4242 [ InlineData ( "http://[0:0:0:0:0:0:0:1]" , "http://[0:0:0:0:0:0:0:1]" ) ]
4343 [ InlineData ( "http://[0:0:0:0:0:0:0:1]" , "http://[0:0:0:0:0:0:0:1]:80" ) ]
4444 [ 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
5555 acd
5656 ) . ToByteArray ( ) ;
5757
58- byte [ ] clientDataJson = JsonSerializer . SerializeToUtf8Bytes ( new
58+ byte [ ] clientDataJson = JsonSerializer . SerializeToUtf8Bytes ( new
5959 {
6060 type = "webauthn.create" ,
6161 challenge = challenge ,
@@ -257,6 +257,15 @@ public void TestAuthenticatorAttestationRawResponse()
257257 4 // USER_VERIFY_PASSCODE_INTERNAL
258258 } ,
259259 } ,
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+ }
260269 }
261270 } ;
262271 Assert . Equal ( PublicKeyCredentialType . PublicKey , rawResponse . Type ) ;
@@ -269,6 +278,9 @@ public void TestAuthenticatorAttestationRawResponse()
269278 Assert . Equal ( rawResponse . Extensions . Extensions , new string [ ] { "foo" , "bar" } ) ;
270279 Assert . Equal ( "test" , rawResponse . Extensions . Example ) ;
271280 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 } ) ) ;
272284 }
273285
274286 [ Fact ]
@@ -357,7 +369,7 @@ public void TestAuthenticatorAttestationResponseInvalidType()
357369 {
358370 var challenge = RandomNumberGenerator . GetBytes ( 128 ) ;
359371 var rp = "https://www.passwordless.dev" ;
360- var clientDataJson = JsonSerializer . SerializeToUtf8Bytes ( new
372+ var clientDataJson = JsonSerializer . SerializeToUtf8Bytes ( new
361373 {
362374 Type = "webauthn.get" ,
363375 Challenge = challenge ,
@@ -429,7 +441,8 @@ public void TestAuthenticatorAttestationResponseInvalidRawId(byte[] value)
429441 {
430442 var challenge = RandomNumberGenerator . GetBytes ( 128 ) ;
431443 var rp = "https://www.passwordless.dev" ;
432- byte [ ] clientDataJson = JsonSerializer . SerializeToUtf8Bytes ( new {
444+ byte [ ] clientDataJson = JsonSerializer . SerializeToUtf8Bytes ( new
445+ {
433446 type = "webauthn.create" ,
434447 challenge = challenge ,
435448 origin = rp ,
@@ -498,7 +511,8 @@ public void TestAuthenticatorAttestationResponseInvalidRawType()
498511 {
499512 var challenge = RandomNumberGenerator . GetBytes ( 128 ) ;
500513 var rp = "https://www.passwordless.dev" ;
501- var clientDataJson = JsonSerializer . SerializeToUtf8Bytes ( new {
514+ var clientDataJson = JsonSerializer . SerializeToUtf8Bytes ( new
515+ {
502516 type = "webauthn.create" ,
503517 challenge = challenge ,
504518 origin = rp ,
@@ -652,7 +666,7 @@ public async Task TestAuthenticatorAttestationResponseNotUserPresentAsync()
652666 null
653667 ) . ToByteArray ( ) ;
654668
655- var clientDataJson = JsonSerializer . SerializeToUtf8Bytes ( new
669+ var clientDataJson = JsonSerializer . SerializeToUtf8Bytes ( new
656670 {
657671 type = "webauthn.create" ,
658672 challenge = challenge ,
@@ -972,7 +986,7 @@ public void TestAuthenticatorAttestationResponseUnknownAttestationType()
972986 challenge = challenge ,
973987 origin = rp ,
974988 } ) ;
975-
989+
976990 var rawResponse = new AuthenticatorAttestationRawResponse
977991 {
978992 Type = PublicKeyCredentialType . PublicKey ,
@@ -1224,6 +1238,15 @@ public void TestAuthenticatorAssertionRawResponse()
12241238 4 // USER_VERIFY_PASSCODE_INTERNAL
12251239 } ,
12261240 } ,
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+ }
12271250 }
12281251 } ;
12291252 Assert . Equal ( PublicKeyCredentialType . PublicKey , assertionResponse . Type ) ;
@@ -1238,6 +1261,9 @@ public void TestAuthenticatorAssertionRawResponse()
12381261 Assert . Equal ( assertionResponse . Extensions . Extensions , new string [ ] { "foo" , "bar" } ) ;
12391262 Assert . Equal ( "test" , assertionResponse . Extensions . Example ) ;
12401263 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 } ) ) ;
12411267 }
12421268
12431269 [ Fact ]
0 commit comments