X-Git-Url: http://wagner.pp.ru/gitweb/?a=blobdiff_plain;f=ctypescrypto%2Fcipher.py;fp=ctypescrypto%2Fcipher.py;h=a0a9ac33edc3912021a2f826cf04edad660fb788;hb=ec92bf04b008b0401014cae90fa2dfca18efa02c;hp=ff614783a77f965680f84018c48850f93a16ad88;hpb=ff669c32aa77c9ebfb9c5371b2c8a9d41de614f8;p=oss%2Fctypescrypto.git diff --git a/ctypescrypto/cipher.py b/ctypescrypto/cipher.py index ff61478..a0a9ac3 100644 --- a/ctypescrypto/cipher.py +++ b/ctypescrypto/cipher.py @@ -79,7 +79,7 @@ class CipherType: """ Return cipher's algorithm name, derived from OID """ - return self.oid().short_name() + return self.oid().shortname() def oid(self): """ Returns ASN.1 object identifier of the cipher as @@ -125,7 +125,7 @@ class Cipher: if (cipher_type.flags() & 8) != 0: # Variable key length cipher. result = libcrypto.EVP_CipherInit_ex(self.ctx, cipher_type.cipher, None, None, None, c_int(enc)) - result=libcrypto.EVP_CIPHER_CTX_set_key_length(self.ctx,len(key)) + result = libcrypto.EVP_CIPHER_CTX_set_key_length(self.ctx,len(key)) if result == 0: self._clean_ctx() raise CipherError("Unable to set key length") @@ -202,8 +202,8 @@ class Cipher: def _clean_ctx(self): try: if self.ctx is not None: - self.libcrypto.EVP_CIPHER_CTX_cleanup(self.ctx) - self.libcrypto.EVP_CIPHER_CTX_free(self.ctx) + libcrypto.EVP_CIPHER_CTX_cleanup(self.ctx) + libcrypto.EVP_CIPHER_CTX_free(self.ctx) del(self.ctx) except AttributeError: pass