mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-30 10:12:35 +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()
|
return ret.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ParseHexFormatted returns the raw bytes from a formatted hex string
|
||||||
func ParseHexFormatted(in, sep string) []byte {
|
func ParseHexFormatted(in, sep string) []byte {
|
||||||
var ret bytes.Buffer
|
var ret bytes.Buffer
|
||||||
var err error
|
var err error
|
||||||
@@ -41,9 +42,8 @@ func ParseHexFormatted(in, sep string) []byte {
|
|||||||
for _, inByte := range inBytes {
|
for _, inByte := range inBytes {
|
||||||
if inBits, err = strconv.ParseInt(inByte, 16, 8); err != nil {
|
if inBits, err = strconv.ParseInt(inByte, 16, 8); err != nil {
|
||||||
return nil
|
return nil
|
||||||
} else {
|
|
||||||
ret.WriteByte(byte(inBits))
|
|
||||||
}
|
}
|
||||||
|
ret.WriteByte(byte(inBits))
|
||||||
}
|
}
|
||||||
return ret.Bytes()
|
return ret.Bytes()
|
||||||
}
|
}
|
||||||
@@ -109,8 +109,6 @@ func ParsePEMBundle(pemBundle string) (*ParsedCertBundle, error) {
|
|||||||
return nil, errutil.UserError{Err: "empty pem bundle"}
|
return nil, errutil.UserError{Err: "empty pem bundle"}
|
||||||
}
|
}
|
||||||
|
|
||||||
pemBundle = pemBundle
|
|
||||||
|
|
||||||
pemBytes := []byte(pemBundle)
|
pemBytes := []byte(pemBundle)
|
||||||
var pemBlock *pem.Block
|
var pemBlock *pem.Block
|
||||||
parsedBundle := &ParsedCertBundle{}
|
parsedBundle := &ParsedCertBundle{}
|
||||||
|
|||||||
@@ -316,6 +316,8 @@ func (p *ParsedCertBundle) Verify() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetCertificatePath returns a slice of certificates making up a path, pulled
|
||||||
|
// from the parsed cert bundle
|
||||||
func (p *ParsedCertBundle) GetCertificatePath() []*CertBlock {
|
func (p *ParsedCertBundle) GetCertificatePath() []*CertBlock {
|
||||||
var certPath []*CertBlock
|
var certPath []*CertBlock
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user