Skip to content

Commit

Permalink
update error messages
Browse files Browse the repository at this point in the history
Signed-off-by: Meredith Lancaster <malancas@github.com>
  • Loading branch information
malancas committed Apr 19, 2023
1 parent 3924a98 commit b41aa63
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/signer/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func NewFileSigner(keyPath, keyPass string, hashFunc crypto.Hash) (*File, error)
return &File{signer}, nil
case ed25519.PrivateKey:
if hashFunc != crypto.SHA512 {
fmt.Printf("ed25519 only supports SHA512, specified hash func is %s. Using SHA512\n", hashFunc)
fmt.Printf("Ed25519 only supports SHA512, specified hash func is %s. Using hash function specified by Ed25519\n", hashFunc)
}
signer, err := signature.LoadED25519SignerVerifier(pk)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/signer/memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func getCurveFromSigner(signer crypto.Signer) (elliptic.Curve, error) {
// the in-memory cert chain uses ECDSA keys, so we cast the public key to an ECDSA key
pub, ok := signer.Public().(*ecdsa.PublicKey)
if !ok {
return nil, errors.New("signer is not an ECDSA key")
return nil, errors.New("casting signer's public key to an ECDSA key")
}
return pub.Curve, nil
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/signer/tink.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func KeyHandleToSigner(kh *keyset.Handle, hashFunc crypto.Hash) (crypto.Signer,
return p, nil
case ed25519SignerTypeURL:
if hashFunc != crypto.SHA512 {
fmt.Printf("ed25519 only supports SHA512, specified hash func is %s. Using SHA512\n", hashFunc)
fmt.Printf("Ed25519 only supports SHA512, specified hash func is %s. Using hash function specified by Ed25519\n", hashFunc)
}
// https://github.com/google/tink/blob/9753ffddd4d04aa56e0605ff4a0db46f2fb80529/go/signature/ed25519_signer_key_manager.go#L47
privKey := new(ed25519pb.Ed25519PrivateKey)
Expand Down

0 comments on commit b41aa63

Please sign in to comment.