AlphaWallet / AlphaWallet/alpha-wallet-android

Should show an error, instead of silently importing a invalid private key and then fail when signing

Open
#2,689 5 comments 0 reactions 1 assignee Claimed by @JamesSmartCell View on GitHub
Bug High Priority
Dominant language
Java
Stars
646
Forks
579
PR merge metrics
No merged PRs in 30d

Description

Private keys for the secp256k1 curve must be smaller than the order n, which is `fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141` and must not be `0…0` so these keys are invalid:

```
fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141
fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142
0000000000000000000000000000000000000000000000000000000000000000
```

While this is valid:

```
fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140
```

Should show an error, instead of silently importing the invalid private key and then fail when signing

Context: https://canary.discord.com/channels/548357107267928064/991499612617719848/991562068975161426

(on iOS, it crashes, which isn't good either https://github.com/AlphaWallet/alpha-wallet-ios/issues/4921)

Test cases used for iOS: https://github.com/AlphaWallet/alpha-wallet-ios/pull/4926/files#diff-ba15c35c2c0ace5c3cb860323254268977e248980976a3480334bd4078d751d2

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.