1

I can run a command like the following in my script on linux:

openssl dgst -sha256 \
             -mac HMAC \
             -macopt hexkey:xxxx

But this command fails on mac os with the error

unknown option '-mac'

I've tried sifting through man pages and online but I can't find any way to accomplish similar task using mac's version of openssl?

jpaugh
  • 1,378
  • 10
  • 20
user868543
  • 13
  • 2

1 Answers1

1

What version of macOS is this? Older releases (10.11) have an old openssl that fails

$ /usr/bin/openssl version
OpenSSL 0.9.8zh 14 Jan 2016
$ /usr/bin/openssl dgst -sha256 -mac HMAC -macopt hexkey:DEADBEEF
unknown option '-mac'
...

while newer (10.13) instead have LibreSSL that does not error out for your command. On older macs you could perhaps install openssl via a ports system (Fink, Homebrew, MacPorts).

thrig
  • 786
  • 4
  • 7
  • Thank you - this was actually the problem. I had installed a newer version on mac os 10.11.6 but it didn't update it – user868543 Feb 02 '18 at 02:43
  • 1
    Let me correct my comment, the newer installed version wasn't updated at the default mac installed location. I ended up having to link to the openssl in a different folder (brew installation), unfortunately mac os doesn't allow updating the symlinks and/or renaming the system installed version with a newer one. – user868543 Feb 03 '18 at 00:25