Skip to content
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

cgo: Add verify message. #9

Merged
merged 2 commits into from
Oct 28, 2024
Merged

Conversation

JoeGruffins
Copy link
Member

No description provided.

@JoeGruffins JoeGruffins force-pushed the verifymessage branch 2 times, most recently from c7cb7fe to 991e59c Compare October 14, 2024 07:50
cgo/addresses.go Outdated Show resolved Hide resolved
Copy link
Contributor

@ukane-philemon ukane-philemon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UtAck.

return errCResponse("unable to decode signature: %v", err)
}

ok, err = dcrwallet.VerifyMessage(goString(cMessage), addr, sig, w.MainWallet().ChainParams())
Copy link

@dreacot dreacot Oct 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// Addresses must have an associated secp256k1 private key and therefore
// must be P2PK or P2PKH (P2SH is not allowed).
switch addr.(type) {
case *stdaddr.AddressPubKeyEcdsaSecp256k1V0:
case *stdaddr.AddressPubKeyHashEcdsaSecp256k1V0:
	// Valid address types, proceed with verification.
default:
	return errCResponse("invalid address type: must be P2PK or P2PKH")
}

shouldn't we be checking to ensure the address is not P2SH?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah. I assumed it would error somewhere along the way anyhow but we can check.

@JoeGruffins
Copy link
Member Author

JoeGruffins commented Oct 18, 2024

@JoeGruffins
Copy link
Member Author

@JoeGruffins JoeGruffins merged commit c890cb2 into decred:master Oct 28, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants