Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/SharpCompress/Readers/Arj/ArjReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ protected override IEnumerable<ArjEntry> GetEntries(Stream stream)
"Multi volumes are currently not supported"
);
}
if (mainHeader?.IsGabled == true)
{
throw new CryptographicException(
"Password protected archives are currently not supported"
);
}

if (_volume == null)
{
Expand Down
6 changes: 6 additions & 0 deletions tests/SharpCompress.Test/Arj/ArjReaderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ public ArjReaderTests()
[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()
{
Expand Down
Binary file added tests/TestArchives/Archives/Arj.encrypted.arj
Binary file not shown.