Skip to content

Commit

Permalink
fix(pipeline): check also checksum length
Browse files Browse the repository at this point in the history
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
  • Loading branch information
89luca89 committed Nov 19, 2024
1 parent 256eb6c commit bdc79c9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/build/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,17 @@ func validateWith(data map[string]string, inputs map[string]config.Input) (map[s
if !matchValidShaChars(data[k]) {
return data, fmt.Errorf("checksum input %q for pipeline contains invalid characters", k)
}
if len(data[k]) != 64 {
return data, fmt.Errorf("checksum input %q for pipeline, invalid length", k)
}
}
if k == "expected-sha512" && data[k] != "" {
if !matchValidShaChars(data[k]) {
return data, fmt.Errorf("checksum input %q for pipeline contains invalid characters", k)
}
if len(data[k]) != 128 {
return data, fmt.Errorf("checksum input %q for pipeline, invalid length", k)
}
}

if v.Required && data[k] == "" {
Expand Down

0 comments on commit bdc79c9

Please sign in to comment.