Lines Matching refs:ek
113 unsigned char *ek = NULL; in pkcs7_encode_rinfo() local
133 ek = OPENSSL_malloc(eklen); in pkcs7_encode_rinfo()
135 if (ek == NULL) { in pkcs7_encode_rinfo()
140 if (EVP_PKEY_encrypt(pctx, ek, &eklen, key, keylen) <= 0) in pkcs7_encode_rinfo()
143 ASN1_STRING_set0(ri->enc_key, ek, eklen); in pkcs7_encode_rinfo()
144 ek = NULL; in pkcs7_encode_rinfo()
150 OPENSSL_free(ek); in pkcs7_encode_rinfo()
160 unsigned char *ek = NULL; in pkcs7_decrypt_rinfo() local
177 ek = OPENSSL_malloc(eklen); in pkcs7_decrypt_rinfo()
179 if (ek == NULL) { in pkcs7_decrypt_rinfo()
184 if (EVP_PKEY_decrypt(pctx, ek, &eklen, in pkcs7_decrypt_rinfo()
196 *pek = ek; in pkcs7_decrypt_rinfo()
202 OPENSSL_free(ek); in pkcs7_decrypt_rinfo()
410 unsigned char *ek = NULL, *tkey = NULL; in PKCS7_dataDecode() local
582 if (pkcs7_decrypt_rinfo(&ek, &eklen, ri, pkey, in PKCS7_dataDecode()
590 if (pkcs7_decrypt_rinfo(&ek, &eklen, ri, pkey, 0) < 0) in PKCS7_dataDecode()
611 if (ek == NULL) { in PKCS7_dataDecode()
612 ek = tkey; in PKCS7_dataDecode()
625 OPENSSL_clear_free(ek, eklen); in PKCS7_dataDecode()
626 ek = tkey; in PKCS7_dataDecode()
633 if (EVP_CipherInit_ex(evp_ctx, NULL, NULL, ek, NULL, 0) <= 0) in PKCS7_dataDecode()
636 OPENSSL_clear_free(ek, eklen); in PKCS7_dataDecode()
637 ek = NULL; in PKCS7_dataDecode()
668 OPENSSL_clear_free(ek, eklen); in PKCS7_dataDecode()