Skip to content

Commit 3776c9f

Browse files
authored
Fix tests to use valid PBE iterations (#75238)
1 parent a62d237 commit 3776c9f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/libraries/System.Security.Cryptography/tests/AsymmetricAlgorithmTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ public static void ExportPem_CharPassword_ExportEncryptedPkcs8PrivateKeyPem()
370370
PbeParameters expectedPbeParameters = new PbeParameters(
371371
PbeEncryptionAlgorithm.Aes256Cbc,
372372
HashAlgorithmName.SHA384,
373-
RandomNumberGenerator.GetInt32(0, 100_000));
373+
RandomNumberGenerator.GetInt32(1, 100_000));
374374

375375
byte[] ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<char> password, PbeParameters pbeParameters)
376376
{
@@ -407,7 +407,7 @@ public static void ExportPem_BytePassword_ExportEncryptedPkcs8PrivateKeyPem()
407407
PbeParameters expectedPbeParameters = new PbeParameters(
408408
PbeEncryptionAlgorithm.Aes256Cbc,
409409
HashAlgorithmName.SHA384,
410-
RandomNumberGenerator.GetInt32(0, 100_000));
410+
RandomNumberGenerator.GetInt32(1, 100_000));
411411

412412
byte[] ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<byte> passwordBytes, PbeParameters pbeParameters)
413413
{
@@ -444,7 +444,7 @@ public static void ExportPem_CharPassword_TryExportEncryptedPkcs8PrivateKeyPem()
444444
PbeParameters expectedPbeParameters = new PbeParameters(
445445
PbeEncryptionAlgorithm.Aes256Cbc,
446446
HashAlgorithmName.SHA384,
447-
RandomNumberGenerator.GetInt32(0, 100_000));
447+
RandomNumberGenerator.GetInt32(1, 100_000));
448448

449449
bool TryExportEncryptedPkcs8PrivateKey(
450450
ReadOnlySpan<char> password,
@@ -510,7 +510,7 @@ public static void ExportPem_BytePassword_TryExportEncryptedPkcs8PrivateKeyPem()
510510
PbeParameters expectedPbeParameters = new PbeParameters(
511511
PbeEncryptionAlgorithm.Aes256Cbc,
512512
HashAlgorithmName.SHA384,
513-
RandomNumberGenerator.GetInt32(0, 100_000));
513+
RandomNumberGenerator.GetInt32(1, 100_000));
514514

515515
bool TryExportEncryptedPkcs8PrivateKey(
516516
ReadOnlySpan<byte> passwordBytes,

0 commit comments

Comments
 (0)