Closed heyvito closed 3 months ago
This feels really familiar, but I can't seem to find whatever issue it was that is triggering my memory. :sob:
This is definitely weird, however, I can't seem to actually reproduce? :sweat_smile:
require 'openssl'
key = "key"
data = "message-to-be-authenticated"
mac = OpenSSL::HMAC.hexdigest("SHA256", key, data)
$ docker run -it --rm --pull=always --platform linux/amd64 ruby:3
3: Pulling from library/ruby
Digest: sha256:d4233f4242ea25346f157709bb8417c615e7478468e2699c8e86a4e1f0156de8
Status: Image is up to date for ruby:3
irb(main):001> require 'openssl'
irb(main):002> key = "key"
irb(main):003> data = "message-to-be-authenticated"
irb(main):004> mac = OpenSSL::HMAC.hexdigest("SHA256", key, data)
=> "cddb0db23f469c8bf072b21fd837149bd6ace9ab771cceef14c9e517cc93282e"
$ docker run -it --rm --pull=always --platform linux/arm64/v8 ruby:3
3: Pulling from library/ruby
Digest: sha256:d4233f4242ea25346f157709bb8417c615e7478468e2699c8e86a4e1f0156de8
Status: Image is up to date for ruby:3
irb(main):001> require 'openssl'
irb(main):002> key = "key"
irb(main):003> data = "message-to-be-authenticated"
irb(main):004> mac = OpenSSL::HMAC.hexdigest("SHA256", key, data)
=> "cddb0db23f469c8bf072b21fd837149bd6ace9ab771cceef14c9e517cc93282e"
Okay, it seems I can't reproduce it either, but it also downloaded a newer image, so I'm not really sure what happened now. 😓
I'll close this one! Sorry for the spurious issue, and thank you for replying! 💛
λ | docker run -it --rm --pull=always ruby:3
3: Pulling from library/ruby
Digest: sha256:d4233f4242ea25346f157709bb8417c615e7478468e2699c8e86a4e1f0156de8
Status: Downloaded newer image for ruby:3
irb(main):001> require 'openssl'
=> true
irb(main):002> key = "key"
=> "key"
irb(main):003> data = "message-to-be-authenticated"
=> "message-to-be-authenticated"
irb(main):004> mac = OpenSSL::HMAC.hexdigest("SHA256", key, data)
=> "cddb0db23f469c8bf072b21fd837149bd6ace9ab771cceef14c9e517cc93282e"
irb(main):005>
λ | docker run -it --rm --pull=always --platform linux/amd64 ruby:3
3: Pulling from library/ruby
Digest: sha256:d4233f4242ea25346f157709bb8417c615e7478468e2699c8e86a4e1f0156de8
Status: Downloaded newer image for ruby:3
irb(main):001> require 'openssl'
=> true
irb(main):002> key = "key"
=> "key"
irb(main):003> data = "message-to-be-authenticated"
=> "message-to-be-authenticated"
irb(main):004> mac = OpenSSL::HMAC.hexdigest("SHA256", key, data)
=> "cddb0db23f469c8bf072b21fd837149bd6ace9ab771cceef14c9e517cc93282e"
Hi there, folks! I just stumbled across a weird scenario with OpenSSL.
Running a container on macOS M2 Max under the host's architecture (
linux/arm64
), OpenSSL fails with their own examples:Under
linux/arm64
:Under
linux/amd64
:Is this expected? Did I miss something?
Appreciate any kind of help or direction!