Fix linting issues.

This commit is contained in:
Mariano Cano 2020-02-14 11:46:31 -08:00
parent dd5a96a42e
commit 5c8c741fab
2 changed files with 11 additions and 27 deletions

View file

@ -290,19 +290,3 @@ func (a *Authority) GetDatabase() db.AuthDB {
func (a *Authority) Shutdown() error {
return a.db.Shutdown()
}
func parseCryptoSigner(filename, password string) (crypto.Signer, error) {
var opts []pemutil.Options
if password != "" {
opts = append(opts, pemutil.WithPassword([]byte(password)))
}
key, err := pemutil.Read(filename, opts...)
if err != nil {
return nil, err
}
signer, ok := key.(crypto.Signer)
if !ok {
return nil, errors.Errorf("key %s of type %T cannot be used for signing operations", filename, key)
}
return signer, nil
}

View file

@ -23,17 +23,17 @@ type algorithmAttributes struct {
const DefaultRSAKeySize = 3072
var signatureAlgorithmMapping = map[apiv1.SignatureAlgorithm]algorithmAttributes{
apiv1.UnspecifiedSignAlgorithm: algorithmAttributes{"EC", "P-256"},
apiv1.SHA256WithRSA: algorithmAttributes{"RSA", ""},
apiv1.SHA384WithRSA: algorithmAttributes{"RSA", ""},
apiv1.SHA512WithRSA: algorithmAttributes{"RSA", ""},
apiv1.SHA256WithRSAPSS: algorithmAttributes{"RSA", ""},
apiv1.SHA384WithRSAPSS: algorithmAttributes{"RSA", ""},
apiv1.SHA512WithRSAPSS: algorithmAttributes{"RSA", ""},
apiv1.ECDSAWithSHA256: algorithmAttributes{"EC", "P-256"},
apiv1.ECDSAWithSHA384: algorithmAttributes{"EC", "P-384"},
apiv1.ECDSAWithSHA512: algorithmAttributes{"EC", "P-521"},
apiv1.PureEd25519: algorithmAttributes{"OKP", "Ed25519"},
apiv1.UnspecifiedSignAlgorithm: {"EC", "P-256"},
apiv1.SHA256WithRSA: {"RSA", ""},
apiv1.SHA384WithRSA: {"RSA", ""},
apiv1.SHA512WithRSA: {"RSA", ""},
apiv1.SHA256WithRSAPSS: {"RSA", ""},
apiv1.SHA384WithRSAPSS: {"RSA", ""},
apiv1.SHA512WithRSAPSS: {"RSA", ""},
apiv1.ECDSAWithSHA256: {"EC", "P-256"},
apiv1.ECDSAWithSHA384: {"EC", "P-384"},
apiv1.ECDSAWithSHA512: {"EC", "P-521"},
apiv1.PureEd25519: {"OKP", "Ed25519"},
}
// generateKey is used for testing purposes.