Lines Matching refs:ek
151 unsigned char *ek = NULL; in pkcs7_encode_rinfo() local
171 ek = OPENSSL_malloc(eklen); in pkcs7_encode_rinfo()
172 if (ek == NULL) in pkcs7_encode_rinfo()
175 if (EVP_PKEY_encrypt(pctx, ek, &eklen, key, keylen) <= 0) in pkcs7_encode_rinfo()
178 ASN1_STRING_set0(ri->enc_key, ek, eklen); in pkcs7_encode_rinfo()
179 ek = NULL; in pkcs7_encode_rinfo()
185 OPENSSL_free(ek); in pkcs7_encode_rinfo()
195 unsigned char *ek = NULL; in pkcs7_decrypt_rinfo() local
215 ret = evp_pkey_decrypt_alloc(pctx, &ek, &eklen, fixlen, in pkcs7_decrypt_rinfo()
223 *pek = ek; in pkcs7_decrypt_rinfo()
229 OPENSSL_free(ek); in pkcs7_decrypt_rinfo()
451 unsigned char *ek = NULL, *tkey = NULL; in PKCS7_dataDecode() local
623 if (pkcs7_decrypt_rinfo(&ek, &eklen, ri, pkey, in PKCS7_dataDecode()
631 if (pkcs7_decrypt_rinfo(&ek, &eklen, ri, pkey, 0) < 0) in PKCS7_dataDecode()
652 if (ek == NULL) { in PKCS7_dataDecode()
653 ek = tkey; in PKCS7_dataDecode()
666 OPENSSL_clear_free(ek, eklen); in PKCS7_dataDecode()
667 ek = tkey; in PKCS7_dataDecode()
674 if (EVP_CipherInit_ex(evp_ctx, NULL, NULL, ek, NULL, 0) <= 0) in PKCS7_dataDecode()
677 OPENSSL_clear_free(ek, eklen); in PKCS7_dataDecode()
678 ek = NULL; in PKCS7_dataDecode()
709 OPENSSL_clear_free(ek, eklen); in PKCS7_dataDecode()