mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-29 17:36:38 +08:00
print out key if 'malformed'
This commit is contained in:
@ -3,6 +3,7 @@ package crypto
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"crypto/elliptic"
|
||||
"crypto/hmac"
|
||||
@ -105,7 +106,8 @@ func GenerateEKeyPair(curveName string) ([]byte, GenSharedKey, error) {
|
||||
curveSize := curve.Params().BitSize
|
||||
|
||||
if len(theirPub) != (curveSize / 4) {
|
||||
return nil, errors.New("Malformed public key.")
|
||||
u.PErr("Malformed public key: %v", theirPub)
|
||||
return nil, fmt.Errorf("Malformed public key: %v != %v", len(theirPub), (curveSize / 4))
|
||||
}
|
||||
|
||||
bound := (curveSize / 8)
|
||||
|
Reference in New Issue
Block a user