-
Notifications
You must be signed in to change notification settings - Fork 170
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
FIPS: DH: OpenSSL::PKey.generate_parameters returning a value with block of break. #692
Comments
Though I am not sure if it is related to this issue, I found a kind of bug for the |
I think this is a spec.
|
Thank you for telling me the info. I was still not able to understand it. Checking the difference of the behavior between non-FIPS and FIPS. openssl/ext/openssl/ossl_pkey.c Lines 357 to 358 in c9b48f9
In the code above, the line 357, In the FIPS case, the following
In the non-FIPS case, the following function
I still don't understand why the document you mentioned is related to the difference of the return value of the |
By the way, the generated key in the following command, is always same content in my environment. The issue is managed on openssl/openssl#22620 . I am not sure if this is a spec or a bug.
|
The block passed to Normally, this callback But OpenSSL apparently doesn't generate new prime numbers in the FIPS mode, so the callback is never called, and EVP_PKEY_paramgen() succeeds. This is shown below:
This is ffdhe2048 from RFC 7919, so not generated by OpenSSL. (We happen to have a copy of this exact PEM encoding in #674). I haven't checked the relevant documentations for FIPS 140 and don't know why OpenSSL doesn't/can't generate new group parameters in the FIPS mode, but it seems intentional. |
Okay. That meant "Randomly generated safe primes are not allowed by FIPS" in the
Oh, thank you for explaining it! Now I was able to understand in a better way. I can see the following hexadecimal representation of p is used to output the RFC 7919 - ffdhe2048 - "The hexadecimal representation of p"
OK. Now I can close this ticket as it looks intentional. Thank you for your explanation! |
I debugged this now in OpenSSL code (openssl/openssl@1aa0864) In the following code block, the first FIPS
Non-FIPSThe
|
For the following assertion in FIPS case, I am seeing an interesting difference of the behavior between non-FIPS and FIPS.
openssl/test/openssl/test_pkey_dh.rb
Line 22 in c9b48f9
My environment
My environment is below. Fedora 38, with relatively latest ruby master branch and OpenSSL master branch.
I compiled like this.
The issue summary
Then here is the difference. The
OpenSSL::PKey::DH.new(2048) { break }
is expected to returnnil
. However, in FIPS, it returns a value. TheOpenSSL::PKey::DH.new
callsOpenSSL::PKey.generate_parameters
in it. I am still debugging. But I appreciate if you can let me know this is an expected behavior or a kind of bug.In Non-FIPS
In FIPS
The text was updated successfully, but these errors were encountered: