X-Git-Url: https://www.wagner.pp.ru/gitweb/?a=blobdiff_plain;f=ctypescrypto%2Fcms.py;fp=ctypescrypto%2Fcms.py;h=8e856f50c24a5f5674282882db78e8aee7dd9268;hb=4b5cbc8c0a6f0ee8527cbc3ab9b8c92d77ec6c9f;hp=ede20f5e631bad5d346f90391cde2c97371985f2;hpb=606f6346def9e8d4fea51a3afa1df9389ad47057;p=oss%2Fctypescrypto.git diff --git a/ctypescrypto/cms.py b/ctypescrypto/cms.py index ede20f5..8e856f5 100644 --- a/ctypescrypto/cms.py +++ b/ctypescrypto/cms.py @@ -243,7 +243,7 @@ class EnvelopedData(CMSBase): """ recp = StackOfX509(recipients) bio = Membio(data) - cms_ptr = libcrypto.CMS_encrypt(recp.ptr, bio.bio, cipher.cipher_type, + cms_ptr = libcrypto.CMS_encrypt(recp.ptr, bio.bio, cipher.cipher, flags) if cms_ptr is None: raise CMSError("encrypt EnvelopedData") @@ -263,7 +263,7 @@ class EnvelopedData(CMSBase): if pkey != cert.pubkey: raise ValueError("Certificate doesn't match private key") bio = Membio() - res = libcrypto.CMS_decrypt(self.ptr, pkey.key, cert.ccert, None, + res = libcrypto.CMS_decrypt(self.ptr, pkey.key, cert.cert, None, bio.bio, flags) if res <= 0: raise CMSError("decrypting CMS") @@ -285,7 +285,7 @@ class EncryptedData(CMSBase): @param flags - OR-ed combination of Flags constant """ bio = Membio(data) - ptr = libcrypto.CMS_EncryptedData_encrypt(bio.bio, cipher.cipher_type, + ptr = libcrypto.CMS_EncryptedData_encrypt(bio.bio, cipher.cipher, key, len(key), flags) if ptr is None: raise CMSError("encrypt data")