Skip to content

Commit

Permalink
Move hmac from sha1 to sha256
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Gee <richard@technologee.co.uk>
  • Loading branch information
rgee0 authored and alexellis committed Nov 4, 2021
1 parent b2c183a commit e369975
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/alexellis/derek
go 1.15

require (
github.com/alexellis/hmac v0.0.0-20180624211220-5c52ab81c0de
github.com/alexellis/hmac v1.3.0
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/google/go-github v17.0.0+incompatible
github.com/google/go-querystring v1.0.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/alexellis/hmac v0.0.0-20180624211220-5c52ab81c0de h1:jiPEvtW8VT0KwJxRyjW2VAAvlssjj9SfecsQ3Vgv5tk=
github.com/alexellis/hmac v0.0.0-20180624211220-5c52ab81c0de/go.mod h1:uAbpy8G7sjNB4qYdY6ymf5OIQ+TLDPApBYiR0Vc3lhk=
github.com/alexellis/hmac v1.3.0 h1:DJl5wfuhwj2IjG9XRXzPY6bHZYrwrARFTotpxX3KS08=
github.com/alexellis/hmac v1.3.0/go.mod h1:WmZwlIfB7EQaDuiScnQoMSs3K+1UalW/7ExXP3Cc2zU=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
Expand Down
8 changes: 4 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ func main() {

requestRaw, _ := ioutil.ReadAll(os.Stdin)

xHubSignature := os.Getenv("Http_X_Hub_Signature")
xHubSignature256 := os.Getenv("Http_X_Hub_Signature_256")

if validateHmac && len(xHubSignature) == 0 {
os.Stderr.Write([]byte("must provide X_Hub_Signature"))
if validateHmac && len(xHubSignature256) == 0 {
os.Stderr.Write([]byte("must provide X_Hub_Signature_256"))
os.Exit(1)
}

Expand All @@ -51,7 +51,7 @@ func main() {
}

if validateHmac {
err := hmac.Validate(requestRaw, xHubSignature, config.SecretKey)
err := hmac.Validate(requestRaw, xHubSignature256, config.SecretKey)
if err != nil {
os.Stderr.Write([]byte(err.Error()))
os.Exit(1)
Expand Down
3 changes: 3 additions & 0 deletions vendor/github.com/alexellis/hmac/go.mod

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# github.com/alexellis/hmac v0.0.0-20180624211220-5c52ab81c0de
# github.com/alexellis/hmac v1.3.0
## explicit
github.com/alexellis/hmac
# github.com/dgrijalva/jwt-go v3.2.0+incompatible
Expand Down

0 comments on commit e369975

Please sign in to comment.