Skip to content

Commit

Permalink
Merge pull request #56 from cashapp/fix-sign-cast
Browse files Browse the repository at this point in the history
fix: cast to crypto.Signer instead of ecdsa.PrivateKey
  • Loading branch information
yoavamit authored Aug 20, 2024
2 parents 3b5a1af + a37b3dc commit 6f0f54f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ build
.DS_Store
result
*~
/cover.out
3 changes: 1 addition & 2 deletions pkg/pivit/pivit.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package pivit

import (
"crypto"
"crypto/ecdsa"
"crypto/x509"
"fmt"
"io"
Expand Down Expand Up @@ -93,7 +92,7 @@ func (y signer) Sign(rand io.Reader, digest []byte, opts crypto.SignerOpts) ([]b
}

switch priv := private.(type) {
case *ecdsa.PrivateKey:
case crypto.Signer:
return priv.Sign(rand, digest, opts)
default:
return nil, fmt.Errorf("invalid key type")
Expand Down

0 comments on commit 6f0f54f

Please sign in to comment.