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

The Hmac SHA512 libgcrypt authenticate call breaks libgcrypt state at the gcry_mac_read function #100

Closed
IbraheemYSaleh opened this issue Apr 7, 2022 · 3 comments · Fixed by #112
Assignees
Labels
bug Something isn't working

Comments

@IbraheemYSaleh
Copy link
Contributor

The Hmac SHA512 libgcrypt authenticate call breaks libgcrypt state at the gcry_mac_read function... I don't know why.

I've commented out the tests as part of my https://github.jpl.nasa.gov/ASEC/AMMOS-CryptoLib/issues/52 implementation (they were silently broken before due to another bug that is fixed with that PR).

See the relevant code here:
https://github.com/nasa/CryptoLib/pull/99/files#diff-8455637f5a51288fb98808edae34ef7ba4faf362e80d728810678ec2701f1399R655

https://github.com/nasa/CryptoLib/pull/99/files#diff-8455637f5a51288fb98808edae34ef7ba4faf362e80d728810678ec2701f1399R769

Commented out all HMAC SHA 512 tests:
https://github.com/nasa/CryptoLib/pull/99/files#diff-8e1101bbd09e2bc44055d6ad4f916e9c4f37dc4d22df1c4ab979a112508c11edR2289

@IbraheemYSaleh
Copy link
Contributor Author

Note: This issue becomes apparent when running any decrypt tests after an HMAC SHA 512 Encrypt test has been run.

@dccutrig
Copy link
Contributor

Tests NIST_DEC_HMAC_VALIDATION.SHA_512_PT_128_TEST_0 & NIST_DEC_HMAC_VALIDATION.SHA_512_PT_128_TEST_1 are failing when the entire test suite is ran (et_dt_validation). Appears specifically to occur after either encryption test SHA_512_PT_128_TEST_2 or SHA_512_PT_128_TEST_3 are ran... note that these tests run fine individually.

@dccutrig
Copy link
Contributor

This is atleast partially related to test setup - researching which key lengths SHA512 should support and how it should do so. Found some configurations in the test related to key length which caused the other tests to fail as the SADB is not reset between between test runs.

@dccutrig dccutrig linked a pull request Apr 26, 2022 that will close this issue
@dccutrig dccutrig removed a link to a pull request Apr 27, 2022
@dccutrig dccutrig linked a pull request Apr 27, 2022 that will close this issue
@dccutrig dccutrig removed a link to a pull request May 4, 2022
@dccutrig dccutrig linked a pull request May 4, 2022 that will close this issue
@dccutrig dccutrig closed this as completed May 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants