Fix crypto.hmac behavior with empty keys.
node 0.9.6 introduced Buffer changes that cause the key argument of Hmac::HmacInit (used in crypto.createHmac) to be NULL when the key is empty. This argument is passed to OpenSSL's HMAC_Init, which does not like NULL keys. This change works around the issue by passing an empty string to HMAC_Init when the key is empty, and adds crypto.createHmac tests for the edge cases of empty keys and values.
parent
02374d0c
Please register or sign in to comment