Lines Matching refs:cert
151 ZEND_ARG_INFO(0, cert)
168 ZEND_ARG_INFO(0, cert)
252 ZEND_ARG_INFO(0, cert)
1576 X509 *cert = NULL; in php_openssl_x509_from_zval() local
1618 cert = PEM_read_bio_X509(in, NULL, NULL, NULL); in php_openssl_x509_from_zval()
1628 cert = (X509 *) PEM_ASN1_read_bio((d2i_of_void *)d2i_X509, PEM_STRING_X509, in, NULL, NULL, NULL); in php_openssl_x509_from_zval()
1630 cert = (X509 *) PEM_ASN1_read_bio((char *(*)())d2i_X509, PEM_STRING_X509, in, NULL, NULL, NULL); in php_openssl_x509_from_zval()
1635 if (cert && makeresource && resourceval) { in php_openssl_x509_from_zval()
1636 *resourceval = zend_register_resource(cert, le_x509); in php_openssl_x509_from_zval()
1638 return cert; in php_openssl_x509_from_zval()
1647 X509 * cert; in PHP_FUNCTION() local
1659 cert = php_openssl_x509_from_zval(zcert, 0, NULL); in PHP_FUNCTION()
1660 if (cert == NULL) { in PHP_FUNCTION()
1672 X509_print(bio_out, cert); in PHP_FUNCTION()
1674 PEM_write_bio_X509(bio_out, cert); in PHP_FUNCTION()
1681 X509_free(cert); in PHP_FUNCTION()
1968 X509 * cert; in PHP_FUNCTION() local
1978 cert = php_openssl_x509_from_zval(zcert, 0, NULL); in PHP_FUNCTION()
1979 if (cert == NULL) { in PHP_FUNCTION()
1986 X509_print(bio_out, cert); in PHP_FUNCTION()
1988 if (PEM_write_bio_X509(bio_out, cert)) { in PHP_FUNCTION()
1999 X509_free(cert); in PHP_FUNCTION()
2033 X509 *cert; in PHP_FUNCTION() local
2044 cert = php_openssl_x509_from_zval(zcert, 0, NULL); in PHP_FUNCTION()
2045 if (cert == NULL) { in PHP_FUNCTION()
2050 fingerprint = php_openssl_x509_fingerprint(cert, method, raw_output); in PHP_FUNCTION()
2058 X509_free(cert); in PHP_FUNCTION()
2067 X509 * cert = NULL; in PHP_FUNCTION() local
2076 cert = php_openssl_x509_from_zval(zcert, 0, NULL); in PHP_FUNCTION()
2077 if (cert == NULL) { in PHP_FUNCTION()
2082 RETVAL_BOOL(X509_check_private_key(cert, key)); in PHP_FUNCTION()
2089 X509_free(cert); in PHP_FUNCTION()
2169 X509 * cert = NULL; in PHP_FUNCTION() local
2189 cert = php_openssl_x509_from_zval(zcert, 0, NULL); in PHP_FUNCTION()
2190 if (cert == NULL) { in PHP_FUNCTION()
2195 subject_name = X509_get_subject_name(cert); in PHP_FUNCTION()
2204 snprintf(buf, sizeof(buf), "%08lx", X509_subject_name_hash(cert)); in PHP_FUNCTION()
2208 add_assoc_name_entry(return_value, "issuer", X509_get_issuer_name(cert), useshortnames); in PHP_FUNCTION()
2209 add_assoc_long(return_value, "version", X509_get_version(cert)); in PHP_FUNCTION()
2211 asn1_serial = X509_get_serialNumber(cert); in PHP_FUNCTION()
2234 add_assoc_asn1_string(return_value, "validFrom", X509_get_notBefore(cert)); in PHP_FUNCTION()
2235 add_assoc_asn1_string(return_value, "validTo", X509_get_notAfter(cert)); in PHP_FUNCTION()
2237 add_assoc_long(return_value, "validFrom_time_t", asn1_time_to_time_t(X509_get_notBefore(cert))); in PHP_FUNCTION()
2238 add_assoc_long(return_value, "validTo_time_t", asn1_time_to_time_t(X509_get_notAfter(cert))); in PHP_FUNCTION()
2240 tmpstr = (char *)X509_alias_get0(cert, NULL); in PHP_FUNCTION()
2245 sig_nid = X509_get_signature_nid(cert); in PHP_FUNCTION()
2264 purpset = X509_check_purpose(cert, id, 0); in PHP_FUNCTION()
2267 purpset = X509_check_purpose(cert, id, 1); in PHP_FUNCTION()
2282 for (i = 0; i < X509_get_ext_count(cert); i++) { in PHP_FUNCTION()
2284 extension = X509_get_ext(cert, i); in PHP_FUNCTION()
2301 X509_free(cert); in PHP_FUNCTION()
2316 X509_free(cert); in PHP_FUNCTION()
2403 X509 * cert = NULL; in PHP_FUNCTION() local
2427 cert = php_openssl_x509_from_zval(zcert, 0, NULL); in PHP_FUNCTION()
2428 if (cert == NULL) { in PHP_FUNCTION()
2432 ret = check_cert(cainfo, cert, untrustedchain, (int)purpose); in PHP_FUNCTION()
2439 X509_free(cert); in PHP_FUNCTION()
2517 zval *cert; in PHP_FUNCTION() local
2521 if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &cert) == FAILURE) { in PHP_FUNCTION()
2524 x509 = php_openssl_x509_from_zval(cert, 1, &res); in PHP_FUNCTION()
2539 X509 *cert; in PHP_FUNCTION() local
2544 if ((cert = (X509 *)zend_fetch_resource(Z_RES_P(x509), "OpenSSL X.509", le_x509)) == NULL) { in PHP_FUNCTION()
2569 X509 * cert; in STACK_OF() local
2577 cert = php_openssl_x509_from_zval(zcertval, 0, &certresource); in STACK_OF()
2578 if (cert == NULL) { in STACK_OF()
2583 cert = X509_dup(cert); in STACK_OF()
2585 if (cert == NULL) { in STACK_OF()
2590 sk_X509_push(sk, cert); in STACK_OF()
2594 cert = php_openssl_x509_from_zval(zcerts, 0, &certresource); in STACK_OF()
2596 if (cert == NULL) { in STACK_OF()
2601 cert = X509_dup(cert); in STACK_OF()
2602 if (cert == NULL) { in STACK_OF()
2606 sk_X509_push(sk, cert); in STACK_OF()
2618 X509 * cert = NULL; in PHP_FUNCTION() local
2637 cert = php_openssl_x509_from_zval(zcert, 0, NULL); in PHP_FUNCTION()
2638 if (cert == NULL) { in PHP_FUNCTION()
2647 if (!X509_check_private_key(cert, priv_key)) { in PHP_FUNCTION()
2670 p12 = PKCS12_create(pass, friendly_name, priv_key, cert, ca, 0, 0, 0, 0, 0); in PHP_FUNCTION()
2693 X509_free(cert); in PHP_FUNCTION()
2702 X509 * cert = NULL; in PHP_FUNCTION() local
2719 cert = php_openssl_x509_from_zval(zcert, 0, NULL); in PHP_FUNCTION()
2720 if (cert == NULL) { in PHP_FUNCTION()
2729 if (!X509_check_private_key(cert, priv_key)) { in PHP_FUNCTION()
2742 p12 = PKCS12_create(pass, friendly_name, priv_key, cert, ca, 0, 0, 0, 0, 0); in PHP_FUNCTION()
2765 X509_free(cert); in PHP_FUNCTION()
2779 X509 * cert = NULL; in PHP_FUNCTION() local
2797 if(PKCS12_parse(p12, pass, &pkey, &cert, &ca)) { in PHP_FUNCTION()
2804 if (cert) { in PHP_FUNCTION()
2806 if (PEM_write_bio_X509(bio_out, cert)) { in PHP_FUNCTION()
2874 if (cert) { in PHP_FUNCTION()
2875 X509_free(cert); in PHP_FUNCTION()
3178 X509 * cert = NULL, *new_cert = NULL; in PHP_FUNCTION() local
3197 cert = php_openssl_x509_from_zval(zcert, 0, &certresource); in PHP_FUNCTION()
3198 if (cert == NULL) { in PHP_FUNCTION()
3208 if (cert && !X509_check_private_key(cert, priv_key)) { in PHP_FUNCTION()
3249 if (cert == NULL) { in PHP_FUNCTION()
3250 cert = new_cert; in PHP_FUNCTION()
3252 if (!X509_set_issuer_name(new_cert, X509_get_subject_name(cert))) { in PHP_FUNCTION()
3264 X509V3_set_ctx(&ctx, cert, new_cert, csr, NULL, 0); in PHP_FUNCTION()
3283 if (cert == new_cert) { in PHP_FUNCTION()
3284 cert = NULL; in PHP_FUNCTION()
3297 if (zcert && certresource == NULL && cert) { in PHP_FUNCTION()
3298 X509_free(cert); in PHP_FUNCTION()
3503 X509 * cert = NULL; in php_openssl_evp_from_zval() local
3561 cert = (X509*)what; in php_openssl_evp_from_zval()
3603 cert = php_openssl_x509_from_zval(val, 0, &cert_res); in php_openssl_evp_from_zval()
3606 if (!cert) { in php_openssl_evp_from_zval()
3648 if (public_key && cert && key == NULL) { in php_openssl_evp_from_zval()
3650 key = (EVP_PKEY *) X509_get_pubkey(cert); in php_openssl_evp_from_zval()
3653 if (free_cert && cert) { in php_openssl_evp_from_zval()
3654 X509_free(cert); in php_openssl_evp_from_zval()
4250 zval *cert; in PHP_FUNCTION() local
4254 if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &cert) == FAILURE) { in PHP_FUNCTION()
4257 pkey = php_openssl_evp_from_zval(cert, 1, NULL, 0, 1, &res); in PHP_FUNCTION()
4287 zval *cert; in PHP_FUNCTION() local
4293 …if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|s", &cert, &passphrase, &passphrase_len) == FAILURE)… in PHP_FUNCTION()
4298 pkey = php_openssl_evp_from_zval(cert, 0, passphrase, passphrase_len, 1, &res); in PHP_FUNCTION()
4646 X509 * cert; in PHP_FUNCTION() local
4683 cert = php_openssl_x509_from_zval(zcertval, 0, &certresource); in PHP_FUNCTION()
4684 if (cert == NULL) { in PHP_FUNCTION()
4691 cert = X509_dup(cert); in PHP_FUNCTION()
4692 if (cert == NULL) { in PHP_FUNCTION()
4696 sk_X509_push(recipcerts, cert); in PHP_FUNCTION()
4702 cert = php_openssl_x509_from_zval(zrecipcerts, 0, &certresource); in PHP_FUNCTION()
4703 if (cert == NULL) { in PHP_FUNCTION()
4710 cert = X509_dup(cert); in PHP_FUNCTION()
4711 if (cert == NULL) { in PHP_FUNCTION()
4715 sk_X509_push(recipcerts, cert); in PHP_FUNCTION()
4769 X509 * cert = NULL; in PHP_FUNCTION() local
4806 cert = php_openssl_x509_from_zval(zcert, 0, &certresource); in PHP_FUNCTION()
4807 if (cert == NULL) { in PHP_FUNCTION()
4828 p7 = PKCS7_sign(cert, privkey, others, infile, (int)flags); in PHP_FUNCTION()
4863 if (cert && certresource == NULL) { in PHP_FUNCTION()
4864 X509_free(cert); in PHP_FUNCTION()
4875 X509 * cert = NULL; in PHP_FUNCTION() local
4892 cert = php_openssl_x509_from_zval(recipcert, 0, &certresval); in PHP_FUNCTION()
4893 if (cert == NULL) { in PHP_FUNCTION()
4922 if (PKCS7_decrypt(p7, key, cert, out, PKCS7_DETACHED)) { in PHP_FUNCTION()
4930 if (cert && certresval == NULL) { in PHP_FUNCTION()
4931 X509_free(cert); in PHP_FUNCTION()