I'm trying to implement AES-256-GCM in Ruby.
Ruby's OpenSSL wrapper library and aead library both clearly seem to believe that OpenSSL itself supports this.
However, neither 0.9.8r (which I had installed) nor 1.0.1c (which I updated to w/ macports) seems to have it. 1.0.1c has AES256-GCM-SHA384, but Ruby OpenSSL and aead don't seem to know what to make of it.
Any suggestions?
xpost: https://stackoverflow.com/questions/14698473/why-does-openssl-not-include-aes-256-gcm
ETA: It turns out that this problem is caused by RVM having been built against OpenSSL 0.9.8. (FWIW, this seems to be the case on Ubuntu 10.04, but fixed in 12.04.)
It's easy to test:
require 'openssl'
cipher = OpenSSL::Cipher.new('aes-256-gcm')
# Bad response: RuntimeError: unsupported cipher algorithm (aes-256-gcm)
# Good response: #<OpenSSL::Cipher:0x007fc0754764a8>
It's semi easy fix w/ rvm, but it takes a while to fully recompile:
sudo apt-get install aclocal autoconf automake auroreconf apple-gcc42 libtool pkg-config openssl readline libyaml sqlite libxml2 libxslt libksba
# some but not all are available on macports; seems to work okay without the missing ones
rvm get head
rvm pkg install openssl
rvm reinstall 1.9.3-p194
Thanks to Stephen Touset for hinting at the fix.