fix
This commit is contained in:
parent
177cb8b34c
commit
be793c3cb7
@ -3,6 +3,7 @@ package inapp_shop
|
|||||||
import (
|
import (
|
||||||
"crypto/hmac"
|
"crypto/hmac"
|
||||||
"crypto/sha256"
|
"crypto/sha256"
|
||||||
|
"encoding/hex"
|
||||||
"f5"
|
"f5"
|
||||||
"main/common"
|
"main/common"
|
||||||
"main/constant"
|
"main/constant"
|
||||||
@ -119,7 +120,7 @@ func (this *InAppShopApi) Callback(c *gin.Context) {
|
|||||||
mac := hmac.New(sha256.New, []byte(secret))
|
mac := hmac.New(sha256.New, []byte(secret))
|
||||||
_, _ = mac.Write([]byte(strb.String()))
|
_, _ = mac.Write([]byte(strb.String()))
|
||||||
|
|
||||||
sign := string(mac.Sum(nil))
|
sign := hex.EncodeToString(mac.Sum(nil))
|
||||||
if strings.EqualFold(strings.ToLower(sign), strings.ToLower(reqObj.Signature)) {
|
if strings.EqualFold(strings.ToLower(sign), strings.ToLower(reqObj.Signature)) {
|
||||||
f5.RspErr(c, 401, "invalid sign")
|
f5.RspErr(c, 401, "invalid sign")
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user