-
Notifications
You must be signed in to change notification settings - Fork 395
Closed
Labels
Description
CHECKSIGFROMSTACKVERIFY calls CheckSignatureEncoding:
elements/src/script/interpreter.cpp
Line 1228 in 1e20db4
| if (!CheckSignatureEncoding(vchSig, flags, serror) || !CheckPubKeyEncoding(vchPubKey, flags, serror)) { |
CheckSignatureEncoding in turns calls IsDefinedHashtypeSignature
elements/src/script/interpreter.cpp
Line 145 in 1e20db4
| if ((flags & SCRIPT_VERIFY_STRICTENC) != 0 && !IsDefinedHashtypeSignature(vchSig)) { |
which is incorrect because signatures for CHECKSIGFROMSTACKVERIFY do not have hashtypes.
One way of fixing this could be to mask out SCRIPT_VERIFY_STRICTENC when calling CheckSignatureEncoding.
A better way would be to give signatures from CHECKSIG and CHECKSIGFROMSTACK different types.
martindale