Skip to content

Commit 74aff4f

Browse files
committed
兼容微信支付签名探测流量
1 parent 4bd9aa0 commit 74aff4f

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

docs/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## [1.2.43] - 2023-12-13
4+
5+
### Fixed
6+
7+
- 兼容微信支付签名探测流量
8+
39
## [1.2.42] - 2023-11-15
410

511
### Fixed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
setup(
88
name="wechatpayv3",
9-
version="1.2.42",
9+
version="1.2.43",
1010
author="minibear",
1111
description="微信支付 API v3 Python SDK(python sdk for wechatpay v3)",
1212
long_description=long_description,

wechatpayv3/utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,10 @@ def rsa_verify(timestamp, nonce, body, signature, certificate):
7979
sign_str = '%s\n%s\n%s\n' % (timestamp, nonce, body)
8080
public_key = certificate.public_key()
8181
message = sign_str.encode('UTF-8')
82-
signature = b64decode(signature)
82+
try:
83+
signature = b64decode(signature)
84+
except:
85+
return False
8386
try:
8487
public_key.verify(signature, message, PKCS1v15(), SHA256())
8588
except InvalidSignature:

0 commit comments

Comments
 (0)