Unverified Commit 5c51ef85 authored by KAI's avatar KAI Committed by GitHub

accounts/keystore: handle error for invalid key in DecryptKey (#27432)

Co-authored-by: 's avatarKAI <kaili@coinsummer.io>
Co-authored-by: 's avatarFelix Lange <fjl@twurst.com>
parent 99eb0b52
......@@ -225,10 +225,13 @@ func DecryptKey(keyjson []byte, auth string) (*Key, error) {
if err != nil {
return nil, err
}
key := crypto.ToECDSAUnsafe(keyBytes)
key, err := crypto.ToECDSA(keyBytes)
if err != nil {
return nil, fmt.Errorf("invalid key: %w", err)
}
id, err := uuid.FromBytes(keyId)
if err != nil {
return nil, err
return nil, fmt.Errorf("invalid UUID: %w", err)
}
return &Key{
Id: id,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment