-
Notifications
You must be signed in to change notification settings - Fork 1.2k
backport: bitcoin#24226, #26116, #26243, #26443, #26517, #26714, #26738, #27058, #27220, #27461 #6922
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
backport: bitcoin#24226, #26116, #26243, #26443, #26517, #26714, #26738, #27058, #27220, #27461 #6922
Changes from all commits
5759d18
dfc97a9
94b3905
12d52b2
08707f8
84c07bf
13fd397
2c8b994
920d790
916aafb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,12 +5,9 @@ | |
|
|
||
| export LC_ALL=C | ||
| INPUT=$(cat /dev/stdin) | ||
| VALID=false | ||
| REVSIG=false | ||
| IFS=' | ||
| ' | ||
| if [ "$BITCOIN_VERIFY_COMMITS_ALLOW_SHA1" = 1 ]; then | ||
| GPG_RES="$(printf '%s\n' "$INPUT" | gpg --trust-model always "$@" 2>/dev/null)" | ||
| printf '%s\n' "$INPUT" | gpg --trust-model always "$@" 2>/dev/null | ||
| exit $? | ||
| else | ||
| # Note how we've disabled SHA1 with the --weak-digest option, disabling | ||
| # signatures - including selfsigs - that use SHA1. While you might think that | ||
|
|
@@ -20,46 +17,19 @@ else | |
| # an attacker could construct a pull-req that results in a commit object that | ||
| # they've created a collision for. Not the most likely attack, but preventing | ||
| # it is pretty easy so we do so as a "belt-and-suspenders" measure. | ||
| GPG_RES="" | ||
| for LINE in $(gpg --version); do | ||
| case "$LINE" in | ||
| "gpg (GnuPG) 1.4.1"*|"gpg (GnuPG) 2.0."*) | ||
| echo "Please upgrade to at least gpg 2.1.10 to check for weak signatures" > /dev/stderr | ||
| GPG_RES="$(printf '%s\n' "$INPUT" | gpg --trust-model always "$@" 2>/dev/null)" | ||
| printf '%s\n' "$INPUT" | gpg --trust-model always "$@" 2>/dev/null | ||
| exit $? | ||
| ;; | ||
| # We assume if you're running 2.1+, you're probably running 2.1.10+ | ||
| # gpg will fail otherwise | ||
| # We assume if you're running 1.X, it is either 1.4.1X or 1.4.20+ | ||
| # gpg will fail otherwise | ||
| esac | ||
| done | ||
| [ "$GPG_RES" = "" ] && GPG_RES="$(printf '%s\n' "$INPUT" | gpg --trust-model always --weak-digest sha1 "$@" 2>/dev/null)" | ||
| fi | ||
| for LINE in $GPG_RES; do | ||
| case "$LINE" in | ||
| "[GNUPG:] VALIDSIG "*) | ||
| while read KEY; do | ||
| [ "${LINE#?GNUPG:? VALIDSIG * * * * * * * * * }" = "$KEY" ] && VALID=true | ||
| done < ./contrib/verify-commits/trusted-keys | ||
| ;; | ||
| "[GNUPG:] REVKEYSIG "*) | ||
| [ "$BITCOIN_VERIFY_COMMITS_ALLOW_REVSIG" != 1 ] && exit 1 | ||
| REVSIG=true | ||
| GOODREVSIG="[GNUPG:] GOODSIG ${LINE#* * *}" | ||
| ;; | ||
| "[GNUPG:] EXPKEYSIG "*) | ||
| [ "$BITCOIN_VERIFY_COMMITS_ALLOW_REVSIG" != 1 ] && exit 1 | ||
| REVSIG=true | ||
| GOODREVSIG="[GNUPG:] GOODSIG ${LINE#* * *}" | ||
| ;; | ||
| esac | ||
| done | ||
| if ! $VALID; then | ||
| exit 1 | ||
| fi | ||
| if $VALID && $REVSIG; then | ||
| printf '%s\n' "$INPUT" | gpg --trust-model always "$@" 2>/dev/null | grep "^\[GNUPG:\] \(NEWSIG\|SIG_ID\|VALIDSIG\)" | ||
| echo "$GOODREVSIG" | ||
| else | ||
| printf '%s\n' "$INPUT" | gpg --trust-model always "$@" 2>/dev/null | ||
| printf '%s\n' "$INPUT" | gpg --trust-model always --weak-digest sha1 "$@" 2>/dev/null | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. style: Inconsistent indentation: spaces used instead of tabs (file uses tabs elsewhere) Prompt To Fix With AIThis is a comment left during a code review.
Path: contrib/verify-commits/gpg.sh
Line: 33:33
Comment:
**style:** Inconsistent indentation: spaces used instead of tabs (file uses tabs elsewhere)
How can I resolve this? If you propose a fix, please make it concise. |
||
| exit $? | ||
| fi | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,6 +29,7 @@ Versions and PRs are relevant to Bitcoin's core if not mentioned other. | |
| and it is disabled by default at build time since **v0.19.0** ([PR #15584](https://github.com/bitcoin/bitcoin/pull/15584)). | ||
| It has been removed as of **v0.20.0** ([PR 17165](https://github.com/bitcoin/bitcoin/pull/17165)). | ||
| * [`BIP 84`](https://github.com/bitcoin/bips/blob/master/bip-0084.mediawiki): The experimental descriptor wallets introduced in **v0.21.0** by default use the Hierarchical Deterministic Wallet derivation proposed by BIP 84. ([PR #16528](https://github.com/bitcoin/bitcoin/pull/16528)) | ||
| * [`BIP 86`](https://github.com/bitcoin/bips/blob/master/bip-0086.mediawiki): Descriptor wallets by default use the Hierarchical Deterministic Wallet derivation proposed by BIP 86 since **v23.0** ([PR #22364](https://github.com/bitcoin/bitcoin/pull/22364)). | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. logic: BIP 86 is Taproot-specific (HD derivation for P2TR outputs), but Dash Core doesn't implement Taproot. This entry may be misleading for Dash users since the referenced functionality doesn't exist in Dash. Does Dash Core actually implement BIP 86 derivation paths, or was this copied from Bitcoin without adjusting for Dash's lack of Taproot support? Prompt To Fix With AIThis is a comment left during a code review.
Path: doc/bips.md
Line: 32:32
Comment:
**logic:** BIP 86 is Taproot-specific (HD derivation for P2TR outputs), but Dash Core doesn't implement Taproot. This entry may be misleading for Dash users since the referenced functionality doesn't exist in Dash. Does Dash Core actually implement BIP 86 derivation paths, or was this copied from Bitcoin without adjusting for Dash's lack of Taproot support?
How can I resolve this? If you propose a fix, please make it concise.There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see header of the file:
|
||
| * [`BIP 90`](https://github.com/bitcoin/bips/blob/master/bip-0090.mediawiki): Trigger mechanism for activation of BIPs 34, 65, and 66 has been simplified to block height checks since **v0.14.0** ([PR #8391](https://github.com/bitcoin/bitcoin/pull/8391)). | ||
| * [`BIP 111`](https://github.com/bitcoin/bips/blob/master/bip-0111.mediawiki): `NODE_BLOOM` service bit added, and enforced for all peer versions as of **v0.13.0** ([PR #6579](https://github.com/bitcoin/bitcoin/pull/6579) and [PR #6641](https://github.com/bitcoin/bitcoin/pull/6641)). | ||
| * [`BIP 112`](https://github.com/bitcoin/bips/blob/master/bip-0112.mediawiki): The CHECKSEQUENCEVERIFY opcode has been implemented since **v0.12.1** ([PR #7524](https://github.com/bitcoin/bitcoin/pull/7524)), and has been *buried* since **v0.19.0** ([PR #16060](https://github.com/bitcoin/bitcoin/pull/16060)). | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -1582,7 +1582,18 @@ RPCHelpMan importmulti() | |||||
| UniValue response(UniValue::VARR); | ||||||
| { | ||||||
| LOCK(pwallet->cs_wallet); | ||||||
| EnsureWalletIsUnlocked(*pwallet); | ||||||
|
|
||||||
| // Check all requests are watchonly | ||||||
| bool is_watchonly{true}; | ||||||
| for (size_t i = 0; i < requests.size(); ++i) { | ||||||
| const UniValue& request = requests[i]; | ||||||
| if (!request.exists("watchonly") || !request["watchonly"].get_bool()) { | ||||||
| is_watchonly = false; | ||||||
| break; | ||||||
| } | ||||||
| } | ||||||
| // Wallet does not need to be unlocked if all requests are watchonly | ||||||
| if (!is_watchonly) EnsureWalletIsUnlocked(wallet); | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. logic: The check incorrectly uses
Suggested change
Should the logic check if the field is a bool type before calling get_bool(), or should we assume the field is always properly typed when it exists? Prompt To Fix With AIThis is a comment left during a code review.
Path: src/wallet/rpc/backup.cpp
Line: 1596:1596
Comment:
**logic:** The check incorrectly uses `request["watchonly"].get_bool()` without checking if the value exists first. If `watchonly` field exists but is null or not a bool, this will throw.
```suggestion
if (!is_watchonly) EnsureWalletIsUnlocked(*pwallet);
```
Should the logic check if the field is a bool type before calling get_bool(), or should we assume the field is always properly typed when it exists?
How can I resolve this? If you propose a fix, please make it concise. |
||||||
|
|
||||||
| // Verify all timestamps are present before importing any keys. | ||||||
| CHECK_NONFATAL(pwallet->chain().findBlock(pwallet->GetLastBlockHash(), FoundBlock().time(nLowestTimestamp).mtpTime(now))); | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Inconsistent indentation: spaces used instead of tabs (file uses tabs elsewhere)
Prompt To Fix With AI