-
Notifications
You must be signed in to change notification settings - Fork 20
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
KDF108-KMAC generating incorrect vectors #274
Comments
Attaching tarball with 3 files -- request, response, and expected -- that contain all 4 test cases. First test case (KMAC-128) is the test case presented in the initial issue post. |
Hi @RandallSteck, I'll look into this for you, thanks. |
Thank you for the information. This is very peculiar because KMAC-KDF is just a function that passes the inputs to KMAC. We've had no issues reported on KMAC. I re-ran the test cases you mentioned directly through our KMAC-KDF operation and got results that matched yours. So why did the server get a different answer? That makes this interesting. |
Unfortunately since vsID 1672706 has expired we no longer have the internal files to take a look. Would you be able to re-run this or send us an active vsID where this issue occurs? |
I am OoO until Wednesday, but I can do this on my return. I will produce new vectors sets until I generate a failure and report the those IDs here.
Thank you for looking into this.
Randy Steck
…Sent from my iPhone
On Jul 10, 2023, at 1:59 PM, Chris Celi ***@***.***> wrote:
Unfortunately since vsID 1672706 has expired we no longer have the internal files to take a look. Would you be able to re-run this or send us an active vsID where this issue occurs?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.
|
I've generated new failed values. The byte strings are the values calculated by OpenSSL and confirmed with BC. SessionID / vsID / tcID: Calculated value 422039 / 1724729 / 67: 422025 / 1724745 / 91: |
Hi @RandallSteck. I think we've got a fix for this. The issue is, this isn't something we can reproduce internally. We verified that our crypto implementation is correct, and so these sporadic inconsistencies is really curious. My guess is that this has to do with our cluster that we use to fulfill crypto requests. There is a very small chance that repeated KMAC-KDF requests could trigger one of the KMAC instances to access the same state before finishing a previous request for KMAC-KDF specifically. This would certainly lead to an incorrect value to be generated. This had no bearing on KMAC individually because that was set up to correctly handle the state between requests. Only KMAC-KDF was set up to not handle the state consistently. With how the cluster is set up, it would only be a small chance that the state from a previous request would affect another. This would explain the sporadic nature of the wrong values. We have a fix going through our pipeline we plan on releasing to Demo soon. It would be great if you could make as many requests to KMAC-KDF as possible to ensure this is fixed. Due to some differences in the clustering set up between developer environments and the deployed environments, I'm not sure if this is something we could reproduce locally to test fully ourselves. The fix is my attempt at saving us a weeks worth of work just trying to duplicate the issue. |
Hi @RandallSteck, fyi that the fix Chris mentioned above has been deployed to Demo. |
I will hit it as hard as I can today (Fri 7/14). I only have one set of creds, so with TOTP, I can probably run a max of 2 concurrent sessions requesting and running vectors. I’ll post my results around EOD with session/vs IDs if I detect any that contain failed vectors.
Thanks!
Randy
… On Jul 13, 2023, at 3:59 PM, livebe01 ***@***.***> wrote:
Hi @RandallSteck, fyi that the fix Chris mentioned above has been deployed to Demo.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.
|
FYI you can put any number of the same algorithm in a single registration. You could register for 1000 KDF-KMACs in the same test session. Please don't go to that extreme, but this may help with TOTP issues. |
TIL. With this knowledge... This evening I generated more than 500 vector sets between 7:45-8:05pm ET. All sets passed. Things look good from my end, but I'll let your internal process judge whether the issue is closed. Thanks for addressing this issue so quickly! Randy Steck |
Thanks for confirming for us. It's a big help. |
The fix for this issue is on Demo in release v1.1.0.30. |
The fix for this is on Prod in release v1.1.0.30 |
environment
Only run on Demo thus far
testSessionId
Several, including 409483
vsId
Several, including 1672706 (from session 409483)
Algorithm registration
Edit: Add 'code' markdown for formatting
Endpoint in which the error is experienced
N/A
Expected behavior
Different 'expected' values; different pass/fail results
Additional context
I believe I have detected that the ACVP-Server is generating incorrect 'expected' values on a small number of KDF108-KMAC test vectors.
I am adding KDF108-KMAC support to libacvp with OpenSSL 3.1.1. For about 70% of vectors sets, I get fully passing results. For the remaining 30%, I get one single failing result from ~1000 test cases. Over the course of several runs, I was able to accumulate 4 failing test cases and their expected results. I have today confirmed that Bouncy Castle (v1.75, latest) also generates "incorrect" derived keys that exactly match those produced by OpenSSL for all 4 test cases.
I have provided one example of a failed vector below, which I believe is from the session/vsId 409843/1672706 referenced above. I can provide 3 additional vectors. but not their corresponding vsIds. I can also generated new vsId on new session until I encounter more failures.
ACVP Expected:
"9FBAD534ECF14A21276E67A9899A"
Library results:
"C18975F7433E18588BAC69C0F2A0"
The text was updated successfully, but these errors were encountered: