@@ -49,7 +49,7 @@ public class AuthenticatorResponse
49
49
[ InlineData ( "https://[0:0:0:0:0:0:0:1]" , "https://[0:0:0:0:0:0:0:1]:443" ) ]
50
50
public async Task TestAuthenticatorOrigins ( string origin , string expectedOrigin )
51
51
{
52
- var challenge = RandomGenerator . Default . GenerateBytes ( 128 ) ;
52
+ var challenge = RandomNumberGenerator . GetBytes ( 128 ) ;
53
53
var rp = origin ;
54
54
var acd = new AttestedCredentialData ( ( "00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-40-FE-6A-32-63-BE-37-D1-01-B1-2E-57-CA-96-6C-00-22-93-E4-19-C8-CD-01-06-23-0B-C6-92-E8-CC-77-12-21-F1-DB-11-5D-41-0F-82-6B-DB-98-AC-64-2E-B1-AE-B5-A8-03-D1-DB-C1-47-EF-37-1C-FD-B1-CE-B0-48-CB-2C-A5-01-02-03-26-20-01-21-58-20-A6-D1-09-38-5A-C7-8E-5B-F0-3D-1C-2E-08-74-BE-6D-BB-A4-0B-4F-2A-5F-2F-11-82-45-65-65-53-4F-67-28-22-58-20-43-E1-08-2A-F3-13-5B-40-60-93-79-AC-47-42-58-AA-B3-97-B8-86-1D-E4-41-B4-4E-83-08-5D-1C-6B-E0-D0" ) . Split ( '-' ) . Select ( c => Convert . ToByte ( c , 16 ) ) . ToArray ( ) ) ;
55
55
var authData = new AuthenticatorData (
@@ -153,7 +153,7 @@ public async Task TestAuthenticatorOrigins(string origin, string expectedOrigin)
153
153
[ InlineData ( "http://[0:0:0:0:0:0:0:1]" , "https://[0:0:0:0:0:0:0:1]:443" ) ]
154
154
public void TestAuthenticatorOriginsFail ( string origin , string expectedOrigin )
155
155
{
156
- var challenge = RandomGenerator . Default . GenerateBytes ( 128 ) ;
156
+ var challenge = RandomNumberGenerator . GetBytes ( 128 ) ;
157
157
var rp = origin ;
158
158
var acd = new AttestedCredentialData ( ( "00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-40-FE-6A-32-63-BE-37-D1-01-B1-2E-57-CA-96-6C-00-22-93-E4-19-C8-CD-01-06-23-0B-C6-92-E8-CC-77-12-21-F1-DB-11-5D-41-0F-82-6B-DB-98-AC-64-2E-B1-AE-B5-A8-03-D1-DB-C1-47-EF-37-1C-FD-B1-CE-B0-48-CB-2C-A5-01-02-03-26-20-01-21-58-20-A6-D1-09-38-5A-C7-8E-5B-F0-3D-1C-2E-08-74-BE-6D-BB-A4-0B-4F-2A-5F-2F-11-82-45-65-65-53-4F-67-28-22-58-20-43-E1-08-2A-F3-13-5B-40-60-93-79-AC-47-42-58-AA-B3-97-B8-86-1D-E4-41-B4-4E-83-08-5D-1C-6B-E0-D0" ) . Split ( '-' ) . Select ( c => Convert . ToByte ( c , 16 ) ) . ToArray ( ) ) ;
159
159
var authData = new AuthenticatorData (
@@ -230,7 +230,7 @@ public void TestAuthenticatorOriginsFail(string origin, string expectedOrigin)
230
230
[ Fact ]
231
231
public void TestAuthenticatorAttestationRawResponse ( )
232
232
{
233
- var challenge = RandomGenerator . Default . GenerateBytes ( 128 ) ;
233
+ var challenge = RandomNumberGenerator . GetBytes ( 128 ) ;
234
234
var clientDataJson = JsonSerializer . SerializeToUtf8Bytes ( new
235
235
{
236
236
Type = "webauthn.create" ,
@@ -356,7 +356,7 @@ public void TestAuthenticatorAttestationObjectMalformed(byte[] value)
356
356
[ Fact ]
357
357
public void TestAuthenticatorAttestationResponseInvalidType ( )
358
358
{
359
- var challenge = RandomGenerator . Default . GenerateBytes ( 128 ) ;
359
+ var challenge = RandomNumberGenerator . GetBytes ( 128 ) ;
360
360
var rp = "https://www.passwordless.dev" ;
361
361
var clientDataJson = JsonSerializer . SerializeToUtf8Bytes ( new
362
362
{
@@ -428,7 +428,7 @@ public void TestAuthenticatorAttestationResponseInvalidType()
428
428
[ InlineData ( new byte [ 0 ] ) ]
429
429
public void TestAuthenticatorAttestationResponseInvalidRawId ( byte [ ] value )
430
430
{
431
- var challenge = RandomGenerator . Default . GenerateBytes ( 128 ) ;
431
+ var challenge = RandomNumberGenerator . GetBytes ( 128 ) ;
432
432
var rp = "https://www.passwordless.dev" ;
433
433
byte [ ] clientDataJson = JsonSerializer . SerializeToUtf8Bytes ( new {
434
434
type = "webauthn.create" ,
@@ -446,7 +446,7 @@ public void TestAuthenticatorAttestationResponseInvalidRawId(byte[] value)
446
446
AttestationObject = new CborMap {
447
447
{ "fmt" , "testing" } ,
448
448
{ "attStmt" , new CborMap ( ) } ,
449
- { "authData" , new byte [ 0 ] }
449
+ { "authData" , Array . Empty < byte > ( ) }
450
450
} . Encode ( ) ,
451
451
ClientDataJson = clientDataJson
452
452
} ,
@@ -497,7 +497,7 @@ public void TestAuthenticatorAttestationResponseInvalidRawId(byte[] value)
497
497
[ Fact ]
498
498
public void TestAuthenticatorAttestationResponseInvalidRawType ( )
499
499
{
500
- var challenge = RandomGenerator . Default . GenerateBytes ( 128 ) ;
500
+ var challenge = RandomNumberGenerator . GetBytes ( 128 ) ;
501
501
var rp = "https://www.passwordless.dev" ;
502
502
var clientDataJson = JsonSerializer . SerializeToUtf8Bytes ( new {
503
503
type = "webauthn.create" ,
@@ -515,7 +515,7 @@ public void TestAuthenticatorAttestationResponseInvalidRawType()
515
515
AttestationObject = new CborMap {
516
516
{ "fmt" , "testing" } ,
517
517
{ "attStmt" , new CborMap ( ) } ,
518
- { "authData" , new byte [ 0 ] }
518
+ { "authData" , Array . Empty < byte > ( ) }
519
519
} . Encode ( ) ,
520
520
ClientDataJson = clientDataJson
521
521
} ,
@@ -566,7 +566,7 @@ public void TestAuthenticatorAttestationResponseInvalidRawType()
566
566
[ Fact ]
567
567
public void TestAuthenticatorAttestationResponseRpidMismatch ( )
568
568
{
569
- var challenge = RandomGenerator . Default . GenerateBytes ( 128 ) ;
569
+ var challenge = RandomNumberGenerator . GetBytes ( 128 ) ;
570
570
var rp = "https://www.passwordless.dev" ;
571
571
var authData = new AuthenticatorData (
572
572
SHA256 . HashData ( Encoding . UTF8 . GetBytes ( "passwordless.dev" ) ) ,
@@ -643,7 +643,7 @@ public void TestAuthenticatorAttestationResponseRpidMismatch()
643
643
[ Fact ]
644
644
public void TestAuthenticatorAttestationResponseNotUserPresent ( )
645
645
{
646
- var challenge = RandomGenerator . Default . GenerateBytes ( 128 ) ;
646
+ var challenge = RandomNumberGenerator . GetBytes ( 128 ) ;
647
647
var rp = "https://www.passwordless.dev" ;
648
648
var authData = new AuthenticatorData (
649
649
SHA256 . HashData ( Encoding . UTF8 . GetBytes ( rp ) ) ,
@@ -721,7 +721,7 @@ public void TestAuthenticatorAttestationResponseNotUserPresent()
721
721
[ Fact ]
722
722
public void TestAuthenticatorAttestationResponseNoAttestedCredentialData ( )
723
723
{
724
- var challenge = RandomGenerator . Default . GenerateBytes ( 128 ) ;
724
+ var challenge = RandomNumberGenerator . GetBytes ( 128 ) ;
725
725
var rp = "https://www.passwordless.dev" ;
726
726
var authData = new AuthenticatorData (
727
727
SHA256 . HashData ( Encoding . UTF8 . GetBytes ( rp ) ) ,
@@ -798,7 +798,7 @@ public void TestAuthenticatorAttestationResponseNoAttestedCredentialData()
798
798
[ Fact ]
799
799
public void TestAuthenticatorAttestationResponseUnknownAttestationType ( )
800
800
{
801
- var challenge = RandomGenerator . Default . GenerateBytes ( 128 ) ;
801
+ var challenge = RandomNumberGenerator . GetBytes ( 128 ) ;
802
802
var rp = "https://www.passwordless.dev" ;
803
803
var acd = new AttestedCredentialData ( ( "00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-40-FE-6A-32-63-BE-37-D1-01-B1-2E-57-CA-96-6C-00-22-93-E4-19-C8-CD-01-06-23-0B-C6-92-E8-CC-77-12-21-F1-DB-11-5D-41-0F-82-6B-DB-98-AC-64-2E-B1-AE-B5-A8-03-D1-DB-C1-47-EF-37-1C-FD-B1-CE-B0-48-CB-2C-A5-01-02-03-26-20-01-21-58-20-A6-D1-09-38-5A-C7-8E-5B-F0-3D-1C-2E-08-74-BE-6D-BB-A4-0B-4F-2A-5F-2F-11-82-45-65-65-53-4F-67-28-22-58-20-43-E1-08-2A-F3-13-5B-40-60-93-79-AC-47-42-58-AA-B3-97-B8-86-1D-E4-41-B4-4E-83-08-5D-1C-6B-E0-D0" ) . Split ( '-' ) . Select ( c => Convert . ToByte ( c , 16 ) ) . ToArray ( ) ) ;
804
804
var authData = new AuthenticatorData (
@@ -876,7 +876,7 @@ public void TestAuthenticatorAttestationResponseUnknownAttestationType()
876
876
[ Fact ]
877
877
public void TestAuthenticatorAttestationResponseNotUniqueCredId ( )
878
878
{
879
- var challenge = RandomGenerator . Default . GenerateBytes ( 128 ) ;
879
+ var challenge = RandomNumberGenerator . GetBytes ( 128 ) ;
880
880
var rp = "https://www.passwordless.dev" ;
881
881
var acd = new AttestedCredentialData ( ( "00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-40-FE-6A-32-63-BE-37-D1-01-B1-2E-57-CA-96-6C-00-22-93-E4-19-C8-CD-01-06-23-0B-C6-92-E8-CC-77-12-21-F1-DB-11-5D-41-0F-82-6B-DB-98-AC-64-2E-B1-AE-B5-A8-03-D1-DB-C1-47-EF-37-1C-FD-B1-CE-B0-48-CB-2C-A5-01-02-03-26-20-01-21-58-20-A6-D1-09-38-5A-C7-8E-5B-F0-3D-1C-2E-08-74-BE-6D-BB-A4-0B-4F-2A-5F-2F-11-82-45-65-65-53-4F-67-28-22-58-20-43-E1-08-2A-F3-13-5B-40-60-93-79-AC-47-42-58-AA-B3-97-B8-86-1D-E4-41-B4-4E-83-08-5D-1C-6B-E0-D0" ) . Split ( '-' ) . Select ( c => Convert . ToByte ( c , 16 ) ) . ToArray ( ) ) ;
882
882
var authData = new AuthenticatorData (
@@ -953,7 +953,7 @@ public void TestAuthenticatorAttestationResponseNotUniqueCredId()
953
953
[ Fact ]
954
954
public void TestAuthenticatorAttestationResponseUVRequired ( )
955
955
{
956
- var challenge = RandomGenerator . Default . GenerateBytes ( 128 ) ;
956
+ var challenge = RandomNumberGenerator . GetBytes ( 128 ) ;
957
957
var rp = "https://www.passwordless.dev" ;
958
958
var acd = new AttestedCredentialData ( ( "00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-40-FE-6A-32-63-BE-37-D1-01-B1-2E-57-CA-96-6C-00-22-93-E4-19-C8-CD-01-06-23-0B-C6-92-E8-CC-77-12-21-F1-DB-11-5D-41-0F-82-6B-DB-98-AC-64-2E-B1-AE-B5-A8-03-D1-DB-C1-47-EF-37-1C-FD-B1-CE-B0-48-CB-2C-A5-01-02-03-26-20-01-21-58-20-A6-D1-09-38-5A-C7-8E-5B-F0-3D-1C-2E-08-74-BE-6D-BB-A4-0B-4F-2A-5F-2F-11-82-45-65-65-53-4F-67-28-22-58-20-43-E1-08-2A-F3-13-5B-40-60-93-79-AC-47-42-58-AA-B3-97-B8-86-1D-E4-41-B4-4E-83-08-5D-1C-6B-E0-D0" ) . Split ( '-' ) . Select ( c => Convert . ToByte ( c , 16 ) ) . ToArray ( ) ) ;
959
959
var authData = new AuthenticatorData (
@@ -1030,7 +1030,7 @@ public void TestAuthenticatorAttestationResponseUVRequired()
1030
1030
[ Fact ]
1031
1031
public void TestAuthenticatorAssertionRawResponse ( )
1032
1032
{
1033
- var challenge = RandomGenerator . Default . GenerateBytes ( 128 ) ;
1033
+ var challenge = RandomNumberGenerator . GetBytes ( 128 ) ;
1034
1034
var clientDataJson = JsonSerializer . SerializeToUtf8Bytes ( new
1035
1035
{
1036
1036
Type = "webauthn.get" ,
0 commit comments