You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a test, I changed the WriteSignaturemethod in AbiSerilizationProvider.cs as follows (CryptoHelper.SIGN_KEY_DATA_SIZE + 1) and that seems to fix the issue ... but will probably break for other stuff (r1 ?)
private static void WriteSignature(MemoryStream ms, object value)
{
var s = (string)value;
var signBytes = CryptoHelper.SignStringToBytes(s);
if (s.StartsWith("SIG_K1_"))
WriteByte(ms, KeyType.k1);
else if (s.StartsWith("SIG_R1_"))
WriteByte(ms, KeyType.r1);
ms.Write(signBytes, 0, CryptoHelper.SIGN_KEY_DATA_SIZE + 1);
}
Packed data for above
1f9dcb5e92bf8736e53c0000000001000000000000aef900267519192fa54e01000000000000aef90000b86ae1696ede41001f22a5ee328c54421bddb73110f6ddce3258e214c611aac33a1532affb3adcc2bd3f3276e5223189fa58cdd0a9cb054d1360e26d2a24047e6628392a68d9dd9900
Transcoding the signature to hex
1f22a5ee328c54421bddb73110f6ddce3258e214c611aac33a1532affb3adcc2bd3f3276e5223189fa58cdd0a9cb054d1360e26d2a24047e6628392a68d9dd9920
The last byte is 0x00, should be 0x20
Confirm using commandline (cleos)
{
"expiration": "2020-05-25T10:13:38",
"ref_block_num": 47374,
"ref_block_prefix": 2492603937,
"max_net_usage_words": 0,
"max_cpu_usage_ms": 0,
"delay_sec": 0,
"context_free_actions": [],
"actions": [{
"account": "zar",
"name": "dummyaction",
"authorization": [{
"actor": "mycontract",
"permission": "active"
}
],
"data": "001f22a5ee328c54421bddb73110f6ddce3258e214c611aac33a1532affb3adcc2bd3f3276e5223189fa58cdd0a9cb054d1360e26d2a24047e6628392a68d9dd9920"
}
],
"transaction_extensions": [],
"signatures": [],
"context_free_data": []
}
It appears that packing of the transaction is dropping the last byte of the signature?
I use the following method for signing a hash of data (the resulting sig seems to be valid):
The text was updated successfully, but these errors were encountered: