Skip to content

Commit

Permalink
Remove unused argument to unexported ECDSA funcs
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Sykes <sykesmat@us.ibm.com>
  • Loading branch information
sykesm committed Aug 21, 2020
1 parent 3696e30 commit c16eaad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
5 changes: 2 additions & 3 deletions bccsp/pkcs11/ecdsa.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ import (
"crypto/ecdsa"
"fmt"

"github.com/hyperledger/fabric/bccsp"
"github.com/hyperledger/fabric/bccsp/utils"
)

func (csp *impl) signECDSA(k ecdsaPrivateKey, digest []byte, opts bccsp.SignerOpts) ([]byte, error) {
func (csp *impl) signECDSA(k ecdsaPrivateKey, digest []byte) ([]byte, error) {
r, s, err := csp.signP11ECDSA(k.ski, digest)
if err != nil {
return nil, err
Expand All @@ -28,7 +27,7 @@ func (csp *impl) signECDSA(k ecdsaPrivateKey, digest []byte, opts bccsp.SignerOp
return utils.MarshalECDSASignature(r, s)
}

func (csp *impl) verifyECDSA(k ecdsaPublicKey, signature, digest []byte, opts bccsp.SignerOpts) (bool, error) {
func (csp *impl) verifyECDSA(k ecdsaPublicKey, signature, digest []byte) (bool, error) {
r, s, err := utils.UnmarshalECDSASignature(signature)
if err != nil {
return false, fmt.Errorf("Failed unmashalling signature [%s]", err)
Expand Down
7 changes: 3 additions & 4 deletions bccsp/pkcs11/pkcs11.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ func (csp *impl) KeyImport(raw interface{}, opts bccsp.KeyImportOpts) (k bccsp.K

default:
return csp.BCCSP.KeyImport(raw, opts)

}
}

Expand Down Expand Up @@ -255,7 +254,7 @@ func (csp *impl) Sign(k bccsp.Key, digest []byte, opts bccsp.SignerOpts) ([]byte
// Check key type
switch key := k.(type) {
case *ecdsaPrivateKey:
return csp.signECDSA(*key, digest, opts)
return csp.signECDSA(*key, digest)
default:
return csp.BCCSP.Sign(key, digest, opts)
}
Expand All @@ -277,9 +276,9 @@ func (csp *impl) Verify(k bccsp.Key, signature, digest []byte, opts bccsp.Signer
// Check key type
switch key := k.(type) {
case *ecdsaPrivateKey:
return csp.verifyECDSA(key.pub, signature, digest, opts)
return csp.verifyECDSA(key.pub, signature, digest)
case *ecdsaPublicKey:
return csp.verifyECDSA(*key, signature, digest, opts)
return csp.verifyECDSA(*key, signature, digest)
default:
return csp.BCCSP.Verify(k, signature, digest, opts)
}
Expand Down

0 comments on commit c16eaad

Please sign in to comment.