agentzh/set-misc-nginx-module — Issue #7: HMAC Algorithm
Author: eklinger
Created: 2011-10-11 00:57:53+00:00
State: open

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;

from log:
secret=yzY3mIMZfyO03ec_country_allow=US, string_to_sign=ec_country_allow=US

With secret = v+1

secret=ec_country_allow=US, string_to_sign=(null)

Any ideas? Thank you