diff options
author | Ayrx <terrycwk1994@gmail.com> | 2014-04-22 12:00:43 +0800 |
---|---|---|
committer | Ayrx <terrycwk1994@gmail.com> | 2014-04-22 12:12:41 +0800 |
commit | 3881917b59c49ab1616b61a696a74aa195c710e0 (patch) | |
tree | d535cadb781c22adeee4d5c9d4df804c020d5904 /cryptography | |
parent | a93abae0a62f4da67fb51a77dc0acafe2d04f99c (diff) | |
download | cryptography-3881917b59c49ab1616b61a696a74aa195c710e0.tar.gz cryptography-3881917b59c49ab1616b61a696a74aa195c710e0.tar.bz2 cryptography-3881917b59c49ab1616b61a696a74aa195c710e0.zip |
Added more copy() tests
Diffstat (limited to 'cryptography')
-rw-r--r-- | cryptography/hazmat/backends/openssl/backend.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/cryptography/hazmat/backends/openssl/backend.py b/cryptography/hazmat/backends/openssl/backend.py index 4137ad10..7d73c413 100644 --- a/cryptography/hazmat/backends/openssl/backend.py +++ b/cryptography/hazmat/backends/openssl/backend.py @@ -1309,16 +1309,15 @@ class _CMACContext(object): def copy(self): copied_ctx = self._backend._lib.CMAC_CTX_new() - self._backend._lib.CMAC_CTX_init(copied_ctx) copied_ctx = self._backend._ffi.gc( copied_ctx, self._backend._lib.CMAC_CTX_free ) res = self._backend._lib.CMAC_CTX_copy( copied_ctx, self._ctx ) - assert res == 0 + assert res == 1 return _CMACContext( - self._backend, self.algorithm, ctx=copied_ctx + self._backend, self._algorithm, ctx=copied_ctx ) |