added token date checks & signature is now forced to lowercase hex before validation.#9
added token date checks & signature is now forced to lowercase hex before validation.#9mhassman wants to merge 2 commits intoOlivine-Labs:masterfrom
Conversation
- signature is now forced to lowercase hex before validation.
|
Would you mind adding some tests that describe the behavior and fail with the old code and then pass with the new? |
- added check - if json decode fails, do not continue and propagate error to caller.
|
Hi Robert, Apologies on delayed response - crazy week. I'm happy to help, but not quite understanding what you're asking. Are you fyi.. i committed a minor change that permits errors in json decode to flow Thnx! -Mark From: Robert Andrew Ditthardt [mailto:notifications@github.com] Would you mind adding some tests that describe the behavior and fail with You are receiving this because you authored the thread. |
|
Specifically I'm asking for tests to be written in the spec folder so that running busted confirms that this code works. There are existing tests over all of the functionality in this library. |
|
This PR add nginx as dependency. |
|
I have idea to add |
For some reason, i couldn't get token verification to work as-is..
signature = basexx.from_url64(str:sub(dotSecond+1)) was returning binary, but
['HS256'] = function(data, signature, key) return signature == tohex(hmac.new (key, 'sha256'):final (data)) end, was returning lowercase hex.
So, forced extracted message signature to lowercase hex.
Also, added token date (nbf, and exp) checks if they are defined within the token.
Hope this helps..