From 7e546bdff1ab0a82373bd49884da988e14be8543 Mon Sep 17 00:00:00 2001 From: clowwindy Date: Thu, 23 May 2013 12:38:10 +0800 Subject: [PATCH] try to fix OPENSSL_assert(inl > 0) --- encrypt.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/encrypt.py b/encrypt.py index a7adb14..5ee6754 100644 --- a/encrypt.py +++ b/encrypt.py @@ -144,6 +144,8 @@ class Encryptor(object): sys.exit(1) def encrypt(self, buf): + if len(buf) == 0: + return buf if self.method is None: return string.translate(buf, encrypt_table) else: @@ -154,6 +156,8 @@ class Encryptor(object): return self.cipher_iv + self.cipher.update(buf) def decrypt(self, buf): + if len(buf) == 0: + return buf if self.method is None: return string.translate(buf, decrypt_table) else: