Skip to content

Commit

Permalink
Change fmt to errors package for formatting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
hslatman committed May 6, 2021
1 parent ff1b46c commit d0a9cbc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions authority/provisioner/scep.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package provisioner

import (
"context"
"fmt"
"time"

"github.com/pkg/errors"
Expand Down Expand Up @@ -88,7 +87,7 @@ func (s *SCEP) Init(config Config) (err error) {
}

if s.MinimumPublicKeyLength%8 != 0 {
return fmt.Errorf("only minimum public keys exactly divisible by 8 are supported; %d is not exactly divisibly by 8", s.MinimumPublicKeyLength)
return errors.Errorf("only minimum public keys exactly divisible by 8 are supported; %d is not exactly divisibly by 8", s.MinimumPublicKeyLength)
}

// TODO: add other, SCEP specific, options?
Expand Down
3 changes: 1 addition & 2 deletions authority/provisioner/sign_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"crypto/x509/pkix"
"encoding/asn1"
"encoding/json"
"fmt"
"net"
"net/url"
"reflect"
Expand Down Expand Up @@ -139,7 +138,7 @@ func (v publicKeyMinimumLengthValidator) Valid(req *x509.CertificateRequest) err
case *rsa.PublicKey:
minimumLengthInBytes := v.length / 8
if k.Size() < minimumLengthInBytes {
return fmt.Errorf("rsa key in CSR must be at least %d bits (%d bytes)", v.length, minimumLengthInBytes)
return errors.Errorf("rsa key in CSR must be at least %d bits (%d bytes)", v.length, minimumLengthInBytes)
}
case *ecdsa.PublicKey, ed25519.PublicKey:
default:
Expand Down

0 comments on commit d0a9cbc

Please sign in to comment.