From 59d755ff0c94f77b7564e2cf7f07e44d7f7b9b64 Mon Sep 17 00:00:00 2001 From: Jerry <85411418@qq.com> Date: Thu, 16 Nov 2023 18:50:39 +0800 Subject: [PATCH] v1.5.98 --- alipay/sign.go | 30 ------------------------------ constant.go | 2 +- go.mod | 2 +- go.sum | 4 ++-- release_note.txt | 2 +- 5 files changed, 5 insertions(+), 35 deletions(-) diff --git a/alipay/sign.go b/alipay/sign.go index 0dae68b1..a8dd3905 100644 --- a/alipay/sign.go +++ b/alipay/sign.go @@ -205,36 +205,6 @@ func (a *Client) getRsaSign(bm gopay.BodyMap, signType string) (sign string, err return } -func (a *Client) getStrRsaSign(signParams string, signType string) (sign string, err error) { - var ( - h hash.Hash - hashs crypto.Hash - encryptedBytes []byte - ) - switch signType { - case RSA: - h = sha1.New() - hashs = crypto.SHA1 - case RSA2: - h = sha256.New() - hashs = crypto.SHA256 - default: - h = sha256.New() - hashs = crypto.SHA256 - } - if a.DebugSwitch == gopay.DebugOn { - xlog.Debugf("Alipay_Request_SignStr: %s", signParams) - } - if _, err = h.Write([]byte(signParams)); err != nil { - return - } - if encryptedBytes, err = rsa.SignPKCS1v15(rand.Reader, a.privateKey, hashs, h.Sum(nil)); err != nil { - return util.NULL, fmt.Errorf("[%w]: %+v", gopay.SignatureErr, err) - } - sign = base64.StdEncoding.EncodeToString(encryptedBytes) - return -} - // =============================== 获取SignData =============================== // 需注意的是,公钥签名模式和公钥证书签名模式的不同之处 diff --git a/constant.go b/constant.go index 5417ffab..197a5fa5 100644 --- a/constant.go +++ b/constant.go @@ -7,7 +7,7 @@ const ( OK = "OK" DebugOff = 0 DebugOn = 1 - Version = "1.5.97" + Version = "1.5.98" ) type DebugSwitch int8 diff --git a/go.mod b/go.mod index 812597d5..d33ce164 100644 --- a/go.mod +++ b/go.mod @@ -2,4 +2,4 @@ module github.com/go-pay/gopay go 1.18 -require golang.org/x/crypto v0.14.0 +require golang.org/x/crypto v0.15.0 diff --git a/go.sum b/go.sum index 886a2369..fcac726f 100644 --- a/go.sum +++ b/go.sum @@ -1,2 +1,2 @@ -golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= -golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= +golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= diff --git a/release_note.txt b/release_note.txt index 7881068e..0022cd86 100644 --- a/release_note.txt +++ b/release_note.txt @@ -2,7 +2,7 @@ 修改记录: (1) 支付宝:PR新增 client.PostFileAliPayAPISelfV2(),文件上传自定义方法(未做验证,不知道是否好用)。 (2) Apple:更新部分结构体字段。 - (3) + (3) PayPal:增加Token的自动刷新功能。 版本号:Release 1.5.97 修改记录: