mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-04 05:25:00 +00:00
Merge pull request #1007 from TwanVanDongen/master
ArjReader throws exception for password protected archives.
This commit is contained in:
@@ -60,6 +60,12 @@ namespace SharpCompress.Readers.Arj
|
||||
"Multi volumes are currently not supported"
|
||||
);
|
||||
}
|
||||
if (mainHeader?.IsGabled == true)
|
||||
{
|
||||
throw new CryptographicException(
|
||||
"Password protected archives are currently not supported"
|
||||
);
|
||||
}
|
||||
|
||||
if (_volume == null)
|
||||
{
|
||||
|
||||
@@ -25,6 +25,12 @@ namespace SharpCompress.Test.Arj
|
||||
[Fact]
|
||||
public void Arj_Method4_Read() => Read("Arj.method4.arj");
|
||||
|
||||
[Fact]
|
||||
public void Arj_Encrypted_Read()
|
||||
{
|
||||
var exception = Assert.Throws<CryptographicException>(() => Read("Arj.encrypted.arj"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Arj_Multi_Reader()
|
||||
{
|
||||
|
||||
BIN
tests/TestArchives/Archives/Arj.encrypted.arj
Normal file
BIN
tests/TestArchives/Archives/Arj.encrypted.arj
Normal file
Binary file not shown.
Reference in New Issue
Block a user