From 1bc6e50b06af33aa02f34915a76a57a9cfe5cd5c Mon Sep 17 00:00:00 2001 From: Aaron3S Date: Mon, 26 Sep 2022 14:52:13 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E5=8E=BB=E9=99=A4?= =?UTF-8?q?=E7=BB=93=E5=B0=BE=E7=A9=BA=E5=AD=97=E8=8A=82=E7=9A=84=E5=86=99?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/common/utils/crypto.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/common/utils/crypto.py b/apps/common/utils/crypto.py index 994c0f087..1407c7d7d 100644 --- a/apps/common/utils/crypto.py +++ b/apps/common/utils/crypto.py @@ -83,7 +83,7 @@ class PiicoSM4EcbCrypto(BaseCrypto): def _decrypt(self, data: bytes) -> bytes: bs = self.cipher.decrypt(data) - return bs[:bs.index(0)] + return bs.rstrip(b'\0') class AESCrypto: