| /crypto/evp/ |
| A D | cmeth_lib.c | 27 if (cipher != NULL) { in EVP_CIPHER_meth_new() 33 return cipher; in EVP_CIPHER_meth_new() 44 if (cipher->prov != NULL) in EVP_CIPHER_meth_dup() 47 if ((to = EVP_CIPHER_meth_new(cipher->nid, cipher->block_size, in EVP_CIPHER_meth_dup() 60 if (cipher == NULL || cipher->origin != EVP_ORIG_METH) in EVP_CIPHER_meth_free() 77 if (cipher->flags != 0) in EVP_CIPHER_meth_set_flags() 80 cipher->flags = flags; in EVP_CIPHER_meth_set_flags() 102 cipher->init = init; in EVP_CIPHER_meth_set_init() 158 cipher->ctrl = ctrl; in EVP_CIPHER_meth_set_ctrl() 168 return cipher->init; in EVP_CIPHER_meth_get_init() [all …]
|
| A D | evp_enc.c | 38 if (ctx->cipher == NULL || ctx->cipher->prov == NULL) in OSSL_SAFE_MATH_SIGNED() 117 if (cipher == NULL && ctx->cipher == NULL) { in evp_cipher_init_internal() 134 && (cipher == NULL || cipher->nid == ctx->cipher->nid)) in evp_cipher_init_internal() 164 if (cipher != NULL && ctx->cipher != NULL) { in evp_cipher_init_internal() 174 if (cipher != NULL && ctx->cipher != NULL) { in evp_cipher_init_internal() 184 cipher = ctx->cipher; in evp_cipher_init_internal() 221 ctx->cipher = cipher; in evp_cipher_init_internal() 386 ctx->cipher = cipher; in evp_cipher_init_internal() 536 cipher = ctx->cipher; in evp_cipher_init_skey_internal() 553 ctx->cipher = cipher; in evp_cipher_init_skey_internal() [all …]
|
| A D | asymcipher.c | 116 cipher = in evp_pkey_asym_cipher_init() 155 ctx->op.ciph.cipher = cipher; in evp_pkey_asym_cipher_init() 156 ctx->op.ciph.algctx = cipher->newctx(ossl_provider_ctx(cipher->prov)); in evp_pkey_asym_cipher_init() 163 desc = cipher->description != NULL ? cipher->description : ""; in evp_pkey_asym_cipher_init() 262 cipher = ctx->op.ciph.cipher; in EVP_PKEY_encrypt() 263 desc = cipher->description != NULL ? cipher->description : ""; in EVP_PKEY_encrypt() 312 cipher = ctx->op.ciph.cipher; in EVP_PKEY_decrypt() 313 desc = cipher->description != NULL ? cipher->description : ""; in EVP_PKEY_decrypt() 366 return cipher; in evp_asym_cipher_new() 480 return cipher; in evp_asym_cipher_from_algorithm() [all …]
|
| A D | evp_lib.c | 90 cipher = c->cipher; in evp_cipher_param_to_asn1_ex() 161 cipher = c->cipher; in evp_cipher_asn1_to_param_ex() 374 return (cipher == NULL) ? 0 : cipher->block_size; in EVP_CIPHER_get_block_size() 432 return ctx->cipher; in EVP_CIPHER_CTX_cipher() 449 cipher = (EVP_CIPHER *)ctx->cipher; in EVP_CIPHER_CTX_get1_cipher() 452 return cipher; in EVP_CIPHER_CTX_get1_cipher() 462 return cipher == NULL ? 0 : cipher->flags; in EVP_CIPHER_get_flags() 492 return (cipher == NULL) ? 0 : cipher->iv_len; in EVP_CIPHER_get_iv_length() 677 return (cipher == NULL) ? NID_undef : cipher->nid; in EVP_CIPHER_get_nid() 690 return evp_is_a(cipher->prov, cipher->name_id, NULL, name); in EVP_CIPHER_is_a() [all …]
|
| A D | bio_enc.c | 35 EVP_CIPHER_CTX *cipher; member 71 ctx->cipher = EVP_CIPHER_CTX_new(); in enc_new() 72 if (ctx->cipher == NULL) { in enc_new() 96 EVP_CIPHER_CTX_free(b->cipher); in enc_free() 182 if (!EVP_CipherUpdate(ctx->cipher, in enc_read() 200 if (!EVP_CipherUpdate(ctx->cipher, in enc_read() 269 if (!EVP_CipherUpdate(ctx->cipher, in enc_write() 380 *c_ctx = ctx->cipher; in enc_ctrl() 386 dctx->cipher = EVP_CIPHER_CTX_new(); in enc_ctrl() 387 if (dctx->cipher == NULL) in enc_ctrl() [all …]
|
| A D | p5_crpt.c | 27 ASN1_TYPE *param, const EVP_CIPHER *cipher, in PKCS5_PBE_keyivgen_ex() argument 57 ivl = EVP_CIPHER_get_iv_length(cipher); in PKCS5_PBE_keyivgen_ex() 62 kl = EVP_CIPHER_get_key_length(cipher); in PKCS5_PBE_keyivgen_ex() 101 if (!EVP_CipherInit_ex(cctx, cipher, NULL, key, iv, en_de)) in PKCS5_PBE_keyivgen_ex() 114 ASN1_TYPE *param, const EVP_CIPHER *cipher, in PKCS5_PBE_keyivgen() argument 117 return PKCS5_PBE_keyivgen_ex(cctx, pass, passlen, param, cipher, md, en_de, in PKCS5_PBE_keyivgen()
|
| A D | evp_pbe.c | 101 const EVP_CIPHER *cipher = NULL; in EVP_PBE_CipherInit_ex() local 129 cipher = cipher_fetch = EVP_CIPHER_fetch(libctx, OBJ_nid2sn(cipher_nid), propq); in EVP_PBE_CipherInit_ex() 131 if (cipher == NULL) in EVP_PBE_CipherInit_ex() 132 cipher = EVP_get_cipherbynid(cipher_nid); in EVP_PBE_CipherInit_ex() 133 if (cipher == NULL) { in EVP_PBE_CipherInit_ex() 159 ret = keygen_ex(ctx, pass, passlen, param, cipher, md, en_de, libctx, propq); in EVP_PBE_CipherInit_ex() 161 ret = keygen(ctx, pass, passlen, param, cipher, md, en_de); in EVP_PBE_CipherInit_ex() 233 int EVP_PBE_alg_add(int nid, const EVP_CIPHER *cipher, const EVP_MD *md, in EVP_PBE_alg_add() argument 238 if (cipher) in EVP_PBE_alg_add() 239 cipher_nid = EVP_CIPHER_get_nid(cipher); in EVP_PBE_alg_add()
|
| A D | p5_crpt2.c | 119 const EVP_CIPHER *cipher = NULL; in PKCS5_v2_PBE_keyivgen_ex() local 147 cipher = cipher_fetch = EVP_CIPHER_fetch(libctx, ciph_name, propq); in PKCS5_v2_PBE_keyivgen_ex() 149 if (cipher == NULL) in PKCS5_v2_PBE_keyivgen_ex() 150 cipher = EVP_get_cipherbyname(ciph_name); in PKCS5_v2_PBE_keyivgen_ex() 152 if (cipher == NULL) { in PKCS5_v2_PBE_keyivgen_ex() 160 if (!EVP_CipherInit_ex(ctx, cipher, NULL, NULL, NULL, en_de)) in PKCS5_v2_PBE_keyivgen_ex()
|
| A D | p_seal.c | 27 const EVP_CIPHER *cipher; in EVP_SealInit() local 36 if ((cipher = EVP_CIPHER_CTX_get0_cipher(ctx)) != NULL in EVP_SealInit() 37 && (prov = EVP_CIPHER_get0_provider(cipher)) != NULL) in EVP_SealInit()
|
| A D | pmeth_lib.c | 382 EVP_ASYM_CIPHER_free(ctx->op.ciph.cipher); in evp_pkey_ctx_free_old_ops() 384 ctx->op.ciph.cipher = NULL; in evp_pkey_ctx_free_old_ops() 532 if (pctx->op.ciph.cipher != NULL) { in EVP_PKEY_CTX_dup() 533 rctx->op.ciph.cipher = pctx->op.ciph.cipher; in EVP_PKEY_CTX_dup() 541 if (pctx->op.ciph.cipher->dupctx != NULL) in EVP_PKEY_CTX_dup() 547 rctx->op.ciph.cipher = NULL; in EVP_PKEY_CTX_dup() 695 && ctx->op.ciph.cipher != NULL in EVP_PKEY_CTX_set_params() 740 && ctx->op.ciph.cipher != NULL in EVP_PKEY_CTX_get_params() 789 && ctx->op.ciph.cipher != NULL in EVP_PKEY_CTX_gettable_params() 833 && ctx->op.ciph.cipher != NULL in EVP_PKEY_CTX_settable_params() [all …]
|
| /crypto/engine/ |
| A D | eng_openssl.c | 234 EVP_CIPHER *cipher; in test_r4_cipher() local 243 cipher = NULL; in test_r4_cipher() 245 r4_cipher = cipher; in test_r4_cipher() 259 EVP_CIPHER *cipher; in test_r4_40_cipher() local 268 cipher = NULL; in test_r4_40_cipher() 270 r4_40_cipher = cipher; in test_r4_40_cipher() 286 const EVP_CIPHER *cipher; in test_cipher_nids() local 301 if (!cipher) { in openssl_ciphers() 307 *cipher = test_r4_cipher(); in openssl_ciphers() 309 *cipher = test_r4_40_cipher(); in openssl_ciphers() [all …]
|
| A D | README.md | 18 identifier that, in the current API, "lingers". These cipher description + 25 const EVP_CIPHER *cipher = EVP_des_cbc(); 26 EVP_EncryptInit(&ctx, cipher, key, iv); 31 cipher = EVP_get_cipherbyname("des_cbc"); 32 EVP_EncryptInit(&ctx, cipher, key, iv); 36 looked up based on other identifiers which can be useful for automatic cipher 50 ciphers simultaneously registers cipher *types* and cipher *implementations* - 59 Another sticking point for integrating cipher support into ENGINE is linkage. 93 cipher-specific ENGINE code is asked for an ENGINE pointer (a functional 96 ENGINE code will return NULL because no ENGINEs will have had any cipher [all …]
|
| /crypto/cms/ |
| A D | cms_enc.c | 31 const EVP_CIPHER *cipher = NULL; in ossl_cms_EncryptedContent_init_bio() local 44 enc = ec->cipher ? 1 : 0; in ossl_cms_EncryptedContent_init_bio() 56 cipher = ec->cipher; in ossl_cms_EncryptedContent_init_bio() 61 ec->cipher = NULL; in ossl_cms_EncryptedContent_init_bio() 63 cipher = EVP_get_cipherbyobj(calg->algorithm); in ossl_cms_EncryptedContent_init_bio() 65 if (cipher != NULL) { in ossl_cms_EncryptedContent_init_bio() 69 cipher = fetched_ciph; in ossl_cms_EncryptedContent_init_bio() 71 if (cipher == NULL) { in ossl_cms_EncryptedContent_init_bio() 206 const EVP_CIPHER *cipher, in ossl_cms_EncryptedContent_init() argument 210 ec->cipher = cipher; in ossl_cms_EncryptedContent_init() [all …]
|
| A D | cms_env.c | 603 const EVP_CIPHER *cipher = NULL; in cms_RecipientInfo_ktri_decrypt() local 631 if (cipher == NULL) { in cms_RecipientInfo_ktri_decrypt() 902 EVP_CIPHER *cipher = NULL; in cms_RecipientInfo_kekri_encrypt() local 919 if (cipher == NULL) { in cms_RecipientInfo_kekri_encrypt() 953 EVP_CIPHER_free(cipher); in cms_RecipientInfo_kekri_encrypt() 971 EVP_CIPHER *cipher = NULL; in cms_RecipientInfo_kekri_decrypt() local 1001 if (cipher == NULL) { in cms_RecipientInfo_kekri_decrypt() 1033 EVP_CIPHER_free(cipher); in cms_RecipientInfo_kekri_decrypt() 1166 ec->cipher = NULL; in cms_env_clear_ec() 1260 if (ec->cipher == NULL) { in ossl_cms_AuthEnvelopedData_init_bio() [all …]
|
| A D | cms_smime.c | 224 CMS_ContentInfo *CMS_EncryptedData_encrypt_ex(BIO *in, const EVP_CIPHER *cipher, in CMS_EncryptedData_encrypt_ex() argument 232 if (cipher == NULL) { in CMS_EncryptedData_encrypt_ex() 239 if (!CMS_EncryptedData_set1_key(cms, cipher, key, keylen)) in CMS_EncryptedData_encrypt_ex() 254 CMS_ContentInfo *CMS_EncryptedData_encrypt(BIO *in, const EVP_CIPHER *cipher, in CMS_EncryptedData_encrypt() argument 258 return CMS_EncryptedData_encrypt_ex(in, cipher, key, keylen, flags, NULL, in CMS_EncryptedData_encrypt() 641 const EVP_CIPHER *cipher, unsigned int flags, in CMS_encrypt_ex() argument 649 cms = (EVP_CIPHER_get_flags(cipher) & EVP_CIPH_FLAG_AEAD_CIPHER) in CMS_encrypt_ex() 650 ? CMS_AuthEnvelopedData_create_ex(cipher, libctx, propq) in CMS_encrypt_ex() 651 : CMS_EnvelopedData_create_ex(cipher, libctx, propq); in CMS_encrypt_ex() 679 const EVP_CIPHER *cipher, unsigned int flags) in CMS_encrypt() argument [all …]
|
| /crypto/pkcs12/ |
| A D | p12_crpt.c | 24 ASN1_TYPE *param, const EVP_CIPHER *cipher, in PKCS12_PBE_keyivgen_ex() argument 34 if (cipher == NULL) in PKCS12_PBE_keyivgen_ex() 52 iter, EVP_CIPHER_get_key_length(cipher), in PKCS12_PBE_keyivgen_ex() 59 if (EVP_CIPHER_get_iv_length(cipher) > 0) { in PKCS12_PBE_keyivgen_ex() 61 iter, EVP_CIPHER_get_iv_length(cipher), in PKCS12_PBE_keyivgen_ex() 72 ret = EVP_CipherInit_ex(ctx, cipher, NULL, key, piv, en_de); in PKCS12_PBE_keyivgen_ex() 79 ASN1_TYPE *param, const EVP_CIPHER *cipher, in PKCS12_PBE_keyivgen() argument 82 return PKCS12_PBE_keyivgen_ex(ctx, pass, passlen, param, cipher, md, en_de, in PKCS12_PBE_keyivgen()
|
| A D | p12_p8e.c | 16 X509_SIG *PKCS8_encrypt_ex(int pbe_nid, const EVP_CIPHER *cipher, in PKCS8_encrypt_ex() argument 26 if (cipher == NULL) { in PKCS8_encrypt_ex() 30 pbe = PKCS5_pbe2_set_iv_ex(cipher, iter, salt, saltlen, NULL, -1, in PKCS8_encrypt_ex() 36 if (cipher == NULL) { in PKCS8_encrypt_ex() 40 pbe = PKCS5_pbe2_set_iv_ex(cipher, iter, salt, saltlen, NULL, in PKCS8_encrypt_ex() 60 X509_SIG *PKCS8_encrypt(int pbe_nid, const EVP_CIPHER *cipher, in PKCS8_encrypt() argument 65 return PKCS8_encrypt_ex(pbe_nid, cipher, pass, passlen, salt, saltlen, iter, in PKCS8_encrypt()
|
| A D | p12_npas.c | 159 EVP_CIPHER *cipher = NULL; in newpass_bag() local 177 cipher = EVP_CIPHER_fetch(libctx, OBJ_nid2sn(cipherid), propq); in newpass_bag() 178 if (cipher == NULL) { in newpass_bag() 183 p8new = PKCS8_encrypt_ex(p8_nid, cipher, newpass, -1, NULL, p8_saltlen, in newpass_bag() 186 EVP_CIPHER_free(cipher); in newpass_bag()
|
| /crypto/asn1/ |
| A D | p5_pbev2.c | 51 X509_ALGOR *PKCS5_pbe2_set_iv_ex(const EVP_CIPHER *cipher, int iter, 62 alg_nid = EVP_CIPHER_get_type(cipher); 82 ivlen = EVP_CIPHER_get_iv_length(cipher); 97 if (!EVP_CipherInit_ex(ctx, cipher, NULL, NULL, iv, 0)) 119 keylen = EVP_CIPHER_get_key_length(cipher); 166 X509_ALGOR *PKCS5_pbe2_set_iv(const EVP_CIPHER *cipher, int iter, in PKCS5_pbe2_set_iv() argument 170 return PKCS5_pbe2_set_iv_ex(cipher, iter, salt, saltlen, aiv, prf_nid, in PKCS5_pbe2_set_iv() 174 X509_ALGOR *PKCS5_pbe2_set(const EVP_CIPHER *cipher, int iter, in PKCS5_pbe2_set() argument 177 return PKCS5_pbe2_set_iv_ex(cipher, iter, salt, saltlen, NULL, -1, in PKCS5_pbe2_set()
|
| A D | p5_scrypt.c | 41 X509_ALGOR *PKCS5_pbe2_set_scrypt(const EVP_CIPHER *cipher, in PKCS5_pbe2_set_scrypt() argument 53 if (!cipher) { in PKCS5_pbe2_set_scrypt() 63 alg_nid = EVP_CIPHER_get_type(cipher); in PKCS5_pbe2_set_scrypt() 86 if (EVP_CIPHER_get_iv_length(cipher)) { in PKCS5_pbe2_set_scrypt() 88 memcpy(iv, aiv, EVP_CIPHER_get_iv_length(cipher)); in PKCS5_pbe2_set_scrypt() 89 else if (RAND_bytes(iv, EVP_CIPHER_get_iv_length(cipher)) <= 0) in PKCS5_pbe2_set_scrypt() 100 if (EVP_CipherInit_ex(ctx, cipher, NULL, NULL, iv, 0) == 0) in PKCS5_pbe2_set_scrypt() 112 keylen = EVP_CIPHER_get_key_length(cipher); in PKCS5_pbe2_set_scrypt()
|
| /crypto/pem/ |
| A D | pem_lib.c | 249 EVP_CIPHER_INFO cipher; in pem_bytes_read_bio_flags() local 265 if (!PEM_get_EVP_CIPHER_INFO(header, &cipher)) in pem_bytes_read_bio_flags() 267 if (!PEM_do_header(&cipher, data, &len, cb, u)) in pem_bytes_read_bio_flags() 464 if (cipher->cipher == NULL) in PEM_do_header() 479 if (!EVP_BytesToKey(cipher->cipher, EVP_md5(), &(cipher->iv[0]), in PEM_do_header() 487 ok = EVP_DecryptInit_ex(ctx, cipher->cipher, NULL, key, &(cipher->iv[0])); in PEM_do_header() 521 int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher) in PEM_get_EVP_CIPHER_INFO() argument 527 cipher->cipher = NULL; in PEM_get_EVP_CIPHER_INFO() 528 memset(cipher->iv, 0, sizeof(cipher->iv)); in PEM_get_EVP_CIPHER_INFO() 572 cipher->cipher = enc = EVP_get_cipherbyname(dekinfostart); in PEM_get_EVP_CIPHER_INFO() [all …]
|
| A D | pem_info.c | 155 EVP_CIPHER_INFO cipher; in STACK_OF() local 157 if (!PEM_get_EVP_CIPHER_INFO(header, &cipher)) in STACK_OF() 159 if (!PEM_do_header(&cipher, data, &len, cb, u)) in STACK_OF() 270 objstr = EVP_CIPHER_get0_name(xi->enc_cipher.cipher); in PEM_X509_INFO_write_bio()
|
| /crypto/cmac/ |
| A D | cmac.c | 112 const EVP_CIPHER *cipher, ENGINE *impl, in ossl_cmac_init() argument 119 if (!key && !cipher && !impl && keylen == 0) { in ossl_cmac_init() 133 if (cipher != NULL) { in ossl_cmac_init() 137 if (!EVP_EncryptInit_ex(ctx->cctx, cipher, impl, NULL, NULL)) in ossl_cmac_init() 140 if (!EVP_EncryptInit_ex2(ctx->cctx, cipher, NULL, NULL, param)) in ossl_cmac_init() 175 const EVP_CIPHER *cipher, ENGINE *impl) in CMAC_Init() argument 177 return ossl_cmac_init(ctx, key, keylen, cipher, impl, NULL); in CMAC_Init()
|
| /crypto/crmf/ |
| A D | crmf_lib.c | 765 EVP_CIPHER *cipher = NULL; /* used cipher */ in OSSL_CRMF_ENCRYPTEDVALUE_decrypt() local 787 cipher = EVP_CIPHER_fetch(libctx, name, propq); in OSSL_CRMF_ENCRYPTEDVALUE_decrypt() 788 if (cipher == NULL) in OSSL_CRMF_ENCRYPTEDVALUE_decrypt() 790 if (cipher == NULL) { in OSSL_CRMF_ENCRYPTEDVALUE_decrypt() 797 cikeysize = EVP_CIPHER_get_key_length(cipher); in OSSL_CRMF_ENCRYPTEDVALUE_decrypt() 821 if ((iv = OPENSSL_malloc(EVP_CIPHER_get_iv_length(cipher))) == NULL) in OSSL_CRMF_ENCRYPTEDVALUE_decrypt() 824 EVP_CIPHER_get_iv_length(cipher)) in OSSL_CRMF_ENCRYPTEDVALUE_decrypt() 825 != EVP_CIPHER_get_iv_length(cipher)) { in OSSL_CRMF_ENCRYPTEDVALUE_decrypt() 831 EVP_CIPHER_get_block_size(cipher))) == NULL in OSSL_CRMF_ENCRYPTEDVALUE_decrypt() 836 if (!EVP_DecryptInit(evp_ctx, cipher, ek, iv) in OSSL_CRMF_ENCRYPTEDVALUE_decrypt() [all …]
|
| /crypto/pkcs7/ |
| A D | pk7_doit.c | 240 const EVP_CIPHER *cipher; in PKCS7_dataInit() local 343 cipher = fetched_cipher; in PKCS7_dataInit() 345 cipher = evp_cipher; in PKCS7_dataInit() 448 const EVP_CIPHER *cipher = NULL; in PKCS7_dataDecode() local 505 cipher = evp_cipher; in PKCS7_dataDecode() 507 cipher = EVP_get_cipherbyname(name); in PKCS7_dataDecode() 509 if (cipher == NULL) { in PKCS7_dataDecode() 526 cipher = evp_cipher; in PKCS7_dataDecode() 528 cipher = EVP_get_cipherbyname(name); in PKCS7_dataDecode() 530 if (cipher == NULL) { in PKCS7_dataDecode() [all …]
|