From 19a49c32b89259bf2523f266bbb5898471db131b Mon Sep 17 00:00:00 2001 From: Jack Doan Date: Thu, 3 Oct 2024 11:12:06 -0400 Subject: [PATCH] correct vocabulary --- cert/sign.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cert/sign.go b/cert/sign.go index dfa60f61a..d180b4eb1 100644 --- a/cert/sign.go +++ b/cert/sign.go @@ -42,7 +42,7 @@ type beingSignedCertificate interface { setSignature([]byte) error } -type SignerPredicate func(certBytes []byte) ([]byte, error) +type SignerLambda func(certBytes []byte) ([]byte, error) // Sign will create a sealed certificate using details provided by the TBSCertificate as long as those // details do not violate constraints of the signing certificate. @@ -55,7 +55,7 @@ func (t *TBSCertificate) Sign(signWith Certificate, curve Curve, key []byte) (Ce sig := ed25519.Sign(signer, certBytes) return sig, nil } - return t.SignWithPredicate(signWith, curve, sp) + return t.SignWith(signWith, curve, sp) case Curve_P256: signer := &ecdsa.PrivateKey{ PublicKey: ecdsa.PublicKey{ @@ -72,7 +72,7 @@ func (t *TBSCertificate) Sign(signWith Certificate, curve Curve, key []byte) (Ce hashed := sha256.Sum256(certBytes) return ecdsa.SignASN1(rand.Reader, signer, hashed[:]) } - return t.SignWithPredicate(signWith, curve, sp) + return t.SignWith(signWith, curve, sp) default: return nil, fmt.Errorf("invalid curve: %s", t.Curve) } @@ -87,13 +87,13 @@ func (t *TBSCertificate) SignPkcs11(signer Certificate, curve Curve, client *pkc return nil, fmt.Errorf("only P256 is supported by PKCS#11") case Curve_P256: //todo: verify that pkcs11 hashes for you - return t.SignWithPredicate(signer, curve, client.SignASN1) + return t.SignWith(signer, curve, client.SignASN1) default: return nil, fmt.Errorf("invalid curve: %s", t.Curve) } } -func (t *TBSCertificate) SignWithPredicate(signer Certificate, curve Curve, sp SignerPredicate) (Certificate, error) { +func (t *TBSCertificate) SignWith(signer Certificate, curve Curve, sp SignerLambda) (Certificate, error) { if curve != t.Curve { return nil, fmt.Errorf("curve in cert and private key supplied don't match") }