Skip to content

Commit

Permalink
decrypt should return binary
Browse files Browse the repository at this point in the history
  • Loading branch information
Randl committed Aug 22, 2016
1 parent 72f7c44 commit 44a86c6
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions axolotl/sessioncipher.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,6 @@ def decryptMsg(self, ciphertext, textMsg=True):

self.sessionStore.storeSession(self.recipientId, self.deviceId, sessionRecord)

if sys.version_info >= (3,0) and textMsg:
try:
return plaintext.decode()
except UnicodeDecodeError as e:
logger.warn(e)

return plaintext

def decryptPkmsg(self, ciphertext, textMsg=True):
Expand All @@ -107,11 +101,6 @@ def decryptPkmsg(self, ciphertext, textMsg=True):
if unsignedPreKeyId is not None:
self.preKeyStore.removePreKey(unsignedPreKeyId)

if sys.version_info >= (3, 0) and textMsg:
try:
return plaintext.decode()
except UnicodeDecodeError as e:
logger.warn(e)
return plaintext

def decryptWithSessionRecord(self, sessionRecord, cipherText):
Expand Down Expand Up @@ -287,4 +276,4 @@ def encrypt(self, raw):
raise

def decrypt(self, enc):
return self.unpad(self.cipher.decrypt(enc))
return self.unpad(self.cipher.decrypt(enc))

0 comments on commit 44a86c6

Please sign in to comment.