mirror of
https://github.com/openziti/ziti.git
synced 2026-10-14 08:10:17 +00:00
fix sha512 hex length check
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
|
||||
* Bug fix: Fabric v0.16.93 fixes `xgress.GetCircuit` to provide a `ctrl not ready` error response when requests arrive before the router is fully online.
|
||||
* Bug fix: `ziti edge login` will no longer truncate paths on controller URLs
|
||||
* Bug ifx: Ziti CLI will now longer check the proper lengths of sha512 hashes in hex format
|
||||
|
||||
# Release 0.22.0
|
||||
|
||||
|
||||
@@ -373,6 +373,7 @@ func cleanHexString(in string) string {
|
||||
}
|
||||
|
||||
func cleanSha512s(in []string) ([]string, error) {
|
||||
const sha512HexLength = 128
|
||||
|
||||
hashMap := map[string]struct{}{}
|
||||
for _, hash := range in {
|
||||
@@ -383,8 +384,8 @@ func cleanSha512s(in []string) ([]string, error) {
|
||||
}
|
||||
cleanHash := cleanHexString(hash)
|
||||
|
||||
if len(cleanHash) != 64 {
|
||||
return nil, fmt.Errorf("sha512 hash must be 64 hex characters, given [%s], cleaned [%s] with a length of %d", hash, cleanHash, len(cleanHash))
|
||||
if len(cleanHash) != sha512HexLength {
|
||||
return nil, fmt.Errorf("sha512 hash must be %d hex characters, given [%s], cleaned [%s] with a length of %d", sha512HexLength, hash, cleanHash, len(cleanHash))
|
||||
}
|
||||
|
||||
hashMap[cleanHash] = struct{}{}
|
||||
|
||||
Reference in New Issue
Block a user