Skip to content

Commit e369975

Browse files
rgee0alexellis
authored andcommitted
Move hmac from sha1 to sha256
Signed-off-by: Richard Gee <richard@technologee.co.uk>
1 parent b2c183a commit e369975

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/alexellis/derek
33
go 1.15
44

55
require (
6-
github.com/alexellis/hmac v0.0.0-20180624211220-5c52ab81c0de
6+
github.com/alexellis/hmac v1.3.0
77
github.com/dgrijalva/jwt-go v3.2.0+incompatible
88
github.com/google/go-github v17.0.0+incompatible
99
github.com/google/go-querystring v1.0.0 // indirect

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
3333
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
3434
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
3535
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
36-
github.com/alexellis/hmac v0.0.0-20180624211220-5c52ab81c0de h1:jiPEvtW8VT0KwJxRyjW2VAAvlssjj9SfecsQ3Vgv5tk=
37-
github.com/alexellis/hmac v0.0.0-20180624211220-5c52ab81c0de/go.mod h1:uAbpy8G7sjNB4qYdY6ymf5OIQ+TLDPApBYiR0Vc3lhk=
36+
github.com/alexellis/hmac v1.3.0 h1:DJl5wfuhwj2IjG9XRXzPY6bHZYrwrARFTotpxX3KS08=
37+
github.com/alexellis/hmac v1.3.0/go.mod h1:WmZwlIfB7EQaDuiScnQoMSs3K+1UalW/7ExXP3Cc2zU=
3838
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
3939
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
4040
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=

main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ func main() {
3737

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

40-
xHubSignature := os.Getenv("Http_X_Hub_Signature")
40+
xHubSignature256 := os.Getenv("Http_X_Hub_Signature_256")
4141

42-
if validateHmac && len(xHubSignature) == 0 {
43-
os.Stderr.Write([]byte("must provide X_Hub_Signature"))
42+
if validateHmac && len(xHubSignature256) == 0 {
43+
os.Stderr.Write([]byte("must provide X_Hub_Signature_256"))
4444
os.Exit(1)
4545
}
4646

@@ -51,7 +51,7 @@ func main() {
5151
}
5252

5353
if validateHmac {
54-
err := hmac.Validate(requestRaw, xHubSignature, config.SecretKey)
54+
err := hmac.Validate(requestRaw, xHubSignature256, config.SecretKey)
5555
if err != nil {
5656
os.Stderr.Write([]byte(err.Error()))
5757
os.Exit(1)

vendor/github.com/alexellis/hmac/go.mod

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/modules.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# github.com/alexellis/hmac v0.0.0-20180624211220-5c52ab81c0de
1+
# github.com/alexellis/hmac v1.3.0
22
## explicit
33
github.com/alexellis/hmac
44
# github.com/dgrijalva/jwt-go v3.2.0+incompatible

0 commit comments

Comments
 (0)