Skip to content

Commit

Permalink
Support cryptography 2.5's use of ffi.from_buffer() (#17)
Browse files Browse the repository at this point in the history
decryptor.update(): use bytes instead of list to support buffer
interface.
  • Loading branch information
zrhoffman authored and mitya57 committed Jan 23, 2019
1 parent aba8ed1 commit a334722
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion secretstorage/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def get_secret(self) -> bytes:
aes_iv = bytes(secret[1])
decryptor = Cipher(aes, modes.CBC(aes_iv), default_backend()).decryptor()
encrypted_secret = secret[2]
padded_secret = decryptor.update(encrypted_secret) + decryptor.finalize()
padded_secret = decryptor.update(bytes(encrypted_secret)) + decryptor.finalize()
assert isinstance(padded_secret, bytes)
return padded_secret[:-padded_secret[-1]]

Expand Down

0 comments on commit a334722

Please sign in to comment.