Lines Matching refs:NULL
454 NULL,
455 NULL,
482 assert(pkey != NULL); in php_pkey_free()
503 if (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) { in php_openssl_safe_mode_chk()
557 ASN1_STRING * str = NULL; in add_assoc_name_entry()
560 if (key != NULL) { in add_assoc_name_entry()
620 if (key != NULL) { in add_assoc_name_entry()
621 zend_hash_update(HASH_OF(val), key, strlen(key) + 1, (void *)&subitem, sizeof(subitem), NULL); in add_assoc_name_entry()
648 php_error_docref(NULL TSRMLS_CC, E_WARNING, "illegal ASN1 data type for timestamp"); in asn1_time_to_time_t()
653 php_error_docref(NULL TSRMLS_CC, E_WARNING, "illegal length in timestamp"); in asn1_time_to_time_t()
658 …php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to parse time string %s correctly", timestr->d… in asn1_time_to_time_t()
722 if (!X509V3_EXT_add_conf(config, &ctx, (char *)section, NULL)) { in php_openssl_config_check_syntax()
723 php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error loading %s section %s of %s", in php_openssl_config_check_syntax()
740 str = CONF_get_string(req->req_config, NULL, "oid_section"); in add_oid_section()
741 if (str == NULL) { in add_oid_section()
745 if (sktmp == NULL) { in add_oid_section()
746 php_error_docref(NULL TSRMLS_CC, E_WARNING, "problem loading oid section %s", str); in add_oid_section()
752 …php_error_docref(NULL TSRMLS_CC, E_WARNING, "problem creating object %s=%s", cnf->name, cnf->value… in add_oid_section()
786 req->global_config = CONF_load(NULL, default_ssl_conf_filename, NULL); in php_openssl_parse_config()
787 req->req_config = CONF_load(NULL, req->config_filename, NULL); in php_openssl_parse_config()
789 if (req->req_config == NULL) { in php_openssl_parse_config()
794 str = CONF_get_string(req->req_config, NULL, "oid_file"); in php_openssl_parse_config()
820 if (str == NULL) { in php_openssl_parse_config()
831 if (req->digest_name == NULL) { in php_openssl_parse_config()
837 if (req->md_alg == NULL) { in php_openssl_parse_config()
846 php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid global string mask setting %s", str); in php_openssl_parse_config()
860 req->priv_key = NULL; in php_openssl_dispose_config()
864 req->global_config = NULL; in php_openssl_dispose_config()
868 req->req_config = NULL; in php_openssl_dispose_config()
882 if (file == NULL) { in php_openssl_load_rand_file()
890 if (file == NULL || !RAND_load_file(file, -1)) { in php_openssl_load_rand_file()
892 …php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to load random state; not enough random data!"… in php_openssl_load_rand_file()
913 if (file == NULL) { in php_openssl_write_rand_file()
916 if (file == NULL || !RAND_write_file(file)) { in php_openssl_write_rand_file()
917 php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to write random state"); in php_openssl_write_rand_file()
946 return NULL; in php_openssl_get_evp_md_from_algo()
976 return NULL; in php_openssl_get_evp_cipher_from_algo()
988 le_key = zend_register_list_destructors_ex(php_pkey_free, NULL, "OpenSSL key", module_number); in PHP_MINIT_FUNCTION()
989 le_x509 = zend_register_list_destructors_ex(php_x509_free, NULL, "OpenSSL X.509", module_number); in PHP_MINIT_FUNCTION()
990 le_csr = zend_register_list_destructors_ex(php_csr_free, NULL, "OpenSSL X.509 CSR", module_number); in PHP_MINIT_FUNCTION()
1003 ssl_stream_data_index = SSL_get_ex_new_index(0, "PHP stream index", NULL, NULL, NULL); in PHP_MINIT_FUNCTION()
1072 if (config_filename == NULL) { in PHP_MINIT_FUNCTION()
1077 if (config_filename == NULL) { in PHP_MINIT_FUNCTION()
1150 X509 *cert = NULL; in php_openssl_x509_from_zval()
1162 return NULL; in php_openssl_x509_from_zval()
1173 return NULL; in php_openssl_x509_from_zval()
1177 return NULL; in php_openssl_x509_from_zval()
1188 return NULL; in php_openssl_x509_from_zval()
1192 if (in == NULL) { in php_openssl_x509_from_zval()
1193 return NULL; in php_openssl_x509_from_zval()
1195 cert = PEM_read_bio_X509(in, NULL, NULL, NULL); in php_openssl_x509_from_zval()
1201 if (in == NULL) { in php_openssl_x509_from_zval()
1202 return NULL; in php_openssl_x509_from_zval()
1205 cert = (X509 *) PEM_ASN1_read_bio((d2i_of_void *)d2i_X509, PEM_STRING_X509, in, NULL, NULL, NULL); in php_openssl_x509_from_zval()
1207 cert = (X509 *) PEM_ASN1_read_bio((char *(*)())d2i_X509, PEM_STRING_X509, in, NULL, NULL, NULL); in php_openssl_x509_from_zval()
1238 if (cert == NULL) { in PHP_FUNCTION()
1239 php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get cert from parameter 1"); in PHP_FUNCTION()
1256 php_error_docref(NULL TSRMLS_CC, E_WARNING, "error opening file %s", filename); in PHP_FUNCTION()
1281 if (cert == NULL) { in PHP_FUNCTION()
1282 php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get cert from parameter 1"); in PHP_FUNCTION()
1312 X509 * cert = NULL; in PHP_FUNCTION()
1313 EVP_PKEY * key = NULL; in PHP_FUNCTION()
1322 if (cert == NULL) { in PHP_FUNCTION()
1346 const X509V3_EXT_METHOD *method = NULL; in openssl_x509v3_subjectAltName()
1351 if (method == NULL) { in openssl_x509v3_subjectAltName()
1358 names = (GENERAL_NAMES*)(ASN1_item_d2i(NULL, &p, length, in openssl_x509v3_subjectAltName()
1361 names = (GENERAL_NAMES*)(method->d2i(NULL, &p, length)); in openssl_x509v3_subjectAltName()
1363 if (names == NULL) { in openssl_x509v3_subjectAltName()
1412 X509 * cert = NULL; in PHP_FUNCTION()
1428 if (cert == NULL) { in PHP_FUNCTION()
1449 …add_assoc_string(return_value, "serialNumber", i2s_ASN1_INTEGER(NULL, X509_get_serialNumber(cert))… in PHP_FUNCTION()
1457 tmpstr = (char *)X509_alias_get0(cert, NULL); in PHP_FUNCTION()
1545 STACK_OF(X509_INFO) *sk=NULL; in STACK_OF()
1546 STACK_OF(X509) *stack=NULL, *ret=NULL; in STACK_OF()
1547 BIO *in=NULL; in STACK_OF()
1552 php_error_docref(NULL TSRMLS_CC, E_ERROR, "memory allocation failure"); in STACK_OF()
1562 php_error_docref(NULL TSRMLS_CC, E_WARNING, "error opening the file, %s", certfile); in STACK_OF()
1568 if(!(sk=PEM_X509_INFO_read_bio(in, NULL, NULL, NULL))) { in STACK_OF()
1569 php_error_docref(NULL TSRMLS_CC, E_WARNING, "error reading the file, %s", certfile); in STACK_OF()
1577 if (xi->x509 != NULL) { in STACK_OF()
1579 xi->x509=NULL; in STACK_OF()
1584 php_error_docref(NULL TSRMLS_CC, E_WARNING, "no certificates in file, %s", certfile); in STACK_OF()
1605 if (csc == NULL) { in check_cert()
1606 php_error_docref(NULL TSRMLS_CC, E_ERROR, "memory allocation failure"); in check_cert()
1624 zval ** zcert, * zcainfo = NULL; in PHP_FUNCTION()
1625 X509_STORE * cainfo = NULL; in PHP_FUNCTION()
1626 X509 * cert = NULL; in PHP_FUNCTION()
1628 STACK_OF(X509) * untrustedchain = NULL; in PHP_FUNCTION()
1630 char * untrusted = NULL; in PHP_FUNCTION()
1641 if (untrustedchain == NULL) { in PHP_FUNCTION()
1647 if (cainfo == NULL) { in PHP_FUNCTION()
1651 if (cert == NULL) { in PHP_FUNCTION()
1688 if (store == NULL) { in setup_verify()
1689 return NULL; in setup_verify()
1704 php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to stat %s", Z_STRVAL_PP(item)); in setup_verify()
1710 …if (file_lookup == NULL || !X509_LOOKUP_load_file(file_lookup, Z_STRVAL_PP(item), X509_FILETYPE_PE… in setup_verify()
1711 php_error_docref(NULL TSRMLS_CC, E_WARNING, "error loading file %s", Z_STRVAL_PP(item)); in setup_verify()
1715 file_lookup = NULL; in setup_verify()
1718 …if (dir_lookup == NULL || !X509_LOOKUP_add_dir(dir_lookup, Z_STRVAL_PP(item), X509_FILETYPE_PEM)) { in setup_verify()
1719 php_error_docref(NULL TSRMLS_CC, E_WARNING, "error loading directory %s", Z_STRVAL_PP(item)); in setup_verify()
1723 dir_lookup = NULL; in setup_verify()
1730 X509_LOOKUP_load_file(file_lookup, NULL, X509_FILETYPE_DEFAULT); in setup_verify()
1736 X509_LOOKUP_add_dir(dir_lookup, NULL, X509_FILETYPE_DEFAULT); in setup_verify()
1756 if (x509 == NULL) { in PHP_FUNCTION()
1757 …php_error_docref(NULL TSRMLS_CC, E_WARNING, "supplied parameter cannot be coerced into an X509 cer… in PHP_FUNCTION()
1796 STACK_OF(X509) * sk = NULL; in STACK_OF()
1808 if (cert == NULL) { in STACK_OF()
1815 if (cert == NULL) { in STACK_OF()
1828 if (cert == NULL) { in STACK_OF()
1834 if (cert == NULL) { in STACK_OF()
1850 X509 * cert = NULL; in PHP_FUNCTION()
1851 BIO * bio_out = NULL; in PHP_FUNCTION()
1852 PKCS12 * p12 = NULL; in PHP_FUNCTION()
1854 char * friendly_name = NULL; in PHP_FUNCTION()
1858 zval **zcert = NULL, *zpkey = NULL, *args = NULL; in PHP_FUNCTION()
1859 EVP_PKEY *priv_key = NULL; in PHP_FUNCTION()
1862 STACK_OF(X509) *ca = NULL; in PHP_FUNCTION()
1874 if (cert == NULL) { in PHP_FUNCTION()
1875 php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get cert from parameter 1"); in PHP_FUNCTION()
1879 if (priv_key == NULL) { in PHP_FUNCTION()
1880 php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get private key from parameter 3"); in PHP_FUNCTION()
1884 php_error_docref(NULL TSRMLS_CC, E_WARNING, "private key does not correspond to cert"); in PHP_FUNCTION()
1915 php_error_docref(NULL TSRMLS_CC, E_WARNING, "error opening file %s", filename); in PHP_FUNCTION()
1937 X509 * cert = NULL; in PHP_FUNCTION()
1939 PKCS12 * p12 = NULL; in PHP_FUNCTION()
1940 zval * zcert = NULL, *zout = NULL, *zpkey, *args = NULL; in PHP_FUNCTION()
1941 EVP_PKEY *priv_key = NULL; in PHP_FUNCTION()
1945 char * friendly_name = NULL; in PHP_FUNCTION()
1947 STACK_OF(X509) *ca = NULL; in PHP_FUNCTION()
1955 if (cert == NULL) { in PHP_FUNCTION()
1956 php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get cert from parameter 1"); in PHP_FUNCTION()
1960 if (priv_key == NULL) { in PHP_FUNCTION()
1961 php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get private key from parameter 3"); in PHP_FUNCTION()
1965 php_error_docref(NULL TSRMLS_CC, E_WARNING, "private key does not correspond to cert"); in PHP_FUNCTION()
2009 zval *zout = NULL, *zextracerts, *zcert, *zpkey; in PHP_FUNCTION()
2012 PKCS12 * p12 = NULL; in PHP_FUNCTION()
2013 EVP_PKEY * pkey = NULL; in PHP_FUNCTION()
2014 X509 * cert = NULL; in PHP_FUNCTION()
2015 STACK_OF(X509) * ca = NULL; in PHP_FUNCTION()
2016 BIO * bio_in = NULL; in PHP_FUNCTION()
2047 if (PEM_write_bio_PrivateKey(bio_out, pkey, NULL, NULL, 0, 0, NULL)) { in PHP_FUNCTION()
2108 STACK_OF(CONF_VALUE) * dn_sk, *attr_sk = NULL; in php_openssl_make_REQ()
2112 if (dn_sect == NULL) { in php_openssl_make_REQ()
2116 if (dn_sk == NULL) { in php_openssl_make_REQ()
2120 if (attr_sect == NULL) { in php_openssl_make_REQ()
2121 attr_sk = NULL; in php_openssl_make_REQ()
2124 if (attr_sk == NULL) { in php_openssl_make_REQ()
2141 char * strindex = NULL; in php_openssl_make_REQ()
2157 …php_error_docref(NULL TSRMLS_CC, E_WARNING, "dn: add_entry_by_NID %d -> %s (failed)", nid, Z_STRVA… in php_openssl_make_REQ()
2161 php_error_docref(NULL TSRMLS_CC, E_WARNING, "dn: %s is not a recognized name", strindex); in php_openssl_make_REQ()
2207 … php_error_docref(NULL TSRMLS_CC, E_WARNING, "add_entry_by_txt %s -> %s (failed)", type, v->value); in php_openssl_make_REQ()
2211 php_error_docref(NULL TSRMLS_CC, E_WARNING, "no objects specified in config file"); in php_openssl_make_REQ()
2218 char *strindex = NULL; in php_openssl_make_REQ()
2231 …php_error_docref(NULL TSRMLS_CC, E_WARNING, "attribs: add_entry_by_NID %d -> %s (failed)", nid, Z_… in php_openssl_make_REQ()
2235 php_error_docref(NULL TSRMLS_CC, E_WARNING, "dn: %s is not a recognized name", strindex); in php_openssl_make_REQ()
2248 …php_error_docref(NULL TSRMLS_CC, E_WARNING, "add1_attr_by_txt %s -> %s (failed)", v->name, v->valu… in php_openssl_make_REQ()
2263 X509_REQ * csr = NULL; in php_openssl_csr_from_zval()
2264 char * filename = NULL; in php_openssl_csr_from_zval()
2281 return NULL; in php_openssl_csr_from_zval()
2283 return NULL; in php_openssl_csr_from_zval()
2291 return NULL; in php_openssl_csr_from_zval()
2297 csr = PEM_read_bio_X509_REQ(in, NULL,NULL,NULL); in php_openssl_csr_from_zval()
2309 zval * zcsr = NULL; in PHP_FUNCTION()
2311 char * filename = NULL; int filename_len; in PHP_FUNCTION()
2325 if (csr == NULL) { in PHP_FUNCTION()
2326 php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get CSR from parameter 1"); in PHP_FUNCTION()
2342 php_error_docref(NULL TSRMLS_CC, E_WARNING, "error opening file %s", filename); in PHP_FUNCTION()
2357 zval * zcsr = NULL, *zout=NULL; in PHP_FUNCTION()
2369 if (csr == NULL) { in PHP_FUNCTION()
2370 php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get CSR from parameter 1"); in PHP_FUNCTION()
2402 zval ** zcert = NULL, **zcsr, **zpkey, *args = NULL; in PHP_FUNCTION()
2405 X509 * cert = NULL, *new_cert = NULL; in PHP_FUNCTION()
2407 EVP_PKEY * key = NULL, *priv_key = NULL; in PHP_FUNCTION()
2419 if (csr == NULL) { in PHP_FUNCTION()
2420 php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get CSR from parameter 1"); in PHP_FUNCTION()
2425 if (cert == NULL) { in PHP_FUNCTION()
2426 php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get cert from parameter 2"); in PHP_FUNCTION()
2431 if (priv_key == NULL) { in PHP_FUNCTION()
2432 php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get private key from parameter 3"); in PHP_FUNCTION()
2436 php_error_docref(NULL TSRMLS_CC, E_WARNING, "private key does not correspond to signing cert"); in PHP_FUNCTION()
2445 if (key == NULL) { in PHP_FUNCTION()
2446 php_error_docref(NULL TSRMLS_CC, E_WARNING, "error unpacking public key"); in PHP_FUNCTION()
2452 php_error_docref(NULL TSRMLS_CC, E_WARNING, "Signature verification problems"); in PHP_FUNCTION()
2456 php_error_docref(NULL TSRMLS_CC, E_WARNING, "Signature did not match the certificate request"); in PHP_FUNCTION()
2463 if (new_cert == NULL) { in PHP_FUNCTION()
2464 php_error_docref(NULL TSRMLS_CC, E_WARNING, "No memory"); in PHP_FUNCTION()
2475 if (cert == NULL) { in PHP_FUNCTION()
2490 X509V3_set_ctx(&ctx, cert, new_cert, csr, NULL, 0); in PHP_FUNCTION()
2499 php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to sign it"); in PHP_FUNCTION()
2505 new_cert = NULL; in PHP_FUNCTION()
2510 cert = NULL; in PHP_FUNCTION()
2537 zval * args = NULL, * dn, *attribs = NULL; in PHP_FUNCTION()
2539 X509_REQ * csr = NULL; in PHP_FUNCTION()
2553 req.priv_key = php_openssl_evp_from_zval(&out_pkey, 0, NULL, 0, &key_resource TSRMLS_CC); in PHP_FUNCTION()
2554 if (req.priv_key != NULL) { in PHP_FUNCTION()
2558 if (req.priv_key == NULL) { in PHP_FUNCTION()
2561 if (req.priv_key == NULL) { in PHP_FUNCTION()
2562 php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to generate a private key"); in PHP_FUNCTION()
2569 X509V3_set_ctx(&ext_ctx, NULL, NULL, csr, NULL, 0); in PHP_FUNCTION()
2576 …php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error loading extension section %s", req.request_exte… in PHP_FUNCTION()
2582 csr = NULL; in PHP_FUNCTION()
2584 php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error signing request"); in PHP_FUNCTION()
2591 req.priv_key = NULL; /* make sure the cleanup code doesn't zap it! */ in PHP_FUNCTION()
2593 req.priv_key = NULL; /* make sure the cleanup code doesn't zap it! */ in PHP_FUNCTION()
2600 req.priv_key = NULL; in PHP_FUNCTION()
2629 if (csr == NULL) { in PHP_FUNCTION()
2636 add_assoc_name_entry(return_value, NULL, subject, use_shortnames TSRMLS_CC); in PHP_FUNCTION()
2658 if (csr == NULL) { in PHP_FUNCTION()
2687 EVP_PKEY * key = NULL; in php_openssl_evp_from_zval()
2688 X509 * cert = NULL; in php_openssl_evp_from_zval()
2691 char * filename = NULL; in php_openssl_evp_from_zval()
2700 return NULL; in php_openssl_evp_from_zval()
2711 …php_error_docref(NULL TSRMLS_CC, E_WARNING, "key array must be of the form array(0 => key, 1 => ph… in php_openssl_evp_from_zval()
2712 return NULL; in php_openssl_evp_from_zval()
2726 …php_error_docref(NULL TSRMLS_CC, E_WARNING, "key array must be of the form array(0 => key, 1 => ph… in php_openssl_evp_from_zval()
2753 php_error_docref(NULL TSRMLS_CC, E_WARNING, "supplied key param is a public key"); in php_openssl_evp_from_zval()
2758 …php_error_docref(NULL TSRMLS_CC, E_WARNING, "Don't know how to get public key from this private ke… in php_openssl_evp_from_zval()
2797 if (in == NULL) { in php_openssl_evp_from_zval()
2800 key = PEM_read_bio_PUBKEY(in, NULL,NULL, NULL); in php_openssl_evp_from_zval()
2816 if (in == NULL) { in php_openssl_evp_from_zval()
2819 key = PEM_read_bio_PrivateKey(in, NULL,NULL, passphrase); in php_openssl_evp_from_zval()
2824 if (public_key && cert && key == NULL) { in php_openssl_evp_from_zval()
2833 *resourceval = ZEND_REGISTER_RESOURCE(NULL, key, le_key); in php_openssl_evp_from_zval()
2845 char * randfile = NULL; in php_openssl_generate_private_key()
2847 EVP_PKEY * return_val = NULL; in php_openssl_generate_private_key()
2850 …php_error_docref(NULL TSRMLS_CC, E_WARNING, "private key length is too short; it needs to be at le… in php_openssl_generate_private_key()
2852 return NULL; in php_openssl_generate_private_key()
2858 if ((req->priv_key = EVP_PKEY_new()) != NULL) { in php_openssl_generate_private_key()
2861 …if (EVP_PKEY_assign_RSA(req->priv_key, RSA_generate_key(req->priv_key_bits, 0x10001, NULL, NULL)))… in php_openssl_generate_private_key()
2868 DSA *dsapar = DSA_generate_parameters(req->priv_key_bits, NULL, 0, NULL, NULL, NULL, NULL); in php_openssl_generate_private_key()
2885 DH *dhpar = DH_generate_parameters(req->priv_key_bits, 2, NULL, NULL); in php_openssl_generate_private_key()
2902 php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported private key type"); in php_openssl_generate_private_key()
2908 if (return_val == NULL) { in php_openssl_generate_private_key()
2910 req->priv_key = NULL; in php_openssl_generate_private_key()
2911 return NULL; in php_openssl_generate_private_key()
2922 assert(pkey != NULL); in php_openssl_is_private_key()
2928 assert(pkey->pkey.rsa != NULL); in php_openssl_is_private_key()
2929 if (pkey->pkey.rsa != NULL && (NULL == pkey->pkey.rsa->p || NULL == pkey->pkey.rsa->q)) { in php_openssl_is_private_key()
2940 assert(pkey->pkey.dsa != NULL); in php_openssl_is_private_key()
2942 if (NULL == pkey->pkey.dsa->p || NULL == pkey->pkey.dsa->q || NULL == pkey->pkey.dsa->priv_key){ in php_openssl_is_private_key()
2949 assert(pkey->pkey.dh != NULL); in php_openssl_is_private_key()
2951 if (NULL == pkey->pkey.dh->p || NULL == pkey->pkey.dh->priv_key) { in php_openssl_is_private_key()
2957 php_error_docref(NULL TSRMLS_CC, E_WARNING, "key type not supported in this PHP build!"); in php_openssl_is_private_key()
2965 if (pkey->pkey._type->_name != NULL) { \
2980 Z_STRLEN_PP(bn), NULL); \
2990 zval * args = NULL; in PHP_FUNCTION()
3083 req.priv_key = NULL; in PHP_FUNCTION()
3095 zval ** zpkey, * args = NULL; in PHP_FUNCTION()
3096 char * passphrase = NULL; int passphrase_len = 0; in PHP_FUNCTION()
3097 char * filename = NULL; int filename_len = 0; in PHP_FUNCTION()
3100 BIO * bio_out = NULL; in PHP_FUNCTION()
3114 if (key == NULL) { in PHP_FUNCTION()
3115 php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get key from parameter 1"); in PHP_FUNCTION()
3131 cipher = NULL; in PHP_FUNCTION()
3133 …te_bio_PrivateKey(bio_out, key, cipher, (unsigned char *)passphrase, passphrase_len, NULL, NULL)) { in PHP_FUNCTION()
3155 zval ** zpkey, * args = NULL, *out; in PHP_FUNCTION()
3156 char * passphrase = NULL; int passphrase_len = 0; in PHP_FUNCTION()
3159 BIO * bio_out = NULL; in PHP_FUNCTION()
3169 if (key == NULL) { in PHP_FUNCTION()
3170 php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get key from parameter 1"); in PHP_FUNCTION()
3182 cipher = NULL; in PHP_FUNCTION()
3184 …te_bio_PrivateKey(bio_out, key, cipher, (unsigned char *)passphrase, passphrase_len, NULL, NULL)) { in PHP_FUNCTION()
3219 pkey = php_openssl_evp_from_zval(cert, 1, NULL, 1, &Z_LVAL_P(return_value) TSRMLS_CC); in PHP_FUNCTION()
3221 if (pkey == NULL) { in PHP_FUNCTION()
3257 if (pkey == NULL) { in PHP_FUNCTION()
3297 if (pkey->pkey.rsa != NULL) { in PHP_FUNCTION()
3320 if (pkey->pkey.dsa != NULL) { in PHP_FUNCTION()
3337 if (pkey->pkey.dh != NULL) { in PHP_FUNCTION()
3373 X509_STORE * store = NULL; in PHP_FUNCTION()
3374 zval * cainfo = NULL; in PHP_FUNCTION()
3375 STACK_OF(X509) *signers= NULL; in PHP_FUNCTION()
3376 STACK_OF(X509) *others = NULL; in PHP_FUNCTION()
3377 PKCS7 * p7 = NULL; in PHP_FUNCTION()
3378 BIO * in = NULL, * datain = NULL, * dataout = NULL; in PHP_FUNCTION()
3381 char * extracerts = NULL; int extracerts_len = 0; in PHP_FUNCTION()
3382 char * signersfilename = NULL; int signersfilename_len = 0; in PHP_FUNCTION()
3383 char * datafilename = NULL; int datafilename_len = 0; in PHP_FUNCTION()
3395 if (others == NULL) { in PHP_FUNCTION()
3412 if (in == NULL) { in PHP_FUNCTION()
3416 if (p7 == NULL) { in PHP_FUNCTION()
3430 if (dataout == NULL) { in PHP_FUNCTION()
3452 signers = PKCS7_get0_signers(p7, NULL, flags); in PHP_FUNCTION()
3460 …php_error_docref(NULL TSRMLS_CC, E_WARNING, "signature OK, but cannot open %s for writing", signer… in PHP_FUNCTION()
3482 zval ** zrecipcerts, * zheaders = NULL; in PHP_FUNCTION()
3483 STACK_OF(X509) * recipcerts = NULL; in PHP_FUNCTION()
3484 BIO * infile = NULL, * outfile = NULL; in PHP_FUNCTION()
3486 PKCS7 * p7 = NULL; in PHP_FUNCTION()
3490 const EVP_CIPHER *cipher = NULL; in PHP_FUNCTION()
3495 char * infilename = NULL; int infilename_len; in PHP_FUNCTION()
3496 char * outfilename = NULL; int outfilename_len; in PHP_FUNCTION()
3517 if (infile == NULL) { in PHP_FUNCTION()
3522 if (outfile == NULL) { in PHP_FUNCTION()
3535 if (cert == NULL) { in PHP_FUNCTION()
3543 if (cert == NULL) { in PHP_FUNCTION()
3556 if (cert == NULL) { in PHP_FUNCTION()
3564 if (cert == NULL) { in PHP_FUNCTION()
3573 if (cipher == NULL) { in PHP_FUNCTION()
3575 php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to get cipher"); in PHP_FUNCTION()
3581 if (p7 == NULL) { in PHP_FUNCTION()
3589 strindex = NULL; in PHP_FUNCTION()
3628 X509 * cert = NULL; in PHP_FUNCTION()
3629 EVP_PKEY * privkey = NULL; in PHP_FUNCTION()
3631 PKCS7 * p7 = NULL; in PHP_FUNCTION()
3632 BIO * infile = NULL, * outfile = NULL; in PHP_FUNCTION()
3633 STACK_OF(X509) *others = NULL; in PHP_FUNCTION()
3641 char * extracertsfilename = NULL; int extracertsfilename_len; in PHP_FUNCTION()
3661 if (others == NULL) { in PHP_FUNCTION()
3667 if (privkey == NULL) { in PHP_FUNCTION()
3668 php_error_docref(NULL TSRMLS_CC, E_WARNING, "error getting private key"); in PHP_FUNCTION()
3673 if (cert == NULL) { in PHP_FUNCTION()
3674 php_error_docref(NULL TSRMLS_CC, E_WARNING, "error getting cert"); in PHP_FUNCTION()
3683 if (infile == NULL) { in PHP_FUNCTION()
3684 php_error_docref(NULL TSRMLS_CC, E_WARNING, "error opening input file %s!", infilename); in PHP_FUNCTION()
3689 if (outfile == NULL) { in PHP_FUNCTION()
3690 php_error_docref(NULL TSRMLS_CC, E_WARNING, "error opening output file %s!", outfilename); in PHP_FUNCTION()
3695 if (p7 == NULL) { in PHP_FUNCTION()
3696 php_error_docref(NULL TSRMLS_CC, E_WARNING, "error creating PKCS7 structure!"); in PHP_FUNCTION()
3706 strindex = NULL; in PHP_FUNCTION()
3745 zval ** recipcert, ** recipkey = NULL; in PHP_FUNCTION()
3746 X509 * cert = NULL; in PHP_FUNCTION()
3747 EVP_PKEY * key = NULL; in PHP_FUNCTION()
3749 BIO * in = NULL, * out = NULL, * datain = NULL; in PHP_FUNCTION()
3750 PKCS7 * p7 = NULL; in PHP_FUNCTION()
3770 if (cert == NULL) { in PHP_FUNCTION()
3771 php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to coerce parameter 3 to x509 cert"); in PHP_FUNCTION()
3776 if (key == NULL) { in PHP_FUNCTION()
3777 php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to get private key"); in PHP_FUNCTION()
3786 if (in == NULL) { in PHP_FUNCTION()
3790 if (out == NULL) { in PHP_FUNCTION()
3796 if (p7 == NULL) { in PHP_FUNCTION()
3825 unsigned char *cryptedbuf = NULL; in PHP_FUNCTION()
3839 if (pkey == NULL) { in PHP_FUNCTION()
3840 php_error_docref(NULL TSRMLS_CC, E_WARNING, "key param is not a valid private key"); in PHP_FUNCTION()
3857 php_error_docref(NULL TSRMLS_CC, E_WARNING, "key type not supported in this PHP build!"); in PHP_FUNCTION()
3864 cryptedbuf = NULL; in PHP_FUNCTION()
3883 unsigned char *cryptedbuf = NULL; in PHP_FUNCTION()
3897 if (pkey == NULL) { in PHP_FUNCTION()
3898 php_error_docref(NULL TSRMLS_CC, E_WARNING, "key parameter is not a valid private key"); in PHP_FUNCTION()
3920 php_error_docref(NULL TSRMLS_CC, E_WARNING, "key type not supported in this PHP build!"); in PHP_FUNCTION()
3929 cryptedbuf = NULL; in PHP_FUNCTION()
3961 pkey = php_openssl_evp_from_zval(key, 1, NULL, 0, &keyresource TSRMLS_CC); in PHP_FUNCTION()
3962 if (pkey == NULL) { in PHP_FUNCTION()
3963 php_error_docref(NULL TSRMLS_CC, E_WARNING, "key parameter is not a valid public key"); in PHP_FUNCTION()
3980 php_error_docref(NULL TSRMLS_CC, E_WARNING, "key type not supported in this PHP build!"); in PHP_FUNCTION()
3988 cryptedbuf = NULL; in PHP_FUNCTION()
4007 unsigned char *cryptedbuf = NULL; in PHP_FUNCTION()
4020 pkey = php_openssl_evp_from_zval(key, 1, NULL, 0, &keyresource TSRMLS_CC); in PHP_FUNCTION()
4021 if (pkey == NULL) { in PHP_FUNCTION()
4022 php_error_docref(NULL TSRMLS_CC, E_WARNING, "key parameter is not a valid public key"); in PHP_FUNCTION()
4045 php_error_docref(NULL TSRMLS_CC, E_WARNING, "key type not supported in this PHP build!"); in PHP_FUNCTION()
4055 cryptedbuf = NULL; in PHP_FUNCTION()
4100 zval *method = NULL; in PHP_FUNCTION()
4108 if (pkey == NULL) { in PHP_FUNCTION()
4109 …php_error_docref(NULL TSRMLS_CC, E_WARNING, "supplied key param cannot be coerced into a private k… in PHP_FUNCTION()
4113 if (method == NULL || Z_TYPE_P(method) == IS_LONG) { in PHP_FUNCTION()
4114 if (method != NULL) { in PHP_FUNCTION()
4121 php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown signature algorithm."); in PHP_FUNCTION()
4125 php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown signature algorithm."); in PHP_FUNCTION()
4162 zval *method = NULL; in PHP_FUNCTION()
4169 if (method == NULL || Z_TYPE_P(method) == IS_LONG) { in PHP_FUNCTION()
4170 if (method != NULL) { in PHP_FUNCTION()
4177 php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown signature algorithm."); in PHP_FUNCTION()
4181 php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown signature algorithm."); in PHP_FUNCTION()
4185 pkey = php_openssl_evp_from_zval(key, 1, NULL, 0, &keyresource TSRMLS_CC); in PHP_FUNCTION()
4186 if (pkey == NULL) { in PHP_FUNCTION()
4187 …php_error_docref(NULL TSRMLS_CC, E_WARNING, "supplied key param cannot be coerced into a public ke… in PHP_FUNCTION()
4213 unsigned char *buf = NULL, **eks; in PHP_FUNCTION()
4215 char *method =NULL; in PHP_FUNCTION()
4227 …php_error_docref(NULL TSRMLS_CC, E_WARNING, "Fourth argument to openssl_seal() must be a non-empty… in PHP_FUNCTION()
4234 php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown signature algorithm."); in PHP_FUNCTION()
4253 pkeys[i] = php_openssl_evp_from_zval(pubkey, 1, NULL, 0, &key_resources[i] TSRMLS_CC); in PHP_FUNCTION()
4254 if (pkeys[i] == NULL) { in PHP_FUNCTION()
4255 php_error_docref(NULL TSRMLS_CC, E_WARNING, "not a public key (%dth member of pubkeys)", i+1); in PHP_FUNCTION()
4264 if (!EVP_EncryptInit(&ctx,cipher,NULL,NULL)) { in PHP_FUNCTION()
4272 iv = ivlen ? emalloc(ivlen + 1) : NULL; in PHP_FUNCTION()
4277 …if (!EVP_SealInit(&ctx, cipher, eks, eksl, NULL, pkeys, nkeys) || !EVP_SealUpdate(&ctx, buf, &len1… in PHP_FUNCTION()
4296 eks[i] = NULL; in PHP_FUNCTION()
4341 char *method =NULL; in PHP_FUNCTION()
4350 if (pkey == NULL) { in PHP_FUNCTION()
4351 php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to coerce parameter 4 into a private key"); in PHP_FUNCTION()
4358 php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown signature algorithm."); in PHP_FUNCTION()
4367 …if (EVP_OpenInit(&ctx, cipher, (unsigned char *)ekey, ekey_len, NULL, pkey) && EVP_OpenUpdate(&ctx… in PHP_FUNCTION()
4438 zval **val = NULL; in php_openssl_apply_verification_policy()
4439 char *cnmatch = NULL; in php_openssl_apply_verification_policy()
4449 if (peer == NULL) { in php_openssl_apply_verification_policy()
4450 php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not get peer certificate"); in php_openssl_apply_verification_policy()
4466 …php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not verify peer: code:%d %s", err, X509_verify_… in php_openssl_apply_verification_policy()
4481 php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to locate peer certificate CN"); in php_openssl_apply_verification_policy()
4484 …php_error_docref(NULL TSRMLS_CC, E_WARNING, "Peer certificate CN=`%.*s' is malformed", name_len, b… in php_openssl_apply_verification_policy()
4501 …php_error_docref(NULL TSRMLS_CC, E_WARNING, "Peer certificate CN=`%.*s' did not match expected CN=… in php_openssl_apply_verification_policy()
4513 zval **val = NULL; in passwd_callback()
4514 char *passphrase = NULL; in passwd_callback()
4531 zval **val = NULL; in php_SSL_new_from_context()
4532 char *cafile = NULL; in php_SSL_new_from_context()
4533 char *capath = NULL; in php_SSL_new_from_context()
4534 char *certfile = NULL; in php_SSL_new_from_context()
4535 char *cipherlist = NULL; in php_SSL_new_from_context()
4552 …php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to set verify locations `%s' `%s'", cafile, ca… in php_SSL_new_from_context()
4553 return NULL; in php_SSL_new_from_context()
4562 SSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, NULL); in php_SSL_new_from_context()
4576 return NULL; in php_SSL_new_from_context()
4581 X509 *cert = NULL; in php_SSL_new_from_context()
4582 EVP_PKEY *key = NULL; in php_SSL_new_from_context()
4585 const char * private_key = NULL; in php_SSL_new_from_context()
4590 …php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to set local cert chain file `%s'; Check that … in php_SSL_new_from_context()
4591 return NULL; in php_SSL_new_from_context()
4599 …php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to set private key file `%s'", resolved_path_b… in php_SSL_new_from_context()
4600 return NULL; in php_SSL_new_from_context()
4605 …php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to set private key file `%s'", resolved_path_b… in php_SSL_new_from_context()
4606 return NULL; in php_SSL_new_from_context()
4621 php_error_docref(NULL TSRMLS_CC, E_WARNING, "Private key does not match certificate!"); in php_SSL_new_from_context()
4635 return NULL; in php_SSL_new_from_context()
4702 php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown signature algorithm"); in PHP_FUNCTION()
4749 …php_error_docref(NULL TSRMLS_CC, E_WARNING, "IV passed is only %d bytes long, cipher expects an IV… in php_openssl_validate_iv()
4756 …php_error_docref(NULL TSRMLS_CC, E_WARNING, "IV passed is %d bytes long which is longer than the %… in php_openssl_validate_iv()
4782 php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown cipher algorithm"); in PHP_FUNCTION()
4797 …php_error_docref(NULL TSRMLS_CC, E_WARNING, "Using an empty Initialization Vector (iv) is potentia… in PHP_FUNCTION()
4804 EVP_EncryptInit(&cipher_ctx, cipher_type, NULL, NULL); in PHP_FUNCTION()
4808 EVP_EncryptInit_ex(&cipher_ctx, NULL, NULL, key, (unsigned char *)iv); in PHP_FUNCTION()
4852 char *base64_str = NULL; in PHP_FUNCTION()
4860 php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown cipher algorithm"); in PHP_FUNCTION()
4866 php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown cipher algorithm"); in PHP_FUNCTION()
4873 php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to base64 decode the input"); in PHP_FUNCTION()
4894 EVP_DecryptInit(&cipher_ctx, cipher_type, NULL, NULL); in PHP_FUNCTION()
4898 EVP_DecryptInit_ex(&cipher_ctx, NULL, NULL, key, (unsigned char *)iv); in PHP_FUNCTION()
4934 php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown cipher algorithm"); in PHP_FUNCTION()
4940 php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown cipher algorithm"); in PHP_FUNCTION()
4969 pub = BN_bin2bn((unsigned char*)pub_str, pub_len, NULL); in PHP_FUNCTION()
4991 unsigned char *buffer = NULL; in PHP_FUNCTION()
4992 zval *zstrong_result_returned = NULL; in PHP_FUNCTION()