« Previous | Next » 

Revision e235bce2

IDe235bce2ba399ac93f0ef86a33f25cc19b08af14
Parent 02374d0c
Child c34326b2

Added by Victor Costan over 11 years ago

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.

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences