mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-19 02:01:43 +02:00
fix highwayhash
This commit is contained in:
committed by
Cole Wippern
parent
5a2cfeabba
commit
6b020a1f97
+3
-3
@@ -175,19 +175,19 @@ func ValidatePayload(r *http.Request, secretKey []byte) (payload []byte, err err
|
||||
}
|
||||
|
||||
sig := r.Header.Get(signatureHeader)
|
||||
if err := ValidateSignature(sig, body, secretKey); err != nil {
|
||||
if err := validateSignature(sig, body, secretKey); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return payload, nil
|
||||
}
|
||||
|
||||
// ValidateSignature validates the signature for the given payload.
|
||||
// validateSignature validates the signature for the given payload.
|
||||
// signature is the GitHub hash signature delivered in the X-Hub-Signature header.
|
||||
// payload is the JSON payload sent by GitHub Webhooks.
|
||||
// secretKey is the GitHub Webhook secret message.
|
||||
//
|
||||
// GitHub API docs: https://developer.github.com/webhooks/securing/#validating-payloads-from-github
|
||||
func ValidateSignature(signature string, payload, secretKey []byte) error {
|
||||
func validateSignature(signature string, payload, secretKey []byte) error {
|
||||
messageMAC, hashFunc, err := messageMAC(signature)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user