Minor fixes from vet

This commit is contained in:
Jeff Mitchell
2018-02-26 02:23:06 -05:00
parent 25d029f219
commit 7ff623706e
2 changed files with 4 additions and 4 deletions

View File

@@ -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{}

View File

@@ -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