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

accounts/scwallet: use go-ethereum crypto instead of go-ecdh #22212

Merged
merged 3 commits into from
Jan 26, 2021

Conversation

fjl
Copy link
Contributor

@fjl fjl commented Jan 22, 2021

github.com/wsddn/go-ecdh is a wrapper package for ECDH with any elliptic curve.

Since 'generic' ECDH is not required in accounts/scwallet (the curve is always secp256k1),
we can just use the standard library and our own crypto libraries to perform
ECDH and save a dependency.

@fjl fjl requested a review from gballet as a code owner January 22, 2021 10:30
Copy link
Member

@gballet gballet left a comment

Choose a reason for hiding this comment

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

This breaks the establishment of the secure channel between geth and the smartcard.

err="failed to authenticate card 0421b855: unexpected insecure response status Cla=0x80, Ins=0x11, Sw=0x6982"

It still works in master. I assume this is just a difference of format, I'll keep investigating.

@gballet
Copy link
Member

gballet commented Jan 26, 2021

Copy link
Member

@gballet gballet left a comment

Choose a reason for hiding this comment

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

The wrong public key was used, now it works.

fjl and others added 3 commits January 26, 2021 13:37
github.com/wsddn/go-ecdh is a wrapper package for ECDH functionality
with any elliptic curve.

Since 'generic' ECDH is not required in accounts/scwallet (the curve is
always secp256k1), we can just use the standard library functionality
and our own crypto libraries to perform ECDH and save a dependency.
Co-authored-by: Guillaume Ballet <gballet@gmail.com>
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.

2 participants