Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

verify RAR crc on header and file data #220

Merged
merged 1 commit into from
Apr 7, 2017

Conversation

coderb
Copy link
Contributor

@coderb coderb commented Apr 4, 2017

verify rar file crc checksums:

  • header records
  • decompressed file payload

tested and works with:

  • typical rar files
  • rar files with encrypted headers
  • multipart rar files

@coderb
Copy link
Contributor Author

coderb commented Apr 4, 2017

Hi Adam,

I haven't used cake at all and am still on VS 2015. Can you help me figure out which test file is failing on the AppVeyor build? I looks like something fails and causes a cascade of errors.

Thanks,
Brien

@adamhathcock
Copy link
Owner

If you look at the AppVeyor output, it will show the failing unit test names: https://ci.appveyor.com/project/adamhathcock/sharpcompress/build/0.15.120

I haven't converted this to VS2017 csproj from VS2015 project JSON so you should be fine. I think the xunit tests should still work with VS2015.

You can run the tests just by running the powershell script .\build.ps1

@coderb
Copy link
Contributor Author

coderb commented Apr 4, 2017

sorry to seem clueless, but i've only ever used *.csproj files and my vs2015 won't load the test project which is xproj/json.

@adamhathcock
Copy link
Owner

Download the VS2015 tooling from here: https://www.microsoft.com/net/download/core

@coderb
Copy link
Contributor Author

coderb commented Apr 4, 2017

i found the issue which turned up a (minor?) bug in the existing code.
The bug is that RarCryptoBinaryReader buffers bytes from the underlying stream and the CurrentReadByteCount is being updated to match the buffered consumption rather than the end use.

I will repush a commit when i get the code cleaned up. My fix requires CurrentReadByteCount and Mark to become virtual. Are you ok with that or would you like to attempt to refactor differently?

@coderb
Copy link
Contributor Author

coderb commented Apr 4, 2017

ok, i confirmed the existing bug. without the CurrentReadByteCount fix the extended time may not be read in FileHeader.ReadFromReader() which also borks the crc.

@coderb
Copy link
Contributor Author

coderb commented Apr 4, 2017

hurray, appveyor is happy! adam- i'm done for now. please review and supply feedback if there are any changes you want made prior to merging. cheers, b!

(btw, i use this library heavily and am very appreciative of it's existence! thanks for the hard work!)

@adamhathcock adamhathcock merged commit 58b4fe4 into adamhathcock:master Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants