Merge pull request #697 from aaronlehmann/cosmetic

trustmanager: Minor cosmetic source code fixes
This commit is contained in:
Ying Li 2016-04-26 15:28:53 -07:00
commit dc445b4a3a
3 changed files with 5 additions and 5 deletions

View File

@ -133,6 +133,6 @@ func TestVerifyLeafWithNoLeaf(t *testing.T) {
// Try to find a valid chain for cert // Try to find a valid chain for cert
err = Verify(store, "secure.example.com", certList) err = Verify(store, "secure.example.com", certList)
if err == nil { if err == nil {
t.Fatalf("expected error due to no leafs provided") t.Fatalf("expected error due to no leaves provided")
} }
} }

View File

@ -541,8 +541,8 @@ func CertsToKeys(leafCerts []*x509.Certificate, intCerts map[string][]*x509.Cert
if err != nil { if err != nil {
continue continue
} }
if intCertsForLeafs, ok := intCerts[certID]; ok { if intCertsForLeaves, ok := intCerts[certID]; ok {
certBundle = append(certBundle, intCertsForLeafs...) certBundle = append(certBundle, intCertsForLeaves...)
} }
certChainPEM, err := CertChainToPEM(certBundle) certChainPEM, err := CertChainToPEM(certBundle)
if err != nil { if err != nil {

View File

@ -137,7 +137,7 @@ type YubiPrivateKey struct {
libLoader pkcs11LibLoader libLoader pkcs11LibLoader
} }
// YubiKeySigner wraps a YubiPrivateKey and implements the crypto.Signer interface // yubikeySigner wraps a YubiPrivateKey and implements the crypto.Signer interface
type yubikeySigner struct { type yubikeySigner struct {
YubiPrivateKey YubiPrivateKey
} }
@ -344,7 +344,7 @@ func getECDSAKey(ctx IPKCS11Ctx, session pkcs11.SessionHandle, pkcs11KeyID []byt
return data.NewECDSAPublicKey(pubBytes), data.CanonicalRootRole, nil return data.NewECDSAPublicKey(pubBytes), data.CanonicalRootRole, nil
} }
// Sign returns a signature for a given signature request // sign returns a signature for a given signature request
func sign(ctx IPKCS11Ctx, session pkcs11.SessionHandle, pkcs11KeyID []byte, passRetriever passphrase.Retriever, payload []byte) ([]byte, error) { func sign(ctx IPKCS11Ctx, session pkcs11.SessionHandle, pkcs11KeyID []byte, passRetriever passphrase.Retriever, payload []byte) ([]byte, error) {
err := login(ctx, session, passRetriever, pkcs11.CKU_USER, UserPin) err := login(ctx, session, passRetriever, pkcs11.CKU_USER, UserPin)
if err != nil { if err != nil {