Merge pull request #1007 from TwanVanDongen/master

ArjReader throws exception for password protected archives.
This commit is contained in:
Adam Hathcock
2025-11-06 09:58:24 +00:00
committed by GitHub
3 changed files with 12 additions and 0 deletions

View File

@@ -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)
{

View File

@@ -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()
{

Binary file not shown.