Skip to content

Commit 95b353f

Browse files
authored
test: retry zipcrypto password tests once (#614)
This is due to the password check only comparing a single byte (as per the spec), which have a 1/255 chance of actually matching regardless of password.
1 parent 87ffb39 commit 95b353f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/ICSharpCode.SharpZipLib.Tests/Zip/GeneralHandling.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,11 @@ public void UnsupportedCompressionMethod()
147147

148148
/// <summary>
149149
/// Invalid passwords should be detected early if possible, seekable stream
150+
/// Note: Have a 1/255 chance of failing due to CRC collision (hence retried once)
150151
/// </summary>
151152
[Test]
152153
[Category("Zip")]
154+
[Retry(2)]
153155
public void InvalidPasswordSeekable()
154156
{
155157
byte[] originalData = null;
@@ -216,9 +218,11 @@ public void ExerciseGetNextEntry()
216218

217219
/// <summary>
218220
/// Invalid passwords should be detected early if possible, non seekable stream
221+
/// Note: Have a 1/255 chance of failing due to CRC collision (hence retried once)
219222
/// </summary>
220223
[Test]
221224
[Category("Zip")]
225+
[Retry(2)]
222226
public void InvalidPasswordNonSeekable()
223227
{
224228
byte[] originalData = null;

0 commit comments

Comments
 (0)