From 7ff623706e290e7d0cd98d6797da82391143d933 Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Mon, 26 Feb 2018 02:23:06 -0500 Subject: [PATCH] Minor fixes from vet --- helper/certutil/helpers.go | 6 ++---- helper/certutil/types.go | 2 ++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/helper/certutil/helpers.go b/helper/certutil/helpers.go index 053e46c58c..3c072cee81 100644 --- a/helper/certutil/helpers.go +++ b/helper/certutil/helpers.go @@ -33,6 +33,7 @@ func GetHexFormatted(buf []byte, sep string) string { return ret.String() } +// ParseHexFormatted returns the raw bytes from a formatted hex string func ParseHexFormatted(in, sep string) []byte { var ret bytes.Buffer var err error @@ -41,9 +42,8 @@ func ParseHexFormatted(in, sep string) []byte { for _, inByte := range inBytes { if inBits, err = strconv.ParseInt(inByte, 16, 8); err != nil { return nil - } else { - ret.WriteByte(byte(inBits)) } + ret.WriteByte(byte(inBits)) } return ret.Bytes() } @@ -109,8 +109,6 @@ func ParsePEMBundle(pemBundle string) (*ParsedCertBundle, error) { return nil, errutil.UserError{Err: "empty pem bundle"} } - pemBundle = pemBundle - pemBytes := []byte(pemBundle) var pemBlock *pem.Block parsedBundle := &ParsedCertBundle{} diff --git a/helper/certutil/types.go b/helper/certutil/types.go index 3fe6740093..fb37910152 100644 --- a/helper/certutil/types.go +++ b/helper/certutil/types.go @@ -316,6 +316,8 @@ func (p *ParsedCertBundle) Verify() error { return nil } +// GetCertificatePath returns a slice of certificates making up a path, pulled +// from the parsed cert bundle func (p *ParsedCertBundle) GetCertificatePath() []*CertBlock { var certPath []*CertBlock