Skip to content

Commit

Permalink
Bump dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
CF Logging And Metrics CI Bot committed Apr 23, 2024
1 parent 6b59a3a commit 08eeed1
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ require (
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/google/pprof v0.0.0-20240416155748-26353dc0451f // indirect
github.com/google/pprof v0.0.0-20240422182052-72c8669ad3e7 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/klauspost/compress v1.17.8 // indirect
Expand All @@ -49,7 +49,7 @@ require (
github.com/spf13/pflag v1.0.5 // indirect
github.com/square/certstrap v1.3.0 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
go.step.sm/crypto v0.44.6 // indirect
go.step.sm/crypto v0.44.7 // indirect
golang.org/x/crypto v0.22.0 // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/sync v0.7.0 // indirect
Expand Down
8 changes: 4 additions & 4 deletions src/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/pprof v0.0.0-20240416155748-26353dc0451f h1:WpZiq8iqvGjJ3m3wzAVKL6+0vz7VkE79iSy9GII00II=
github.com/google/pprof v0.0.0-20240416155748-26353dc0451f/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw=
github.com/google/pprof v0.0.0-20240422182052-72c8669ad3e7 h1:3q13T5NW3mlTJZM6B5UAsf2N5NYFbYWIyI3W8DlvBDU=
github.com/google/pprof v0.0.0-20240422182052-72c8669ad3e7/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw=
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
Expand Down Expand Up @@ -184,8 +184,8 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
go.opentelemetry.io/proto/otlp v1.2.0 h1:pVeZGk7nXDC9O2hncA6nHldxEjm6LByfA2aN8IOkz94=
go.opentelemetry.io/proto/otlp v1.2.0/go.mod h1:gGpR8txAl5M03pDhMC79G6SdqNV26naRm/KDsgaHD8A=
go.step.sm/crypto v0.44.6 h1:vQg8ujce7fNXDO8EWdriSz+ZSJpYnNh22QrFtRjdyoY=
go.step.sm/crypto v0.44.6/go.mod h1:oKRO4jaf2MaCohJDN+/8ShImkvIgUKfJxxy87gqsnXs=
go.step.sm/crypto v0.44.7 h1:aJ7dVbkm5TxEtHbicgN6JEVzPxZlp9JW9RQQH5bpi/o=
go.step.sm/crypto v0.44.7/go.mod h1:oKRO4jaf2MaCohJDN+/8ShImkvIgUKfJxxy87gqsnXs=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
Expand Down
83 changes: 74 additions & 9 deletions src/vendor/go.step.sm/crypto/pemutil/pem.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"fmt"
"math/big"
"os"
"strings"

"github.com/pkg/errors"
"go.step.sm/crypto/internal/utils"
Expand Down Expand Up @@ -277,6 +278,60 @@ func ParseCertificateRequest(pemData []byte) (*x509.CertificateRequest, error) {
return nil, errors.New("error parsing certificate request: no certificate found")
}

// PEMType represents a PEM block type. (e.g., CERTIFICATE, CERTIFICATE REQUEST, etc.)
type PEMType int

func (pt PEMType) String() string {
switch pt {
case PEMTypeCertificate:
return "certificate"
case PEMTypeCertificateRequest:
return "certificate request"
default:
return "undefined"
}
}

const (
// PEMTypeUndefined undefined
PEMTypeUndefined = iota
// PEMTypeCertificate CERTIFICATE
PEMTypeCertificate
// PEMTypeCertificateRequest CERTIFICATE REQUEST
PEMTypeCertificateRequest
)

// InvalidPEMError represents an error that occurs when parsing a file with
// PEM encoded data.
type InvalidPEMError struct {
Type PEMType
File string
Message string
Err error
}

func (e *InvalidPEMError) Error() string {
switch {
case e.Message != "":
return e.Message
case e.Err != nil:
return fmt.Sprintf("error decoding PEM data: %v", e.Err)
default:
var prefix = "input"
if e.File != "" {
prefix = fmt.Sprintf("file %s", e.File)
}
if e.Type == PEMTypeUndefined {
return fmt.Sprintf("%s does not contain valid PEM encoded data", prefix)
}
return fmt.Sprintf("%s does not contain a valid PEM encoded %s", prefix, e.Type)
}
}

func (e *InvalidPEMError) Unwrap() error {
return e.Err
}

// ReadCertificate returns a *x509.Certificate from the given filename. It
// supports certificates formats PEM and DER.
func ReadCertificate(filename string, opts ...Options) (*x509.Certificate, error) {
Expand Down Expand Up @@ -328,7 +383,7 @@ func ReadCertificateBundle(filename string) ([]*x509.Certificate, error) {
bundle = append(bundle, crt)
}
if len(bundle) == 0 {
return nil, errors.Errorf("file %s does not contain a valid PEM formatted certificate", filename)
return nil, &InvalidPEMError{File: filename, Type: PEMTypeCertificate}
}
return bundle, nil
}
Expand All @@ -351,15 +406,25 @@ func ReadCertificateRequest(filename string) (*x509.CertificateRequest, error) {

// PEM format
if bytes.Contains(b, PEMBlockHeader) {
csr, err := Parse(b, WithFilename(filename))
if err != nil {
return nil, err
}
switch csr := csr.(type) {
case *x509.CertificateRequest:
var block *pem.Block
for len(b) > 0 {
block, b = pem.Decode(b)
if block == nil {
break
}
if !strings.HasSuffix(block.Type, "CERTIFICATE REQUEST") {
continue
}
csr, err := x509.ParseCertificateRequest(block.Bytes)
if err != nil {
return nil, &InvalidPEMError{
File: filename, Type: PEMTypeCertificateRequest,
Message: fmt.Sprintf("error parsing %s: CSR PEM block is invalid: %v", filename, err),
Err: err,
}
}

return csr, nil
default:
return nil, errors.Errorf("error decoding PEM: file '%s' does not contain a certificate request", filename)
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ github.com/google/go-cmp/cmp/internal/diff
github.com/google/go-cmp/cmp/internal/flags
github.com/google/go-cmp/cmp/internal/function
github.com/google/go-cmp/cmp/internal/value
# github.com/google/pprof v0.0.0-20240416155748-26353dc0451f
# github.com/google/pprof v0.0.0-20240422182052-72c8669ad3e7
## explicit; go 1.19
github.com/google/pprof/profile
# github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1
Expand Down Expand Up @@ -164,7 +164,7 @@ go.opentelemetry.io/proto/otlp/common/v1
go.opentelemetry.io/proto/otlp/metrics/v1
go.opentelemetry.io/proto/otlp/resource/v1
go.opentelemetry.io/proto/otlp/trace/v1
# go.step.sm/crypto v0.44.6
# go.step.sm/crypto v0.44.7
## explicit; go 1.20
go.step.sm/crypto/fingerprint
go.step.sm/crypto/internal/bcrypt_pbkdf
Expand Down

0 comments on commit 08eeed1

Please sign in to comment.