gisle/digest-hmac — pull request #2 by omega (2012-09-06 05:04:06+00:00)
Title: Digest::HMAC fails if handed a PVNV that has an iOK

If I send a key to Digest::HMAC_SHA1->new() that looks like this (with Data::Peek DDump), it spits a warning, and the key returned is not the same as if the key passed has the same string value, but lacks the IV and NV values, and pIOK and pNOK flags)

SV = PVNV(0x100a73800) at 0x100203470
REFCNT = 1
FLAGS = (POK,pIOK,pNOK,pPOK)
IV = 0
NV = 0
PV = 0x1002023a0 "secret"\0
CUR = 6
LEN = 16

There are two commits, the first one adds a failing test, using `Data::Dump::dump` to make the scalar into the broken one.

The second commit is a lousy attempt at a fix, just forcing it to be a string only again.