|
680 | 680 | ["0 0x02 0x0000 0", "CHECKMULTISIGVERIFY 1", "", "OK"], |
681 | 681 |
|
682 | 682 | ["While not really correctly DER encoded, the empty signature is allowed by"], |
683 | | -["STRICTENC to provide a compact way to provide a deliberately invalid signature."], |
| 683 | +["STRICTENC/DERSIG to provide a compact way to provide a deliberately invalid signature."], |
684 | 684 | ["0", "0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 CHECKSIG NOT", "STRICTENC", "OK"], |
| 685 | +["0", "0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 CHECKSIG NOT", "DERSIG", "OK"], |
685 | 686 | ["0 0", "1 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 1 CHECKMULTISIG NOT", "STRICTENC", "OK"], |
| 687 | +["0 0", "1 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 1 CHECKMULTISIG NOT", "DERSIG", "OK"], |
686 | 688 |
|
687 | 689 | ["CHECKMULTISIG evaluation order tests. CHECKMULTISIG evaluates signatures and"], |
688 | 690 | ["pubkeys in a specific order, and will exit early if the number of signatures"], |
689 | | -["left to check is greater than the number of keys left. As STRICTENC fails the"], |
| 691 | +["left to check is greater than the number of keys left. As STRICTENC/DERSIG fails the"], |
690 | 692 | ["script when it reaches an invalidly encoded signature or pubkey, we can use it"], |
691 | 693 | ["to test the exact order in which signatures and pubkeys are evaluated by"], |
692 | 694 | ["distinguishing CHECKMULTISIG returning false on the stack and the script as a"], |
693 | 695 | ["whole failing."], |
694 | | -["See also the corresponding inverted versions of these tests in script_invalid.json"], |
695 | 696 | [ |
696 | 697 | "0 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501", |
697 | 698 | "2 0 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 2 CHECKMULTISIG NOT", |
698 | 699 | "STRICTENC", "OK", |
699 | 700 | "2-of-2 CHECKMULTISIG NOT with the second pubkey invalid, and both signatures validly encoded. Valid pubkey fails, and CHECKMULTISIG exits early, prior to evaluation of second invalid pubkey." |
700 | 701 | ], |
701 | 702 | [ |
702 | | - "0 0 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501", |
| 703 | + "0 1 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501", |
703 | 704 | "2 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 2 CHECKMULTISIG NOT", |
704 | 705 | "STRICTENC", "OK", |
705 | | - "2-of-2 CHECKMULTISIG NOT with both pubkeys valid, but second signature invalid. Valid pubkey fails, and CHECKMULTISIG exits early, prior to evaluation of second invalid signature." |
| 706 | + "2-of-2 CHECKMULTISIG NOT with both pubkeys valid, but second signature invalid. Valid pubkey fails, and CHECKMULTISIG exits early, prior to evaluation of second invalid signature (STRICTENC enabled)." |
| 707 | +], |
| 708 | +[ |
| 709 | + "0 1 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501", |
| 710 | + "2 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 2 CHECKMULTISIG NOT", |
| 711 | + "DERSIG", "OK", |
| 712 | + "2-of-2 CHECKMULTISIG NOT with both pubkeys valid, but second signature invalid. Valid pubkey fails, and CHECKMULTISIG exits early, prior to evaluation of second invalid signature (DERSIG enabled)." |
706 | 713 | ], |
707 | 714 |
|
708 | 715 | ["Increase test coverage for DERSIG"], |
|
1232 | 1239 |
|
1233 | 1240 |
|
1234 | 1241 | ["Order of CHECKMULTISIG evaluation tests, inverted by swapping the order of"], |
1235 | | -["pubkeys/signatures so they fail due to the STRICTENC rules on validly encoded"], |
| 1242 | +["pubkeys/signatures so they fail due to the STRICTENC/DERSIG rules on validly encoded"], |
1236 | 1243 | ["signatures and pubkeys."], |
1237 | 1244 | [ |
1238 | 1245 | "0 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501", |
|
1246 | 1253 | "2 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 2 CHECKMULTISIG NOT", |
1247 | 1254 | "STRICTENC", |
1248 | 1255 | "SIG_DER", |
1249 | | - "2-of-2 CHECKMULTISIG NOT with both pubkeys valid, but first signature invalid." |
| 1256 | + "2-of-2 CHECKMULTISIG NOT with both pubkeys valid, but first signature invalid (STRICTENC enabled)." |
| 1257 | +], |
| 1258 | +[ |
| 1259 | + "0 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501 1", |
| 1260 | + "2 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 2 CHECKMULTISIG NOT", |
| 1261 | + "DERSIG", |
| 1262 | + "SIG_DER", |
| 1263 | + "2-of-2 CHECKMULTISIG NOT with both pubkeys valid, but first signature invalid (DERSIG enabled)." |
1250 | 1264 | ], |
1251 | 1265 | [ |
1252 | 1266 | "0 0x47 0x304402205451ce65ad844dbb978b8bdedf5082e33b43cae8279c30f2c74d9e9ee49a94f802203fe95a7ccf74da7a232ee523ef4a53cb4d14bdd16289680cdb97a63819b8f42f01 0x46 0x304402205451ce65ad844dbb978b8bdedf5082e33b43cae8279c30f2c74d9e9ee49a94f802203fe95a7ccf74da7a232ee523ef4a53cb4d14bdd16289680cdb97a63819b8f42f", |
1253 | 1267 | "2 0x21 0x02a673638cb9587cb68ea08dbef685c6f2d2a751a8b3c6f2a7e9a4999e6e4bfaf5 0x21 0x02a673638cb9587cb68ea08dbef685c6f2d2a751a8b3c6f2a7e9a4999e6e4bfaf5 0x21 0x02a673638cb9587cb68ea08dbef685c6f2d2a751a8b3c6f2a7e9a4999e6e4bfaf5 3 CHECKMULTISIG", |
1254 | 1268 | "P2SH,STRICTENC", |
1255 | 1269 | "SIG_DER", |
1256 | | - "2-of-3 with one valid and one invalid signature due to parse error, nSigs > validSigs" |
| 1270 | + "2-of-3 with one valid and one invalid signature due to parse error, nSigs > validSigs (STRICTENC enabled)." |
| 1271 | +], |
| 1272 | +[ |
| 1273 | + "0 0x47 0x304402205451ce65ad844dbb978b8bdedf5082e33b43cae8279c30f2c74d9e9ee49a94f802203fe95a7ccf74da7a232ee523ef4a53cb4d14bdd16289680cdb97a63819b8f42f01 0x46 0x304402205451ce65ad844dbb978b8bdedf5082e33b43cae8279c30f2c74d9e9ee49a94f802203fe95a7ccf74da7a232ee523ef4a53cb4d14bdd16289680cdb97a63819b8f42f", |
| 1274 | + "2 0x21 0x02a673638cb9587cb68ea08dbef685c6f2d2a751a8b3c6f2a7e9a4999e6e4bfaf5 0x21 0x02a673638cb9587cb68ea08dbef685c6f2d2a751a8b3c6f2a7e9a4999e6e4bfaf5 0x21 0x02a673638cb9587cb68ea08dbef685c6f2d2a751a8b3c6f2a7e9a4999e6e4bfaf5 3 CHECKMULTISIG", |
| 1275 | + "P2SH,DERSIG", |
| 1276 | + "SIG_DER", |
| 1277 | + "2-of-3 with one valid and one invalid signature due to parse error, nSigs > validSigs (DERSIG enabled)." |
1257 | 1278 | ], |
1258 | 1279 |
|
1259 | 1280 | ["Increase DERSIG test coverage"], |
|
0 commit comments