icsharpcode / SharpZipLib

#ziplib is a Zip, GZip, Tar and BZip2 library written entirely in C# for the .NET platform.
http://icsharpcode.github.io/SharpZipLib/
MIT License
3.73k stars 976 forks source link

fix: replace uses of obsolete method `RNGCryptoServiceProvider` #766

Closed yihezkel closed 2 years ago

yihezkel commented 2 years ago

Replace insecure obsolete method (new RNGCryptoServiceProvider()) with RandomNumberGenerator.Create() in PkzipClassic, ZipFile and ZipOutputStream.

I certify that I own, and have sufficient rights to contribute, all source code and related material intended to be compiled or integrated with the source code for the SharpZipLib open source product (the "Contribution"). My Contribution is licensed under the MIT License.

codecov[bot] commented 2 years ago

Codecov Report

Merging #766 (8a9dcb9) into master (b5b1b07) will increase coverage by 0.02%. The diff coverage is 80.00%.

@@            Coverage Diff             @@
##           master     #766      +/-   ##
==========================================
+ Coverage   74.10%   74.13%   +0.02%     
==========================================
  Files          71       71              
  Lines        8441     8450       +9     
==========================================
+ Hits         6255     6264       +9     
  Misses       2186     2186              
Impacted Files Coverage Δ
...ICSharpCode.SharpZipLib/Encryption/PkzipClassic.cs 71.02% <0.00%> (ø)
src/ICSharpCode.SharpZipLib/Zip/ZipFile.cs 77.24% <100.00%> (ø)
src/ICSharpCode.SharpZipLib/Zip/ZipOutputStream.cs 87.82% <100.00%> (ø)
...harpCode.SharpZipLib/Encryption/ZipAESTransform.cs 89.09% <0.00%> (ø)
...arpCode.SharpZipLib/Tar/TarExtendedHeaderReader.cs 100.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

yihezkel commented 2 years ago

See https://docs.microsoft.com/en-us/dotnet/api/system.security.cryptography.rngcryptoserviceprovider?view=net-6.0 and https://github.com/dotnet/runtime/issues/40169