Lines Matching refs:cipher_ctx

6390 		zend_bool *free_iv, EVP_CIPHER_CTX *cipher_ctx, struct php_openssl_cipher_mode *mode) /* {{{ */  in php_openssl_validate_iv()  argument
6395 if (EVP_CIPHER_CTX_ctrl(cipher_ctx, mode->aead_ivlen_flag, *piv_len, NULL) != 1) { in php_openssl_validate_iv()
6442 EVP_CIPHER_CTX *cipher_ctx, struct php_openssl_cipher_mode *mode, in php_openssl_cipher_init() argument
6459 if (!EVP_CipherInit_ex(cipher_ctx, cipher_type, NULL, NULL, NULL, enc)) { in php_openssl_cipher_init()
6463 if (php_openssl_validate_iv(piv, piv_len, max_iv_len, free_iv, cipher_ctx, mode) == FAILURE) { in php_openssl_cipher_init()
6467 if (!EVP_CIPHER_CTX_ctrl(cipher_ctx, mode->aead_set_tag_flag, tag_len, NULL)) { in php_openssl_cipher_init()
6474 …} else if (!EVP_CIPHER_CTX_ctrl(cipher_ctx, mode->aead_set_tag_flag, tag_len, (unsigned char *) ta… in php_openssl_cipher_init()
6483 …if ((OPENSSL_DONT_ZERO_PAD_KEY & options) && !EVP_CIPHER_CTX_set_key_length(cipher_ctx, password_l… in php_openssl_cipher_init()
6495 if (password_len > key_len && !EVP_CIPHER_CTX_set_key_length(cipher_ctx, password_len)) { in php_openssl_cipher_init()
6501 if (!EVP_CipherInit_ex(cipher_ctx, NULL, NULL, key, (unsigned char *)*piv, enc)) { in php_openssl_cipher_init()
6506 EVP_CIPHER_CTX_set_padding(cipher_ctx, 0); in php_openssl_cipher_init()
6514 EVP_CIPHER_CTX *cipher_ctx, struct php_openssl_cipher_mode *mode, in php_openssl_cipher_update() argument
6520 if (mode->is_single_run_aead && !EVP_CipherUpdate(cipher_ctx, NULL, &i, NULL, (int)data_len)) { in php_openssl_cipher_update()
6526 if (mode->is_aead && !EVP_CipherUpdate(cipher_ctx, NULL, &i, (unsigned char *)aad, (int)aad_len)) { in php_openssl_cipher_update()
6534 if (!EVP_CipherUpdate(cipher_ctx, (unsigned char*)ZSTR_VAL(*poutbuf), in php_openssl_cipher_update()
6563 EVP_CIPHER_CTX *cipher_ctx; in PHP_FUNCTION() local
6585 cipher_ctx = EVP_CIPHER_CTX_new(); in PHP_FUNCTION()
6586 if (!cipher_ctx) { in PHP_FUNCTION()
6592 if (php_openssl_cipher_init(cipher_type, cipher_ctx, &mode, in PHP_FUNCTION()
6595 php_openssl_cipher_update(cipher_type, cipher_ctx, &mode, &outbuf, &outlen, in PHP_FUNCTION()
6598 } else if (EVP_EncryptFinal(cipher_ctx, (unsigned char *)ZSTR_VAL(outbuf) + outlen, &i)) { in PHP_FUNCTION()
6615 if (EVP_CIPHER_CTX_ctrl(cipher_ctx, mode.aead_get_tag_flag, tag_len, ZSTR_VAL(tag_str)) == 1) { in PHP_FUNCTION()
6648 EVP_CIPHER_CTX_cleanup(cipher_ctx); in PHP_FUNCTION()
6649 EVP_CIPHER_CTX_free(cipher_ctx); in PHP_FUNCTION()
6661 EVP_CIPHER_CTX *cipher_ctx; in PHP_FUNCTION() local
6689 cipher_ctx = EVP_CIPHER_CTX_new(); in PHP_FUNCTION()
6690 if (!cipher_ctx) { in PHP_FUNCTION()
6701 EVP_CIPHER_CTX_free(cipher_ctx); in PHP_FUNCTION()
6708 if (php_openssl_cipher_init(cipher_type, cipher_ctx, &mode, in PHP_FUNCTION()
6711 php_openssl_cipher_update(cipher_type, cipher_ctx, &mode, &outbuf, &outlen, in PHP_FUNCTION()
6715 EVP_DecryptFinal(cipher_ctx, (unsigned char *)ZSTR_VAL(outbuf) + outlen, &i)) { in PHP_FUNCTION()
6735 EVP_CIPHER_CTX_cleanup(cipher_ctx); in PHP_FUNCTION()
6736 EVP_CIPHER_CTX_free(cipher_ctx); in PHP_FUNCTION()