Lines Matching refs:ec

25 BIO *ossl_cms_EncryptedContent_init_bio(CMS_EncryptedContentInfo *ec,  in ossl_cms_EncryptedContent_init_bio()  argument
32 X509_ALGOR *calg = ec->contentEncryptionAlgorithm; in ossl_cms_EncryptedContent_init_bio()
44 enc = ec->cipher ? 1 : 0; in ossl_cms_EncryptedContent_init_bio()
56 cipher = ec->cipher; in ossl_cms_EncryptedContent_init_bio()
60 if (ec->key != NULL) in ossl_cms_EncryptedContent_init_bio()
61 ec->cipher = NULL; in ossl_cms_EncryptedContent_init_bio()
108 if (ec->taglen > 0 in ossl_cms_EncryptedContent_init_bio()
110 ec->taglen, ec->tag) <= 0) { in ossl_cms_EncryptedContent_init_bio()
122 if (!enc || !ec->key) { in ossl_cms_EncryptedContent_init_bio()
130 if (!ec->key) { in ossl_cms_EncryptedContent_init_bio()
131 ec->key = tkey; in ossl_cms_EncryptedContent_init_bio()
132 ec->keylen = tkeylen; in ossl_cms_EncryptedContent_init_bio()
141 if (ec->keylen != tkeylen) { in ossl_cms_EncryptedContent_init_bio()
143 if (EVP_CIPHER_CTX_set_key_length(ctx, ec->keylen) <= 0) { in ossl_cms_EncryptedContent_init_bio()
148 if (enc || ec->debug) { in ossl_cms_EncryptedContent_init_bio()
153 OPENSSL_clear_free(ec->key, ec->keylen); in ossl_cms_EncryptedContent_init_bio()
154 ec->key = tkey; in ossl_cms_EncryptedContent_init_bio()
155 ec->keylen = tkeylen; in ossl_cms_EncryptedContent_init_bio()
162 if (EVP_CipherInit_ex(ctx, NULL, NULL, ec->key, piv, enc) <= 0) { in ossl_cms_EncryptedContent_init_bio()
195 OPENSSL_clear_free(ec->key, ec->keylen); in ossl_cms_EncryptedContent_init_bio()
196 ec->key = NULL; in ossl_cms_EncryptedContent_init_bio()
205 int ossl_cms_EncryptedContent_init(CMS_EncryptedContentInfo *ec, in ossl_cms_EncryptedContent_init() argument
210 ec->cipher = cipher; in ossl_cms_EncryptedContent_init()
212 if ((ec->key = OPENSSL_malloc(keylen)) == NULL) in ossl_cms_EncryptedContent_init()
214 memcpy(ec->key, key, keylen); in ossl_cms_EncryptedContent_init()
216 ec->keylen = keylen; in ossl_cms_EncryptedContent_init()
218 ec->contentType = OBJ_nid2obj(NID_pkcs7_data); in ossl_cms_EncryptedContent_init()
225 CMS_EncryptedContentInfo *ec; in CMS_EncryptedData_set1_key() local
243 ec = cms->d.encryptedData->encryptedContentInfo; in CMS_EncryptedData_set1_key()
244 return ossl_cms_EncryptedContent_init(ec, ciph, key, keylen, in CMS_EncryptedData_set1_key()