cdbattags / lua-resty-jwt

JWT For The Great Openresty
Apache License 2.0
146 stars 44 forks source link

version0.2.2 also have size of C type is unknown or too large at line 39 #30

Closed Michael-LiK closed 4 years ago

Michael-LiK commented 4 years ago

i use the sign rs256 meet the problem: ERROR: /usr/local/openresty/lualib/resty/hmac.lua:105: size of C type is unknown or too large at line 39 stack traceback: /usr/local/openresty/lualib/resty/hmac.lua:105: in main chunk [C]: in function 'require' /usr/local/openresty/lualib/resty/jwt.lua:5: in main chunk [C]: in function 'require' jwt.lua:4: in function 'file_gen' init_worker_by_lua:45: in function [C]: in function 'xpcall' init_worker_by_lua:52: in function

cdbattags commented 4 years ago

Do you have a minimal breaking example? Feel free to use the testing suite and put up a PR for the failing test for us to fix.

fffonion commented 4 years ago

Related to https://github.com/jkeys089/lua-resty-hmac/issues/19

Michael-LiK commented 4 years ago

thanks for your help, fffonion sovle my first problem ,the hs265 can use ,but rs256 is also wrong。 the project with wrong is here : https://gitee.com/shmichaelli/jwt_test

cdbattags commented 4 years ago

Why close? Did you solve this? Would you mind giving more context for others that might have similar issues?

Michael-LiK commented 4 years ago

i didn't sovle the problem , i just use the evp.lua to create a signature by myself.

Michael-LiK commented 4 years ago

sorry, i think use the lib with wrong ways, the signature key i use it wrong. ------example---------- Right ex: local key = ''-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w\n-----END PRIVATE KEY-- ---"

Wrong ex: local key = ''-----BEGIN PRIVATE KEY-----MIIEvQIBADANBgkqhkiG9w-----END PRIVATE KEY-- ---" ------example----------

I created the mistakes because i write wrong key , the evp.lua tell can't find start_line, then i find it. And i have a suggest, the lua-resty-jwt error can't tell the wrong reasons, i use hmac.lua and evp.lua by myself find the reasons.