|
Post by ZipZap on Jan 25, 2008 22:00:36 GMT -5
Kevin,
The patch works fine if the compression method is Deflate, but what if the file is Stored? Shouldn't the correct method be to change file_info.compression_method to the compression method stored in the AES_Extra field when file_info.compression_method is 99? Just assuming that the AES compression method is Deflate is going to cause problems later.
John
|
|
|
Post by Kevin on Jan 25, 2008 23:10:06 GMT -5
Yep, I think you are absolutely correct. Good catch. I'll take a look and it looks like another build will have to go out this weekend.
Thanks again.
Kevin
|
|
|
Post by ZipZap on Jan 26, 2008 0:12:52 GMT -5
Kevin,
Here is a patch that works.
kpZipObj.pas add published function:
function TZipHeaderInfo.GetAESCompression:word; begin if (FAES_Extra <> nil) and (Fcompression_method = 99) then Result := FAES_Extra^.compression_method else Result := Fcompression_method; end;
kpUnZipp.pas
in Do_Unzip:
add var CompressionLevel : word;
before:
If (file_info.Encrypted) then if (file_info.EncryptionStrength = esPKStandard) then begin NewPassword := Password; While NewPassword = Password do
add: CompressionLevel := file_info.compression_method;
change { TODO : Add capability to skip this check and rely on checking after unzipping } begin NewPassword := Password; While NewPassword = Password do
to { TODO : Add capability to skip this check and rely on checking after unzipping } begin NewPassword := Password; CompressionLevel := file_info.GetAESCompression; While NewPassword = Password do
change: Case file_info.compression_method of STORED: UnStore; to: Case Compressionlevel of STORED: UnStore;
While I've got you... TVCLZip.TemporaryPath doesn't check for a '\' at the end of the path and it should since the code that uses it assumes there is a '\' at the end of the path.
|
|
|
Post by Kevin on Jan 26, 2008 21:33:35 GMT -5
Build 3 has been uploaded. The CheckArchive problem is fixed as well as assuring that there is a '/' at the end of the TempPath property.
Thanks ZipZap!
Kevin
|
|