mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-30 02:02:43 +00:00
Minor fixes from vet
This commit is contained in:
@@ -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{}
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user