jkeys089 / lua-resty-hmac

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

error : attempt to redefine 'env_md_ctx_st' #13

Closed vinayakhulawale closed 5 years ago

vinayakhulawale commented 5 years ago

Is there any reason for redefining env_md_ctx_st @ https://github.com/jkeys089/lua-resty-hmac/blob/master/lib/resty/hmac.lua#L25

I am getting below error when loading lua-resty-jwt module (installed using luarocks) :

nginx: [error] init_by_lua error: /<custom-prefix>/luajit/share/lua/5.1/resty/hmac.lua:82: attempt to redefine 'env_md_ctx_st' at line 7
stack traceback:
    [C]: in function 'cdef'
    /<custom-prefix>/luajit/share/lua/5.1/resty/hmac.lua:82: in main chunk
    [C]: in function 'require'
    /<custom-prefix>/luajit/share/lua/5.1/resty/jwt.lua:5: in main chunk
    [C]: in function 'require'

If I remove both struct declaration then I don't get above error.

If you are fine, I can submit PR to remove these declaration.

jkeys089 commented 5 years ago

@vinayakhulawale this was just a copy / paste from OpenSSL header files. Strange that no one else has ever run into this issue before. Can you tell me what version of OpenResty you're using so I can try to recreate the issue?

vinayakhulawale commented 5 years ago

@jkeys089 - I am using 1.15.8.1RC1 but upon further debugging I found that I am loading these definitions twice, so that's my issue. I will close this issue. thanks for replying !