diff options
author | Igor Pavlov <ipavlov@users.sourceforge.net> | 2016-05-23 03:00:00 +0300 |
---|---|---|
committer | Kornel LesiĆski <kornel@geekhood.net> | 2016-05-28 02:17:00 +0300 |
commit | 1eddf527cacc149016ec987d554d3dfb52b69131 (patch) | |
tree | 1e9577086dd9b3461bc3f6727f7449b7fe45eced /CPP/7zip/Archive/Rar | |
parent | bec3b479dcae1345a466ebe923989b0bd56fd5b6 (diff) |
16.0216.02
Diffstat (limited to 'CPP/7zip/Archive/Rar')
-rw-r--r-- | CPP/7zip/Archive/Rar/RarHandler.cpp | 8 | ||||
-rw-r--r-- | CPP/7zip/Archive/Rar/RarHandler.h | 4 | ||||
-rw-r--r-- | CPP/7zip/Archive/Rar/RarHeader.h | 3 |
3 files changed, 10 insertions, 5 deletions
diff --git a/CPP/7zip/Archive/Rar/RarHandler.cpp b/CPP/7zip/Archive/Rar/RarHandler.cpp index 71237c93..e858c1ea 100644 --- a/CPP/7zip/Archive/Rar/RarHandler.cpp +++ b/CPP/7zip/Archive/Rar/RarHandler.cpp @@ -220,6 +220,8 @@ HRESULT CInArchive::Open(IInStream *stream, const UInt64 *searchHeaderSizeLimit) ArcInfo.Flags = Get16(buf + 3); UInt32 headerSize = NHeader::NArchive::kArchiveHeaderSize; + + /* if (ArcInfo.IsThereEncryptVer()) { if (blockSize <= headerSize) @@ -229,6 +231,8 @@ HRESULT CInArchive::Open(IInStream *stream, const UInt64 *searchHeaderSizeLimit) ArcInfo.EncryptVersion = buf[NHeader::NArchive::kArchiveHeaderSize]; headerSize += 1; } + */ + if (blockSize < headerSize || buf[2] != NHeader::NBlockType::kArchiveHeader || !CheckHeaderCrc(buf, headerSize)) @@ -509,7 +513,7 @@ HRESULT CInArchive::GetNextItem(CItem &item, ICryptoGetTextPassword *getTextPass m_RarAESSpec = new NCrypto::NRar3::CDecoder; m_RarAES = m_RarAESSpec; } - m_RarAESSpec->SetRar350Mode(ArcInfo.IsEncryptOld()); + // m_RarAESSpec->SetRar350Mode(ArcInfo.IsEncryptOld()); // Salt const UInt32 kSaltSize = 8; @@ -1552,7 +1556,7 @@ STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems, rar3CryptoDecoderSpec = new NCrypto::NRar3::CDecoder; rar3CryptoDecoder = rar3CryptoDecoderSpec; } - rar3CryptoDecoderSpec->SetRar350Mode(item.UnPackVersion < 36); + // rar3CryptoDecoderSpec->SetRar350Mode(item.UnPackVersion < 36); /* CMyComPtr<ICompressSetDecoderProperties2> cryptoProperties; RINOK(rar3CryptoDecoder.QueryInterface(IID_ICompressSetDecoderProperties2, diff --git a/CPP/7zip/Archive/Rar/RarHandler.h b/CPP/7zip/Archive/Rar/RarHandler.h index e280eb57..901406d4 100644 --- a/CPP/7zip/Archive/Rar/RarHandler.h +++ b/CPP/7zip/Archive/Rar/RarHandler.h @@ -41,9 +41,9 @@ struct CInArcInfo bool IsRecovery() const { return (Flags & NHeader::NArchive::kRecovery) != 0; } bool IsEncrypted() const { return (Flags & NHeader::NArchive::kBlockEncryption) != 0; } bool IsFirstVolume() const { return (Flags & NHeader::NArchive::kFirstVolume) != 0; } - bool IsThereEncryptVer() const { return (Flags & NHeader::NArchive::kEncryptVer) != 0; } - bool IsEncryptOld() const { return (!IsThereEncryptVer() || EncryptVersion < 36); } + // bool IsThereEncryptVer() const { return (Flags & NHeader::NArchive::kEncryptVer) != 0; } + // bool IsEncryptOld() const { return (!IsThereEncryptVer() || EncryptVersion < 36); } bool AreMoreVolumes() const { return (EndFlags & NHeader::NArchive::kEndOfArc_Flags_NextVol) != 0; } bool Is_VolNumber_Defined() const { return (EndFlags & NHeader::NArchive::kEndOfArc_Flags_VolNumber) != 0; } diff --git a/CPP/7zip/Archive/Rar/RarHeader.h b/CPP/7zip/Archive/Rar/RarHeader.h index b518338a..30c53ec9 100644 --- a/CPP/7zip/Archive/Rar/RarHeader.h +++ b/CPP/7zip/Archive/Rar/RarHeader.h @@ -41,7 +41,8 @@ namespace NArchive const UInt16 kRecovery = 0x40; const UInt16 kBlockEncryption = 0x80; const UInt16 kFirstVolume = 0x100; // (set only by RAR 3.0 and later) - const UInt16 kEncryptVer = 0x200; // RAR 3.6 there is EncryptVer Byte in End of MainHeader + + // const UInt16 kEncryptVer = 0x200; // RAR 3.6 : that feature was discarded by origial RAR const UInt16 kEndOfArc_Flags_NextVol = 1; const UInt16 kEndOfArc_Flags_DataCRC = 2; |