Closed radleylewis closed 5 months ago
This looks good, can you please add one or more tests that validate the 2 types of values being encoded?
Thanks @mirceanis. I have added tests (both for createSetAttributeHash
and createRevokeAttributeHash
) checking for both the hex string attrValue
(e.g. public key) case and also the string
(e.g. service endpoint) case.
Overview When invoking
createSetAttributeHash
the present implementation checks for a hex encoded key or for a utf8 type and will encode theattrValue
accordingly. The behaviour betweencreateSetAttributeHash
andcreateRevokeAttributeHash
should be consistent, however, the case of the former there is no check on theattrValue
type. This results in abad_signature
error in the case where a hex encodedattrValue
is provided.Fix The proposed changes perform the same check on the
attrValue
in thecreateRevokeAttributeHash
as is performed in thecreateSetAttributeHash
making them consistent.