-
Notifications
You must be signed in to change notification settings - Fork 163
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
lib/openssl/hmac.rb:55:in `initialize': EVP_PKEY_new_mac_key: malloc failure (OpenSSL::HMACError) with -Werror flag #628
Comments
I will check if this issue happens with Ruby 3.0. |
This is a known issue in OpenSSL 3.0 when the HMAC key is empty: openssl/openssl#13089 However, this code is supposed to be unreachable with OpenSSL >= 3.0 (#538). |
CC: @cwjenkins Thank you for providing the info! I checked the CI results, and the "ubuntu-22.04 (ruby) 3.1" case fails and "ubuntu-22.04 (ruby) 3.0" passes. So, I assumed that this is a Ruby version specific issue. Because it seemed that it was executed in the same environment. But it was a wrong assumption. I checked the used OpenSSL versions now. And I found the difference of used OpenSSL versions.
|
I reproduced it with
The checking program used by |
I see. The error happened in the |
Already! Haha #633 |
All right. Thanks. :) |
This is probably because the checking program was not producing a warning on Ruby 3.0. A change in Ruby 3.1 (ruby/ruby@cb5a41c) replaced the However, I think it will likely happen again that a new warning starts to appear in the checking program (e.g., by OpenSSL converting a function to a macro), I think the safest workaround is to not apply |
Sorry, I don't understand what the change in Ruby 3.1 (ruby/ruby@cb5a41c) is related to about the CI results I provided above. In the "ubuntu-22.04 (ruby) 3.1" case, the And in the "ubuntu-22.04 (ruby) 3.1" case, the |
Sorry for the misleading quotation. I missed the fact the "ubuntu-22.04 (ruby) 3.0" uses OpenSSL 1.1.1. The "openssl-3.0.8" configuration uses Ruby 3.0 OpenSSL 3.0 This is an issue when all of these are met: Ruby >= 3.1, OpenSSL >= 3.0, and |
All right. That makes sense. 👍🏼 |
On the current master branch 22e601a, I got an error. I found this error on the Ubuntu 22.04 Ruby head, 3.2 and 3.1 cases on GitHub Actions. But the error didn't happen on Ubuntu 22.04 Ruby 3.0 and 2.7 cases. The CI result on my fork repository is here, and 7 pending tests too. The 7 pending test didn't happen in Ubuntu 22.04 Ruby 3.0 case.
This error didn't happen without the
-Werror
. So, I assume that one of the warning flags cause this error.Debug
I debugged with debug flags with GDB.
The
EVP_PKEY_new_mac_key
returnsNULL
in the
ossl_hmac_initialize
inext/openssl/ossl_hmac.c:107
.The text was updated successfully, but these errors were encountered: