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

RuntimeError (Unsupported digest algorithm (SHA-256).: first num too large) #44

Closed
kowo-zahl opened this issue Jul 3, 2024 · 2 comments

Comments

@kowo-zahl
Copy link

Hi,

on my development server, the gem works fine, but on my production server I got the following error:

RuntimeError (Unsupported digest algorithm (SHA-256).: first num too large)

It seems there is some trouble with the name SHA-256

When I change line

  a.signature = OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new(a.algorithm), Altcha.hmac_key, a.challenge)

to
a.signature = OpenSSL::HMAC.hexdigest(OpenSSL::Digest::SHA256.new, Altcha.hmac_key, a.challenge)

in altcha-rails.rb it works fine.

@ovx
Copy link
Contributor

ovx commented Jul 4, 2024

Hi, the problem is with the name, in JavaScript, the names contain dashes, but in Ruby, you have to use names without dashes (docs) so you'll have normalize the name before creating a digest.

@ovx
Copy link
Contributor

ovx commented Jul 18, 2024

Closing due to inactivity.

@ovx ovx closed this as completed Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants