Commit 68f88bc
committed
Merge bitcoin/bitcoin#26186: rpc: Sanitize label name in various RPCs with tests
65e78bd test: Invalid label name coverage (Aurèle Oulès)
552b51e refactor: Add sanity checks in LabelFromValue (Aurèle Oulès)
67e7ba8 rpc: Sanitize label name in various RPCs (Aurèle Oulès)
Pull request description:
The following RPCs did not sanitize the optional label name:
- importprivkey
- importaddress
- importpubkey
- importmulti
- importdescriptors
- listsinceblock
Thus is was possible to import an address with a label `*` which should not be possible.
The wildcard label is used for backwards compatibility in the `listtransactions` rpc.
I added test coverage for these RPCs.
ACKs for top commit:
ajtowns:
ACK 65e78bd
achow101:
ACK 65e78bd
furszy:
diff ACK 65e78bd
stickies-v:
re-ACK 65e78bd
theStack:
re-ACK 65e78bd
Tree-SHA512: ad99f2824d4cfae352166b76da4ca0069b7c2eccf81aaa0654be25bbb3c6e5d6b005d93960f3f4154155f80e12be2d0cebd5529922ae3d2a36ee4eed82440b31File tree
5 files changed
+56
-24
lines changed- src/wallet/rpc
- test/functional
5 files changed
+56
-24
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | | - | |
48 | | - | |
| 46 | + | |
49 | 47 | | |
50 | 48 | | |
51 | 49 | | |
| |||
140 | 138 | | |
141 | 139 | | |
142 | 140 | | |
143 | | - | |
| 141 | + | |
144 | 142 | | |
145 | 143 | | |
146 | 144 | | |
| |||
258 | 256 | | |
259 | 257 | | |
260 | 258 | | |
261 | | - | |
262 | | - | |
263 | | - | |
| 259 | + | |
264 | 260 | | |
265 | 261 | | |
266 | 262 | | |
| |||
662 | 658 | | |
663 | 659 | | |
664 | 660 | | |
665 | | - | |
| 661 | + | |
666 | 662 | | |
667 | 663 | | |
668 | 664 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
160 | | - | |
161 | | - | |
| 159 | + | |
162 | 160 | | |
163 | 161 | | |
164 | 162 | | |
| |||
249 | 247 | | |
250 | 248 | | |
251 | 249 | | |
252 | | - | |
253 | | - | |
254 | | - | |
| 250 | + | |
255 | 251 | | |
256 | 252 | | |
257 | 253 | | |
| |||
442 | 438 | | |
443 | 439 | | |
444 | 440 | | |
445 | | - | |
446 | | - | |
447 | | - | |
| 441 | + | |
448 | 442 | | |
449 | 443 | | |
450 | 444 | | |
| |||
1170 | 1164 | | |
1171 | 1165 | | |
1172 | 1166 | | |
1173 | | - | |
| 1167 | + | |
1174 | 1168 | | |
1175 | 1169 | | |
1176 | 1170 | | |
| |||
1464 | 1458 | | |
1465 | 1459 | | |
1466 | 1460 | | |
1467 | | - | |
| 1461 | + | |
1468 | 1462 | | |
1469 | 1463 | | |
1470 | 1464 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
486 | 486 | | |
487 | 487 | | |
488 | 488 | | |
489 | | - | |
| 489 | + | |
490 | 490 | | |
491 | 491 | | |
492 | 492 | | |
| |||
634 | 634 | | |
635 | 635 | | |
636 | 636 | | |
| 637 | + | |
637 | 638 | | |
638 | | - | |
639 | | - | |
640 | | - | |
| 639 | + | |
641 | 640 | | |
642 | 641 | | |
643 | 642 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
136 | 139 | | |
137 | 140 | | |
138 | 141 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
31 | 69 | | |
32 | 70 | | |
33 | 71 | | |
| |||
138 | 176 | | |
139 | 177 | | |
140 | 178 | | |
| 179 | + | |
| 180 | + | |
141 | 181 | | |
142 | 182 | | |
143 | 183 | | |
| |||
0 commit comments