Fix error wrap on pki_helpers

This commit is contained in:
Yago Nobre 2018-11-03 03:31:30 -03:00
parent 6b2a01709c
commit a80a573074
No known key found for this signature in database
GPG Key ID: 09AE6CEC2B8E9DD3

View File

@ -201,7 +201,7 @@ func TryLoadKeyFromDisk(pkiPath, name string) (*rsa.PrivateKey, error) {
case *rsa.PrivateKey:
key = k
default:
return nil, errors.Wrapf(err, "the private key file %s isn't in RSA format", privateKeyPath)
return nil, errors.Errorf("the private key file %s isn't in RSA format", privateKeyPath)
}
return key, nil
@ -228,7 +228,7 @@ func TryLoadPrivatePublicKeyFromDisk(pkiPath, name string) (*rsa.PrivateKey, *rs
// Allow RSA format only
k, ok := privKey.(*rsa.PrivateKey)
if !ok {
return nil, nil, errors.Wrapf(err, "the private key file %s isn't in RSA format", privateKeyPath)
return nil, nil, errors.Errorf("the private key file %s isn't in RSA format", privateKeyPath)
}
p := pubKeys[0].(*rsa.PublicKey)