unnecessary data conversion in in dojox/encoding/digests/SHA256,SHA512
At the beginning of the SHAx._hmac
method, both the input data and key are transformed using sha32.stringToUtf8
. This transformation should not generally be necessary, and it prevents successive calls of _hmac
on binary data from giving the expected results. For example:
SHA256._hmac('', SHA256._hmac('', '', sha32.outputTypes.String),
sha32.outputTypes.Hex)
should give the digest 73162f0c7b25791ff61bc44ef76d89f0d3d5b6c84e289d23f9eb90fc70f4121f. Assuming the fix from #17733 is applied, you get 5f86813f775de3bf75b86e29fc01a60ad82f39a3a4ccfc6d88974179f195c9cd. If the stringToUtf8
conversions are removed, you get the expected answer.
Change History (6)
Component: |
General →
Dojox
|
Owner: |
set to Adam Peller
|
Resolution: |
→ fixed
|
Status: |
new →
closed
|
Resolution: |
→ fixed
|
Status: |
new →
closed
|
https://github.com/dojo/dojox/pull/132