@@ -49,7 +49,7 @@ public class AuthenticatorResponse
4949 [ InlineData ( "https://[0:0:0:0:0:0:0:1]" , "https://[0:0:0:0:0:0:0:1]:443" ) ]
5050 public async Task TestAuthenticatorOrigins ( string origin , string expectedOrigin )
5151 {
52- var challenge = RandomGenerator . Default . GenerateBytes ( 128 ) ;
52+ var challenge = RandomNumberGenerator . GetBytes ( 128 ) ;
5353 var rp = origin ;
5454 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 ( ) ) ;
5555 var authData = new AuthenticatorData (
@@ -153,7 +153,7 @@ public async Task TestAuthenticatorOrigins(string origin, string expectedOrigin)
153153 [ InlineData ( "http://[0:0:0:0:0:0:0:1]" , "https://[0:0:0:0:0:0:0:1]:443" ) ]
154154 public void TestAuthenticatorOriginsFail ( string origin , string expectedOrigin )
155155 {
156- var challenge = RandomGenerator . Default . GenerateBytes ( 128 ) ;
156+ var challenge = RandomNumberGenerator . GetBytes ( 128 ) ;
157157 var rp = origin ;
158158 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 ( ) ) ;
159159 var authData = new AuthenticatorData (
@@ -230,7 +230,7 @@ public void TestAuthenticatorOriginsFail(string origin, string expectedOrigin)
230230 [ Fact ]
231231 public void TestAuthenticatorAttestationRawResponse ( )
232232 {
233- var challenge = RandomGenerator . Default . GenerateBytes ( 128 ) ;
233+ var challenge = RandomNumberGenerator . GetBytes ( 128 ) ;
234234 var clientDataJson = JsonSerializer . SerializeToUtf8Bytes ( new
235235 {
236236 Type = "webauthn.create" ,
@@ -356,7 +356,7 @@ public void TestAuthenticatorAttestationObjectMalformed(byte[] value)
356356 [ Fact ]
357357 public void TestAuthenticatorAttestationResponseInvalidType ( )
358358 {
359- var challenge = RandomGenerator . Default . GenerateBytes ( 128 ) ;
359+ var challenge = RandomNumberGenerator . GetBytes ( 128 ) ;
360360 var rp = "https://www.passwordless.dev" ;
361361 var clientDataJson = JsonSerializer . SerializeToUtf8Bytes ( new
362362 {
@@ -428,7 +428,7 @@ public void TestAuthenticatorAttestationResponseInvalidType()
428428 [ InlineData ( new byte [ 0 ] ) ]
429429 public void TestAuthenticatorAttestationResponseInvalidRawId ( byte [ ] value )
430430 {
431- var challenge = RandomGenerator . Default . GenerateBytes ( 128 ) ;
431+ var challenge = RandomNumberGenerator . GetBytes ( 128 ) ;
432432 var rp = "https://www.passwordless.dev" ;
433433 byte [ ] clientDataJson = JsonSerializer . SerializeToUtf8Bytes ( new {
434434 type = "webauthn.create" ,
@@ -446,7 +446,7 @@ public void TestAuthenticatorAttestationResponseInvalidRawId(byte[] value)
446446 AttestationObject = new CborMap {
447447 { "fmt" , "testing" } ,
448448 { "attStmt" , new CborMap ( ) } ,
449- { "authData" , new byte [ 0 ] }
449+ { "authData" , Array . Empty < byte > ( ) }
450450 } . Encode ( ) ,
451451 ClientDataJson = clientDataJson
452452 } ,
@@ -497,7 +497,7 @@ public void TestAuthenticatorAttestationResponseInvalidRawId(byte[] value)
497497 [ Fact ]
498498 public void TestAuthenticatorAttestationResponseInvalidRawType ( )
499499 {
500- var challenge = RandomGenerator . Default . GenerateBytes ( 128 ) ;
500+ var challenge = RandomNumberGenerator . GetBytes ( 128 ) ;
501501 var rp = "https://www.passwordless.dev" ;
502502 var clientDataJson = JsonSerializer . SerializeToUtf8Bytes ( new {
503503 type = "webauthn.create" ,
@@ -515,7 +515,7 @@ public void TestAuthenticatorAttestationResponseInvalidRawType()
515515 AttestationObject = new CborMap {
516516 { "fmt" , "testing" } ,
517517 { "attStmt" , new CborMap ( ) } ,
518- { "authData" , new byte [ 0 ] }
518+ { "authData" , Array . Empty < byte > ( ) }
519519 } . Encode ( ) ,
520520 ClientDataJson = clientDataJson
521521 } ,
@@ -566,7 +566,7 @@ public void TestAuthenticatorAttestationResponseInvalidRawType()
566566 [ Fact ]
567567 public void TestAuthenticatorAttestationResponseRpidMismatch ( )
568568 {
569- var challenge = RandomGenerator . Default . GenerateBytes ( 128 ) ;
569+ var challenge = RandomNumberGenerator . GetBytes ( 128 ) ;
570570 var rp = "https://www.passwordless.dev" ;
571571 var authData = new AuthenticatorData (
572572 SHA256 . HashData ( Encoding . UTF8 . GetBytes ( "passwordless.dev" ) ) ,
@@ -643,7 +643,7 @@ public void TestAuthenticatorAttestationResponseRpidMismatch()
643643 [ Fact ]
644644 public void TestAuthenticatorAttestationResponseNotUserPresent ( )
645645 {
646- var challenge = RandomGenerator . Default . GenerateBytes ( 128 ) ;
646+ var challenge = RandomNumberGenerator . GetBytes ( 128 ) ;
647647 var rp = "https://www.passwordless.dev" ;
648648 var authData = new AuthenticatorData (
649649 SHA256 . HashData ( Encoding . UTF8 . GetBytes ( rp ) ) ,
@@ -721,7 +721,7 @@ public void TestAuthenticatorAttestationResponseNotUserPresent()
721721 [ Fact ]
722722 public void TestAuthenticatorAttestationResponseNoAttestedCredentialData ( )
723723 {
724- var challenge = RandomGenerator . Default . GenerateBytes ( 128 ) ;
724+ var challenge = RandomNumberGenerator . GetBytes ( 128 ) ;
725725 var rp = "https://www.passwordless.dev" ;
726726 var authData = new AuthenticatorData (
727727 SHA256 . HashData ( Encoding . UTF8 . GetBytes ( rp ) ) ,
@@ -798,7 +798,7 @@ public void TestAuthenticatorAttestationResponseNoAttestedCredentialData()
798798 [ Fact ]
799799 public void TestAuthenticatorAttestationResponseUnknownAttestationType ( )
800800 {
801- var challenge = RandomGenerator . Default . GenerateBytes ( 128 ) ;
801+ var challenge = RandomNumberGenerator . GetBytes ( 128 ) ;
802802 var rp = "https://www.passwordless.dev" ;
803803 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 ( ) ) ;
804804 var authData = new AuthenticatorData (
@@ -876,7 +876,7 @@ public void TestAuthenticatorAttestationResponseUnknownAttestationType()
876876 [ Fact ]
877877 public void TestAuthenticatorAttestationResponseNotUniqueCredId ( )
878878 {
879- var challenge = RandomGenerator . Default . GenerateBytes ( 128 ) ;
879+ var challenge = RandomNumberGenerator . GetBytes ( 128 ) ;
880880 var rp = "https://www.passwordless.dev" ;
881881 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 ( ) ) ;
882882 var authData = new AuthenticatorData (
@@ -953,7 +953,7 @@ public void TestAuthenticatorAttestationResponseNotUniqueCredId()
953953 [ Fact ]
954954 public void TestAuthenticatorAttestationResponseUVRequired ( )
955955 {
956- var challenge = RandomGenerator . Default . GenerateBytes ( 128 ) ;
956+ var challenge = RandomNumberGenerator . GetBytes ( 128 ) ;
957957 var rp = "https://www.passwordless.dev" ;
958958 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 ( ) ) ;
959959 var authData = new AuthenticatorData (
@@ -1030,7 +1030,7 @@ public void TestAuthenticatorAttestationResponseUVRequired()
10301030 [ Fact ]
10311031 public void TestAuthenticatorAssertionRawResponse ( )
10321032 {
1033- var challenge = RandomGenerator . Default . GenerateBytes ( 128 ) ;
1033+ var challenge = RandomNumberGenerator . GetBytes ( 128 ) ;
10341034 var clientDataJson = JsonSerializer . SerializeToUtf8Bytes ( new
10351035 {
10361036 Type = "webauthn.get" ,
0 commit comments