diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-06-30 15:48:45 -0600 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-06-30 15:48:45 -0600 |
commit | 333370c385527371db45dba1634eab5e71c70fcb (patch) | |
tree | 38ef53d91eeaf3cc92dfb5ff75c44a11219f09f0 | |
parent | d1eaebde366a8131c58d35946c37a739e0d5b79f (diff) | |
download | cryptography-333370c385527371db45dba1634eab5e71c70fcb.tar.gz cryptography-333370c385527371db45dba1634eab5e71c70fcb.tar.bz2 cryptography-333370c385527371db45dba1634eab5e71c70fcb.zip |
rename a method in the cc backend for clarity
-rw-r--r-- | cryptography/hazmat/backends/commoncrypto/backend.py | 6 | ||||
-rw-r--r-- | cryptography/hazmat/backends/commoncrypto/ciphers.py | 16 |
2 files changed, 11 insertions, 11 deletions
diff --git a/cryptography/hazmat/backends/commoncrypto/backend.py b/cryptography/hazmat/backends/commoncrypto/backend.py index f78370c4..7bab979f 100644 --- a/cryptography/hazmat/backends/commoncrypto/backend.py +++ b/cryptography/hazmat/backends/commoncrypto/backend.py @@ -149,7 +149,7 @@ class Backend(object): buf, length ) - self._check_response(res) + self._check_cipher_response(res) return self._ffi.buffer(buf)[:] @@ -223,7 +223,7 @@ class Backend(object): self._lib.kCCModeRC4 ) - def _check_response(self, response): + def _check_cipher_response(self, response): if response == self._lib.kCCSuccess: return elif response == self._lib.kCCAlignmentError: @@ -246,7 +246,7 @@ class Backend(object): """ if ctx[0] != self._ffi.NULL: res = self._lib.CCCryptorRelease(ctx[0]) - self._check_response(res) + self._check_cipher_response(res) ctx[0] = self._ffi.NULL diff --git a/cryptography/hazmat/backends/commoncrypto/ciphers.py b/cryptography/hazmat/backends/commoncrypto/ciphers.py index 2820fd0e..525500c8 100644 --- a/cryptography/hazmat/backends/commoncrypto/ciphers.py +++ b/cryptography/hazmat/backends/commoncrypto/ciphers.py @@ -78,7 +78,7 @@ class _CipherContext(object): self._backend._lib.ccNoPadding, iv_nonce, cipher.key, len(cipher.key), self._backend._ffi.NULL, 0, 0, mode_option, ctx) - self._backend._check_response(res) + self._backend._check_cipher_response(res) self._ctx = ctx @@ -91,7 +91,7 @@ class _CipherContext(object): res = self._backend._lib.CCCryptorUpdate( self._ctx[0], data, len(data), buf, len(data) + self._byte_block_size - 1, outlen) - self._backend._check_response(res) + self._backend._check_cipher_response(res) return self._backend._ffi.buffer(buf)[:outlen[0]] def finalize(self): @@ -105,7 +105,7 @@ class _CipherContext(object): outlen = self._backend._ffi.new("size_t *") res = self._backend._lib.CCCryptorFinal( self._ctx[0], buf, len(buf), outlen) - self._backend._check_response(res) + self._backend._check_cipher_response(res) self._backend._release_cipher_ctx(self._ctx) return self._backend._ffi.buffer(buf)[:outlen[0]] @@ -143,14 +143,14 @@ class _GCMCipherContext(object): self._backend._ffi.NULL, cipher.key, len(cipher.key), self._backend._ffi.NULL, 0, 0, 0, self._ctx) - self._backend._check_response(res) + self._backend._check_cipher_response(res) res = self._backend._lib.CCCryptorGCMAddIV( self._ctx[0], mode.initialization_vector, len(mode.initialization_vector) ) - self._backend._check_response(res) + self._backend._check_cipher_response(res) def update(self, data): buf = self._backend._ffi.new("unsigned char[]", len(data)) @@ -160,7 +160,7 @@ class _GCMCipherContext(object): else: res = self._backend._lib.CCCryptorGCMDecrypt(*args) - self._backend._check_response(res) + self._backend._check_cipher_response(res) return self._backend._ffi.buffer(buf)[:] def finalize(self): @@ -170,7 +170,7 @@ class _GCMCipherContext(object): res = self._backend._lib.CCCryptorGCMFinal( self._ctx[0], tag_buf, tag_len ) - self._backend._check_response(res) + self._backend._check_cipher_response(res) self._backend._release_cipher_ctx(self._ctx) self._tag = self._backend._ffi.buffer(tag_buf)[:] if (self._operation == self._backend._lib.kCCDecrypt and @@ -184,7 +184,7 @@ class _GCMCipherContext(object): res = self._backend._lib.CCCryptorGCMAddAAD( self._ctx[0], data, len(data) ) - self._backend._check_response(res) + self._backend._check_cipher_response(res) @property def tag(self): |