|
Ran
|
Jobs
1
|
Files
413
|
Run time
4min
|
Badge
README BADGES
|
push
github
Transaction: ensure standard witness scripts are properly verified (#3805) * Transaction: ensure standard witness scripts are properly verified Problem: Invocation scripts of standard witnesses considered to be invalid if not following the `PUSHDATA1 signature` pattern. Consider the following example of transaction witness: Invocation script: `CDkMQMPzMFVACq4PjnjbH8wB5/3ajfp7JaGo9MLyo25OPNTNIeo2WsYWZZ6wjUvGSlzd8FjMMdu4WXHU2KoUMo9Fkkk=` which is: ``` NEO-GO-VM 0 > ops INDEX OPCODE PARAMETER 0 PUSHT << 1 ASSERT 2 PUSHDATA1 c3f33055425a1a8f4cb08d4bc648f459249 ``` Verification script: `DCEDzfbXTXxymUH2d9SQNI8aYHgF4wZ2xi6MTYCqM7cw+dBBVuezJw==` which is: ``` NEO-GO-VM 0 > ops INDEX OPCODE PARAMETER 0 PUSHDATA1 03cdf6d740676c62e8c4d80aa33b730f9d0 << 35 SYSCALL System.Crypto.CheckSig (56e7b327) ``` As you can see, verification script has the form of standard signature contract, and invocation script is just some side VM script that should be properly executed to check transaction's witness. The problem is that VerifyStateIndependent treats this invocation script as invalid and aborts transaction witness verification. Solution: Check if Invocation witness script matches the expected standard SignatureContract or MultiSigContract witness. If not, then do not consider this witness as "standard". Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru> * Transaction: rename IsSingleSignature and IsSingleSignatures No functional changes. Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru> * Transaction: adjust state dependent verification Apply the same rule for standard witness detection as for state independent verification. Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru> * Transaction: use var keyword for variables declaration No functional changes. S... (continued)
6080 of 8826 branches covered (68.89%)
Branch coverage included in aggregate %.
28 of 28 new or added lines in 1 file covered. (100.0%)
4 existing lines in 2 files now uncovered.22199 of 27255 relevant lines covered (81.45%)
127925.58 hits per line
| Lines | Coverage | ∆ | File |
|---|---|---|---|
| 1 |
60.58 |
25.96% | src/Plugins/OracleService/Protocols/OracleHttpsProtocol.cs |
| 3 |
83.68 |
1.55% | src/Plugins/RpcServer/RpcServer.Wallet.cs |
| ID | Job ID | Ran | Files | Coverage | |
|---|---|---|---|---|---|
| 1 | 13694720894.1 | 2676 |
25.16 |
GitHub Action Run |
| Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line | Branch Hits | Branch Misses |
|---|