Lines Matching refs:ek
146 unsigned char *ek = NULL; in pkcs7_encode_rinfo() local
172 ek = OPENSSL_malloc(eklen); in pkcs7_encode_rinfo()
174 if (ek == NULL) in pkcs7_encode_rinfo()
180 if (EVP_PKEY_encrypt(pctx, ek, &eklen, key, keylen) <= 0) in pkcs7_encode_rinfo()
183 ASN1_STRING_set0(ri->enc_key, ek, eklen); in pkcs7_encode_rinfo()
184 ek = NULL; in pkcs7_encode_rinfo()
193 if (ek) in pkcs7_encode_rinfo()
194 OPENSSL_free(ek); in pkcs7_encode_rinfo()
204 unsigned char *ek = NULL; in pkcs7_decrypt_rinfo() local
227 ek = OPENSSL_malloc(eklen); in pkcs7_decrypt_rinfo()
229 if (ek == NULL) in pkcs7_decrypt_rinfo()
235 if (EVP_PKEY_decrypt(pctx, ek, &eklen, in pkcs7_decrypt_rinfo()
251 *pek = ek; in pkcs7_decrypt_rinfo()
257 if (!ret && ek) in pkcs7_decrypt_rinfo()
258 OPENSSL_free(ek); in pkcs7_decrypt_rinfo()
433 unsigned char *ek = NULL, *tkey = NULL; in PKCS7_dataDecode() local
559 if (pkcs7_decrypt_rinfo(&ek, &eklen, in PKCS7_dataDecode()
568 if (pkcs7_decrypt_rinfo(&ek, &eklen, ri, pkey) < 0) in PKCS7_dataDecode()
586 if (ek == NULL) in PKCS7_dataDecode()
588 ek = tkey; in PKCS7_dataDecode()
601 OPENSSL_cleanse(ek, eklen); in PKCS7_dataDecode()
602 OPENSSL_free(ek); in PKCS7_dataDecode()
603 ek = tkey; in PKCS7_dataDecode()
610 if (EVP_CipherInit_ex(evp_ctx,NULL,NULL,ek,NULL,0) <= 0) in PKCS7_dataDecode()
613 if (ek) in PKCS7_dataDecode()
615 OPENSSL_cleanse(ek,eklen); in PKCS7_dataDecode()
616 OPENSSL_free(ek); in PKCS7_dataDecode()
617 ek = NULL; in PKCS7_dataDecode()
666 if (ek) in PKCS7_dataDecode()
668 OPENSSL_cleanse(ek,eklen); in PKCS7_dataDecode()
669 OPENSSL_free(ek); in PKCS7_dataDecode()