Lines Matching refs:cert

138     ZEND_ARG_INFO(0, cert)
155 ZEND_ARG_INFO(0, cert)
239 ZEND_ARG_INFO(0, cert)
1228 X509 *cert = NULL; in php_openssl_x509_from_zval() local
1273 cert = PEM_read_bio_X509(in, NULL, NULL, NULL); in php_openssl_x509_from_zval()
1283 cert = (X509 *) PEM_ASN1_read_bio((d2i_of_void *)d2i_X509, PEM_STRING_X509, in, NULL, NULL, NULL); in php_openssl_x509_from_zval()
1285 cert = (X509 *) PEM_ASN1_read_bio((char *(*)())d2i_X509, PEM_STRING_X509, in, NULL, NULL, NULL); in php_openssl_x509_from_zval()
1290 if (cert && makeresource && resourceval) { in php_openssl_x509_from_zval()
1291 *resourceval = zend_list_insert(cert, le_x509 TSRMLS_CC); in php_openssl_x509_from_zval()
1293 return cert; in php_openssl_x509_from_zval()
1302 X509 * cert; in PHP_FUNCTION() local
1315 cert = php_openssl_x509_from_zval(zcert, 0, &certresource TSRMLS_CC); in PHP_FUNCTION()
1316 if (cert == NULL) { in PHP_FUNCTION()
1328 X509_print(bio_out, cert); in PHP_FUNCTION()
1330 PEM_write_bio_X509(bio_out, cert); in PHP_FUNCTION()
1336 if (certresource == -1 && cert) { in PHP_FUNCTION()
1337 X509_free(cert); in PHP_FUNCTION()
1347 X509 * cert; in PHP_FUNCTION() local
1358 cert = php_openssl_x509_from_zval(zcert, 0, &certresource TSRMLS_CC); in PHP_FUNCTION()
1359 if (cert == NULL) { in PHP_FUNCTION()
1366 X509_print(bio_out, cert); in PHP_FUNCTION()
1368 if (PEM_write_bio_X509(bio_out, cert)) { in PHP_FUNCTION()
1378 if (certresource == -1 && cert) { in PHP_FUNCTION()
1379 X509_free(cert); in PHP_FUNCTION()
1390 X509 * cert = NULL; in PHP_FUNCTION() local
1399 cert = php_openssl_x509_from_zval(zcert, 0, &certresource TSRMLS_CC); in PHP_FUNCTION()
1400 if (cert == NULL) { in PHP_FUNCTION()
1405 RETVAL_BOOL(X509_check_private_key(cert, key)); in PHP_FUNCTION()
1411 if (certresource == -1 && cert) { in PHP_FUNCTION()
1412 X509_free(cert); in PHP_FUNCTION()
1490 X509 * cert = NULL; in PHP_FUNCTION() local
1505 cert = php_openssl_x509_from_zval(zcert, 0, &certresource TSRMLS_CC); in PHP_FUNCTION()
1506 if (cert == NULL) { in PHP_FUNCTION()
1511 if (cert->name) { in PHP_FUNCTION()
1512 add_assoc_string(return_value, "name", cert->name, 1); in PHP_FUNCTION()
1516 …add_assoc_name_entry(return_value, "subject", X509_get_subject_name(cert), useshortnames TSRMLS_… in PHP_FUNCTION()
1520 snprintf(buf, sizeof(buf), "%08lx", X509_subject_name_hash(cert)); in PHP_FUNCTION()
1524 …add_assoc_name_entry(return_value, "issuer", X509_get_issuer_name(cert), useshortnames TSRMLS_CC… in PHP_FUNCTION()
1525 add_assoc_long(return_value, "version", X509_get_version(cert)); in PHP_FUNCTION()
1527 …add_assoc_string(return_value, "serialNumber", i2s_ASN1_INTEGER(NULL, X509_get_serialNumber(cert))… in PHP_FUNCTION()
1529 add_assoc_asn1_string(return_value, "validFrom", X509_get_notBefore(cert)); in PHP_FUNCTION()
1530 add_assoc_asn1_string(return_value, "validTo", X509_get_notAfter(cert)); in PHP_FUNCTION()
1532 …add_assoc_long(return_value, "validFrom_time_t", asn1_time_to_time_t(X509_get_notBefore(cert) TSR… in PHP_FUNCTION()
1533 …add_assoc_long(return_value, "validTo_time_t", asn1_time_to_time_t(X509_get_notAfter(cert) TSRML… in PHP_FUNCTION()
1535 tmpstr = (char *)X509_alias_get0(cert, NULL); in PHP_FUNCTION()
1561 purpset = X509_check_purpose(cert, id, 0); in PHP_FUNCTION()
1564 purpset = X509_check_purpose(cert, id, 1); in PHP_FUNCTION()
1580 for (i = 0; i < X509_get_ext_count(cert); i++) { in PHP_FUNCTION()
1582 extension = X509_get_ext(cert, i); in PHP_FUNCTION()
1597 if (certresource == -1 && cert) { in PHP_FUNCTION()
1598 X509_free(cert); in PHP_FUNCTION()
1614 if (certresource == -1 && cert) { in PHP_FUNCTION()
1615 X509_free(cert); in PHP_FUNCTION()
1704 X509 * cert = NULL; in PHP_FUNCTION() local
1728 cert = php_openssl_x509_from_zval(zcert, 0, &certresource TSRMLS_CC); in PHP_FUNCTION()
1729 if (cert == NULL) { in PHP_FUNCTION()
1733 ret = check_cert(cainfo, cert, untrustedchain, purpose); in PHP_FUNCTION()
1741 if (certresource == 1 && cert) { in PHP_FUNCTION()
1742 X509_free(cert); in PHP_FUNCTION()
1825 zval **cert; in PHP_FUNCTION() local
1828 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z", &cert) == FAILURE) { in PHP_FUNCTION()
1832 x509 = php_openssl_x509_from_zval(cert, 1, &Z_LVAL_P(return_value) TSRMLS_CC); in PHP_FUNCTION()
1846 X509 *cert; in PHP_FUNCTION() local
1851 ZEND_FETCH_RESOURCE(cert, X509 *, &x509, -1, "OpenSSL X.509", le_x509); in PHP_FUNCTION()
1875 X509 * cert; in STACK_OF() local
1885 cert = php_openssl_x509_from_zval(zcertval, 0, &certresource TSRMLS_CC); in STACK_OF()
1886 if (cert == NULL) { in STACK_OF()
1891 cert = X509_dup(cert); in STACK_OF()
1893 if (cert == NULL) { in STACK_OF()
1898 sk_X509_push(sk, cert); in STACK_OF()
1904 cert = php_openssl_x509_from_zval(zcerts, 0, &certresource TSRMLS_CC); in STACK_OF()
1906 if (cert == NULL) { in STACK_OF()
1911 cert = X509_dup(cert); in STACK_OF()
1912 if (cert == NULL) { in STACK_OF()
1916 sk_X509_push(sk, cert); in STACK_OF()
1928 X509 * cert = NULL; in PHP_FUNCTION() local
1947 cert = php_openssl_x509_from_zval(zcert, 0, &certresource TSRMLS_CC); in PHP_FUNCTION()
1948 if (cert == NULL) { in PHP_FUNCTION()
1957 if (cert && !X509_check_private_key(cert, priv_key)) { in PHP_FUNCTION()
1980 p12 = PKCS12_create(pass, friendly_name, priv_key, cert, ca, 0, 0, 0, 0, 0); in PHP_FUNCTION()
2001 if (certresource == -1 && cert) { in PHP_FUNCTION()
2002 X509_free(cert); in PHP_FUNCTION()
2011 X509 * cert = NULL; in PHP_FUNCTION() local
2028 cert = php_openssl_x509_from_zval(&zcert, 0, &certresource TSRMLS_CC); in PHP_FUNCTION()
2029 if (cert == NULL) { in PHP_FUNCTION()
2038 if (cert && !X509_check_private_key(cert, priv_key)) { in PHP_FUNCTION()
2051 p12 = PKCS12_create(pass, friendly_name, priv_key, cert, ca, 0, 0, 0, 0, 0); in PHP_FUNCTION()
2073 if (certresource == -1 && cert) { in PHP_FUNCTION()
2074 X509_free(cert); in PHP_FUNCTION()
2088 X509 * cert = NULL; in PHP_FUNCTION() local
2104 if(PKCS12_parse(p12, pass, &pkey, &cert, &ca)) { in PHP_FUNCTION()
2111 if (PEM_write_bio_X509(bio_out, cert)) { in PHP_FUNCTION()
2171 if (cert) { in PHP_FUNCTION()
2172 X509_free(cert); in PHP_FUNCTION()
2483 X509 * cert = NULL, *new_cert = NULL; in PHP_FUNCTION() local
2502 cert = php_openssl_x509_from_zval(zcert, 0, &certresource TSRMLS_CC); in PHP_FUNCTION()
2503 if (cert == NULL) { in PHP_FUNCTION()
2513 if (cert && !X509_check_private_key(cert, priv_key)) { in PHP_FUNCTION()
2553 if (cert == NULL) { in PHP_FUNCTION()
2554 cert = new_cert; in PHP_FUNCTION()
2556 if (!X509_set_issuer_name(new_cert, X509_get_subject_name(cert))) { in PHP_FUNCTION()
2568 X509V3_set_ctx(&ctx, cert, new_cert, csr, NULL, 0); in PHP_FUNCTION()
2587 if (cert == new_cert) { in PHP_FUNCTION()
2588 cert = NULL; in PHP_FUNCTION()
2601 if (certresource == -1 && cert) { in PHP_FUNCTION()
2602 X509_free(cert); in PHP_FUNCTION()
2766 X509 * cert = NULL; in php_openssl_evp_from_zval() local
2822 cert = (X509*)what; in php_openssl_evp_from_zval()
2864 cert = php_openssl_x509_from_zval(val, 0, &cert_res TSRMLS_CC); in php_openssl_evp_from_zval()
2867 if (!cert) { in php_openssl_evp_from_zval()
2902 if (public_key && cert && key == NULL) { in php_openssl_evp_from_zval()
2904 key = (EVP_PKEY *) X509_get_pubkey(cert); in php_openssl_evp_from_zval()
2907 if (free_cert && cert) { in php_openssl_evp_from_zval()
2908 X509_free(cert); in php_openssl_evp_from_zval()
3303 zval **cert; in PHP_FUNCTION() local
3306 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z", &cert) == FAILURE) { in PHP_FUNCTION()
3310 pkey = php_openssl_evp_from_zval(cert, 1, NULL, 1, &Z_LVAL_P(return_value) TSRMLS_CC); in PHP_FUNCTION()
3338 zval **cert; in PHP_FUNCTION() local
3343 …if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z|s", &cert, &passphrase, &passphrase_len) =… in PHP_FUNCTION()
3347 pkey = php_openssl_evp_from_zval(cert, 0, passphrase, 1, &Z_LVAL_P(return_value) TSRMLS_CC); in PHP_FUNCTION()
3582 X509 * cert; in PHP_FUNCTION() local
3620 cert = php_openssl_x509_from_zval(zcertval, 0, &certresource TSRMLS_CC); in PHP_FUNCTION()
3621 if (cert == NULL) { in PHP_FUNCTION()
3628 cert = X509_dup(cert); in PHP_FUNCTION()
3629 if (cert == NULL) { in PHP_FUNCTION()
3633 sk_X509_push(recipcerts, cert); in PHP_FUNCTION()
3641 cert = php_openssl_x509_from_zval(zrecipcerts, 0, &certresource TSRMLS_CC); in PHP_FUNCTION()
3642 if (cert == NULL) { in PHP_FUNCTION()
3649 cert = X509_dup(cert); in PHP_FUNCTION()
3650 if (cert == NULL) { in PHP_FUNCTION()
3654 sk_X509_push(recipcerts, cert); in PHP_FUNCTION()
3714 X509 * cert = NULL; in PHP_FUNCTION() local
3751 cert = php_openssl_x509_from_zval(zcert, 0, &certresource TSRMLS_CC); in PHP_FUNCTION()
3752 if (cert == NULL) { in PHP_FUNCTION()
3773 p7 = PKCS7_sign(cert, privkey, others, infile, flags); in PHP_FUNCTION()
3813 if (cert && certresource == -1) { in PHP_FUNCTION()
3814 X509_free(cert); in PHP_FUNCTION()
3825 X509 * cert = NULL; in PHP_FUNCTION() local
3840 cert = php_openssl_x509_from_zval(recipcert, 0, &certresval TSRMLS_CC); in PHP_FUNCTION()
3841 if (cert == NULL) { in PHP_FUNCTION()
3870 if (PKCS7_decrypt(p7, key, cert, out, PKCS7_DETACHED)) { in PHP_FUNCTION()
3878 if (cert && certresval == -1) { in PHP_FUNCTION()
3879 X509_free(cert); in PHP_FUNCTION()
4681 X509 *cert = NULL; in php_SSL_new_from_context() local
4684 cert = SSL_get_certificate(tmpssl); in php_SSL_new_from_context()
4686 if (cert) { in php_SSL_new_from_context()
4687 key = X509_get_pubkey(cert); in php_SSL_new_from_context()