Skip to content

crypto: fix error check in toECDSA#15632

Merged
fjl merged 1 commit into
ethereum:masterfrom
fjl:crypto-to-ecdsa-error
Dec 11, 2017
Merged

crypto: fix error check in toECDSA#15632
fjl merged 1 commit into
ethereum:masterfrom
fjl:crypto-to-ecdsa-error

Conversation

@fjl
Copy link
Copy Markdown
Contributor

@fjl fjl commented Dec 9, 2017

With this change,

key, err := crypto.HexToECDSA("0000000000000000000000000000000000000000000000000000000000000000")

returns nil key and an error instead of a non-nil key with nil X and Y inside.

Found by @guidovranken.

@fjl fjl force-pushed the crypto-to-ecdsa-error branch 2 times, most recently from ed52021 to fe0395f Compare December 9, 2017 08:11
@fjl fjl force-pushed the crypto-to-ecdsa-error branch from fe0395f to 7ce1df2 Compare December 9, 2017 08:13
Copy link
Copy Markdown
Contributor

@holiman holiman left a comment

Choose a reason for hiding this comment

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

LGTM

@fjl fjl merged commit 1a32bdf into ethereum:master Dec 11, 2017
@karalabe karalabe added this to the 1.8.0 milestone Dec 14, 2017
b00ris pushed a commit to b00ris/go-ethereum that referenced this pull request Jan 19, 2018
With this change,

    key, err := crypto.HexToECDSA("000000...")
    
returns nil key and an error instead of a non-nil key with nil X
and Y inside. Issue found by @guidovranken.
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.

3 participants