jkeys089 / lua-resty-hmac

HMAC functions for ngx_lua and LuaJIT
160 stars 99 forks source link

add API shims to accomodate HMAC_Update and HMAC_Final on different plat... #1

Closed neomantra closed 9 years ago

neomantra commented 9 years ago

lua-resty-hmac fails almost all tests on OSX. This patch fixes that. Now it only fails 2 out of 54 (test 8, perhaps because of the weird characters in it?). This also takes lua-resty-jwt from failing almost all its tests to passing all 96.

jkeys089 commented 9 years ago

I think the failed tests you are seeing on OSX are actually caused by an older version of OpenSSL which doesn't return a value for several functions (see HMAC history). This is why OpenSSL 1.0.0+ is listed as a prerequisite for lua-resty-hmac.

I actually develop on OSX as well and I just built OpenResty against a modern version of OpenSSL installed via brew: ./configure --with-luajit --with-cc-opt="-I/usr/local/Cellar/pcre/8.34/include -I/usr/local/Cellar/openssl/1.0.1g/include/" --with-ld-opt="-L/usr/local/Cellar/pcre/8.34/lib -L/usr/local/Cellar/openssl/1.0.1g/lib"

neomantra commented 9 years ago

Ah, that makes sense; I like having the error codes. I build OpenResty on homebrew and have other build flags (pcre), so I'll do the same there.