Lines Matching refs:cert

152 	ZEND_ARG_INFO(0, cert)
169 ZEND_ARG_INFO(0, cert)
255 ZEND_ARG_INFO(0, cert)
1672 X509 *cert = NULL; in php_openssl_x509_from_zval() local
1714 cert = PEM_read_bio_X509(in, NULL, NULL, NULL); in php_openssl_x509_from_zval()
1724 cert = (X509 *) PEM_ASN1_read_bio((d2i_of_void *)d2i_X509, PEM_STRING_X509, in, NULL, NULL, NULL); in php_openssl_x509_from_zval()
1726 cert = (X509 *) PEM_ASN1_read_bio((char *(*)())d2i_X509, PEM_STRING_X509, in, NULL, NULL, NULL); in php_openssl_x509_from_zval()
1734 if (cert == NULL) { in php_openssl_x509_from_zval()
1740 *resourceval = zend_register_resource(cert, le_x509); in php_openssl_x509_from_zval()
1742 return cert; in php_openssl_x509_from_zval()
1751 X509 * cert; in PHP_FUNCTION() local
1763 cert = php_openssl_x509_from_zval(zcert, 0, NULL); in PHP_FUNCTION()
1764 if (cert == NULL) { in PHP_FUNCTION()
1775 if (!notext && !X509_print(bio_out, cert)) { in PHP_FUNCTION()
1778 if (!PEM_write_bio_X509(bio_out, cert)) { in PHP_FUNCTION()
1788 X509_free(cert); in PHP_FUNCTION()
2095 X509 * cert; in PHP_FUNCTION() local
2105 cert = php_openssl_x509_from_zval(zcert, 0, NULL); in PHP_FUNCTION()
2106 if (cert == NULL) { in PHP_FUNCTION()
2116 if (!notext && !X509_print(bio_out, cert)) { in PHP_FUNCTION()
2119 if (PEM_write_bio_X509(bio_out, cert)) { in PHP_FUNCTION()
2135 X509_free(cert); in PHP_FUNCTION()
2169 X509 *cert; in PHP_FUNCTION() local
2180 cert = php_openssl_x509_from_zval(zcert, 0, NULL); in PHP_FUNCTION()
2181 if (cert == NULL) { in PHP_FUNCTION()
2186 fingerprint = php_openssl_x509_fingerprint(cert, method, raw_output); in PHP_FUNCTION()
2194 X509_free(cert); in PHP_FUNCTION()
2203 X509 * cert = NULL; in PHP_FUNCTION() local
2212 cert = php_openssl_x509_from_zval(zcert, 0, NULL); in PHP_FUNCTION()
2213 if (cert == NULL) { in PHP_FUNCTION()
2218 RETVAL_BOOL(X509_check_private_key(cert, key)); in PHP_FUNCTION()
2225 X509_free(cert); in PHP_FUNCTION()
2306 X509 * cert = NULL; in PHP_FUNCTION() local
2326 cert = php_openssl_x509_from_zval(zcert, 0, NULL); in PHP_FUNCTION()
2327 if (cert == NULL) { in PHP_FUNCTION()
2332 subject_name = X509_get_subject_name(cert); in PHP_FUNCTION()
2341 snprintf(buf, sizeof(buf), "%08lx", X509_subject_name_hash(cert)); in PHP_FUNCTION()
2345 …php_openssl_add_assoc_name_entry(return_value, "issuer", X509_get_issuer_name(cert), useshortnames… in PHP_FUNCTION()
2346 add_assoc_long(return_value, "version", X509_get_version(cert)); in PHP_FUNCTION()
2348 asn1_serial = X509_get_serialNumber(cert); in PHP_FUNCTION()
2373 php_openssl_add_assoc_asn1_string(return_value, "validFrom", X509_get_notBefore(cert)); in PHP_FUNCTION()
2374 php_openssl_add_assoc_asn1_string(return_value, "validTo", X509_get_notAfter(cert)); in PHP_FUNCTION()
2376 …_long(return_value, "validFrom_time_t", php_openssl_asn1_time_to_time_t(X509_get_notBefore(cert))); in PHP_FUNCTION()
2377 …oc_long(return_value, "validTo_time_t", php_openssl_asn1_time_to_time_t(X509_get_notAfter(cert))); in PHP_FUNCTION()
2379 tmpstr = (char *)X509_alias_get0(cert, NULL); in PHP_FUNCTION()
2384 sig_nid = X509_get_signature_nid(cert); in PHP_FUNCTION()
2403 purpset = X509_check_purpose(cert, id, 0); in PHP_FUNCTION()
2406 purpset = X509_check_purpose(cert, id, 1); in PHP_FUNCTION()
2421 for (i = 0; i < X509_get_ext_count(cert); i++) { in PHP_FUNCTION()
2423 extension = X509_get_ext(cert, i); in PHP_FUNCTION()
2444 X509_free(cert); in PHP_FUNCTION()
2459 X509_free(cert); in PHP_FUNCTION()
2557 X509 * cert = NULL; in PHP_FUNCTION() local
2581 cert = php_openssl_x509_from_zval(zcert, 0, NULL); in PHP_FUNCTION()
2582 if (cert == NULL) { in PHP_FUNCTION()
2586 ret = check_cert(cainfo, cert, untrustedchain, (int)purpose); in PHP_FUNCTION()
2593 X509_free(cert); in PHP_FUNCTION()
2674 zval *cert; in PHP_FUNCTION() local
2678 if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &cert) == FAILURE) { in PHP_FUNCTION()
2681 x509 = php_openssl_x509_from_zval(cert, 1, &res); in PHP_FUNCTION()
2696 X509 *cert; in PHP_FUNCTION() local
2701 if ((cert = (X509 *)zend_fetch_resource(Z_RES_P(x509), "OpenSSL X.509", le_x509)) == NULL) { in PHP_FUNCTION()
2726 X509 * cert; in STACK_OF() local
2734 cert = php_openssl_x509_from_zval(zcertval, 0, &certresource); in STACK_OF()
2735 if (cert == NULL) { in STACK_OF()
2740 cert = X509_dup(cert); in STACK_OF()
2742 if (cert == NULL) { in STACK_OF()
2748 sk_X509_push(sk, cert); in STACK_OF()
2752 cert = php_openssl_x509_from_zval(zcerts, 0, &certresource); in STACK_OF()
2754 if (cert == NULL) { in STACK_OF()
2759 cert = X509_dup(cert); in STACK_OF()
2760 if (cert == NULL) { in STACK_OF()
2765 sk_X509_push(sk, cert); in STACK_OF()
2777 X509 * cert = NULL; in PHP_FUNCTION() local
2796 cert = php_openssl_x509_from_zval(zcert, 0, NULL); in PHP_FUNCTION()
2797 if (cert == NULL) { in PHP_FUNCTION()
2806 if (!X509_check_private_key(cert, priv_key)) { in PHP_FUNCTION()
2835 p12 = PKCS12_create(pass, friendly_name, priv_key, cert, ca, 0, 0, 0, 0, 0); in PHP_FUNCTION()
2863 X509_free(cert); in PHP_FUNCTION()
2872 X509 * cert = NULL; in PHP_FUNCTION() local
2889 cert = php_openssl_x509_from_zval(zcert, 0, NULL); in PHP_FUNCTION()
2890 if (cert == NULL) { in PHP_FUNCTION()
2899 if (!X509_check_private_key(cert, priv_key)) { in PHP_FUNCTION()
2917 p12 = PKCS12_create(pass, friendly_name, priv_key, cert, ca, 0, 0, 0, 0, 0); in PHP_FUNCTION()
2946 X509_free(cert); in PHP_FUNCTION()
2960 X509 * cert = NULL; in PHP_FUNCTION() local
2979 if (d2i_PKCS12_bio(bio_in, &p12) && PKCS12_parse(p12, pass, &pkey, &cert, &ca)) { in PHP_FUNCTION()
2986 if (cert) { in PHP_FUNCTION()
2988 if (PEM_write_bio_X509(bio_out, cert)) { in PHP_FUNCTION()
3049 if (cert) { in PHP_FUNCTION()
3050 X509_free(cert); in PHP_FUNCTION()
3385 X509 * cert = NULL, *new_cert = NULL; in PHP_FUNCTION() local
3404 cert = php_openssl_x509_from_zval(zcert, 0, &certresource); in PHP_FUNCTION()
3405 if (cert == NULL) { in PHP_FUNCTION()
3415 if (cert && !X509_check_private_key(cert, priv_key)) { in PHP_FUNCTION()
3461 if (cert == NULL) { in PHP_FUNCTION()
3462 cert = new_cert; in PHP_FUNCTION()
3464 if (!X509_set_issuer_name(new_cert, X509_get_subject_name(cert))) { in PHP_FUNCTION()
3478 X509V3_set_ctx(&ctx, cert, new_cert, csr, NULL, 0); in PHP_FUNCTION()
3499 if (cert == new_cert) { in PHP_FUNCTION()
3500 cert = NULL; in PHP_FUNCTION()
3513 if (zcert && certresource == NULL && cert) { in PHP_FUNCTION()
3514 X509_free(cert); in PHP_FUNCTION()
3736 X509 * cert = NULL; in php_openssl_evp_from_zval() local
3794 cert = (X509*)what; in php_openssl_evp_from_zval()
3839 cert = php_openssl_x509_from_zval(val, 0, &cert_res); in php_openssl_evp_from_zval()
3842 if (!cert) { in php_openssl_evp_from_zval()
3885 if (public_key && cert) { in php_openssl_evp_from_zval()
3887 key = (EVP_PKEY *) X509_get_pubkey(cert); in php_openssl_evp_from_zval()
3894 if (free_cert && cert) { in php_openssl_evp_from_zval()
3895 X509_free(cert); in php_openssl_evp_from_zval()
4682 zval *cert; in PHP_FUNCTION() local
4686 if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &cert) == FAILURE) { in PHP_FUNCTION()
4689 pkey = php_openssl_evp_from_zval(cert, 1, NULL, 0, 1, &res); in PHP_FUNCTION()
4718 zval *cert; in PHP_FUNCTION() local
4724 …if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|s", &cert, &passphrase, &passphrase_len) == FAILURE)… in PHP_FUNCTION()
4729 pkey = php_openssl_evp_from_zval(cert, 0, passphrase, passphrase_len, 1, &res); in PHP_FUNCTION()
5226 X509 * cert; in PHP_FUNCTION() local
5265 cert = php_openssl_x509_from_zval(zcertval, 0, &certresource); in PHP_FUNCTION()
5266 if (cert == NULL) { in PHP_FUNCTION()
5273 cert = X509_dup(cert); in PHP_FUNCTION()
5274 if (cert == NULL) { in PHP_FUNCTION()
5279 sk_X509_push(recipcerts, cert); in PHP_FUNCTION()
5285 cert = php_openssl_x509_from_zval(zrecipcerts, 0, &certresource); in PHP_FUNCTION()
5286 if (cert == NULL) { in PHP_FUNCTION()
5293 cert = X509_dup(cert); in PHP_FUNCTION()
5294 if (cert == NULL) { in PHP_FUNCTION()
5299 sk_X509_push(recipcerts, cert); in PHP_FUNCTION()
5391 certs = p7->d.sign->cert; in PHP_FUNCTION()
5397 certs = p7->d.signed_and_enveloped->cert; in PHP_FUNCTION()
5458 X509 * cert = NULL; in PHP_FUNCTION() local
5495 cert = php_openssl_x509_from_zval(zcert, 0, &certresource); in PHP_FUNCTION()
5496 if (cert == NULL) { in PHP_FUNCTION()
5519 p7 = PKCS7_sign(cert, privkey, others, infile, (int)flags); in PHP_FUNCTION()
5563 if (cert && certresource == NULL) { in PHP_FUNCTION()
5564 X509_free(cert); in PHP_FUNCTION()
5575 X509 * cert = NULL; in PHP_FUNCTION() local
5592 cert = php_openssl_x509_from_zval(recipcert, 0, &certresval); in PHP_FUNCTION()
5593 if (cert == NULL) { in PHP_FUNCTION()
5625 if (PKCS7_decrypt(p7, key, cert, out, PKCS7_DETACHED)) { in PHP_FUNCTION()
5635 if (cert && certresval == NULL) { in PHP_FUNCTION()
5636 X509_free(cert); in PHP_FUNCTION()