Skip to content

edwards: More strict pubkey parsing.#2869

Merged
davecgh merged 1 commit intodecred:masterfrom
davecgh:edwards_more_strict_pubkey_parse
Jan 14, 2022
Merged

edwards: More strict pubkey parsing.#2869
davecgh merged 1 commit intodecred:masterfrom
davecgh:edwards_more_strict_pubkey_parse

Conversation

@davecgh
Copy link
Copy Markdown
Member

@davecgh davecgh commented Jan 13, 2022

This modifies the public key parsing method to make it more strict by rejecting public keys that are not exactly the required length as opposed to silently truncating or padding them and adds tests accordingly.

This helps prevent misuse by callers and makes it behave more consistently with the secp256k1 public key parsing.

Note that this does not affect consensus code since the only place it is called is during the signature verification opcode where the consensus rules ensure the the key is the correct length before parsing it.

Closes #2857.

Comment thread dcrec/edwards/pubkey.go Outdated
This modifies the public key parsing method to make it more strict by
rejecting public keys that are not exactly the required length as
opposed to silently truncating or padding them and adds tests
accordingly.

This helps prevent misuse by callers and makes it behave more
consistently with the secp256k1 public key parsing.

Note that this does not affect consensus code since the only place it is
called is during the signature verification opcode where the consensus
rules ensure the the key is the correct length before parsing it.
@davecgh davecgh force-pushed the edwards_more_strict_pubkey_parse branch from 525a5d8 to 79f15b7 Compare January 13, 2022 17:29
@davecgh davecgh merged commit 79f15b7 into decred:master Jan 14, 2022
@davecgh davecgh deleted the edwards_more_strict_pubkey_parse branch January 14, 2022 01:39
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.

stdaddr: PubKeyEd25519V0 from string has different AddressPubKeyHash.

4 participants