-
Notifications
You must be signed in to change notification settings - Fork 563
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
Is encrypted by msoffcrypto #436
Is encrypted by msoffcrypto #436
Conversation
This is an interesting one since "our" old implementation of is_encrypted claims that the embedded file is still encrypted (which it is not), but the msoffcrypto-is_encrypted gets it right.
Running each of the new tests works, but running them together results in fails. Investigating... |
There were cases where our own test of byte 0x15 of SummaryInformation stream was incorrect. So leave test to the professionals ;-)
dd0ef5f
to
fc0049d
Compare
Running main() within same interpreter capturing SystemExit and sys.stdout/err always causes trouble (at least in unittest). Fork another python process and capture from there, that is easier and cleaner in my view.
fc0049d
to
0bc6728
Compare
So, finally working. I keep making the mistake to try and capture the output of unittests by temporarily replacing sys.stdout with StringIO. Always seems like a nice idea but never works reliably (at least not in unittest) |
Argh! Still failing for pypy, will have to investigate on thursday. |
Closing this for now, need to push a few more times to find problem with pypy |
Found the problem: pypy issued a warning about ssl that did not appear in CPython. Have travis now also included in my fork, so I should be able to determine beforehand whether PRs will fail. |
Encountered a sample for which msoffcrypto correctly detects encryption but "our" code does not (see first commit). Instead of fixing our code, duplicating stuff that works in msoffcrypto, use the msoffcrypto code to check for encryption. Keep our old implementation as backup (in case msoffcrypto fails or is not available).
Also added a try-catch around is_encrypted testing solving issue #427 . Add test code so this will not happen again.
And update some testcode to get rid of oleid-warnings.