In the HMAC algorithm code, there is a line:
secret = v + 1
When I enable debug and print the value of secret and string_to_sign variables, secret is really string_to_sign and string_to_sign is null. It seems that v is a pointer to the last variable in the conf for that directive. However, when I change secret = v -1, the data for secret ends up being the value of secret + the value of string_to_sign concated together.
With secret = v-1
set $secret 'yzY3mIMZfyO03';
set $string_to_sign 'ec_country_allow=US';
set_hmac_sha1 $tok $secret $string_to_sign;
With secret = v+1
Any ideas? Thank you
Sorry, with secret = v+1,
With the original way, secret = v and string_to_sign = v+1:
Could you give me more information? Please show me the output of the following commands in your system:
fixed ddebug code in hmac.c. thanks eklinger for reporting it as gith…
…ub issue #7.
I cannot reproduce your issue in linux x86_64 and linux i386 with the latest ngx_set_misc git master HEAD. Please try out the latest ngx_set_misc module (not your patched ones), if you cannot reproduce any issues, then it must be a problem in your own code and I'd close this ticket.
Yes :) Nginx strings are not C strings so it's important to use %.*s instead of %s and specify a length for the string being printed :)