Lines Matching refs:cert

1457 	X509 *cert = NULL;  in php_openssl_x509_from_str()  local
1471 cert = PEM_read_bio_X509(in, NULL, NULL, NULL); in php_openssl_x509_from_str()
1479 cert = (X509 *) PEM_ASN1_read_bio((d2i_of_void *)d2i_X509, PEM_STRING_X509, in, NULL, NULL, NULL); in php_openssl_x509_from_str()
1481 cert = (X509 *) PEM_ASN1_read_bio((char *(*)())d2i_X509, PEM_STRING_X509, in, NULL, NULL, NULL); in php_openssl_x509_from_str()
1489 if (cert == NULL) { in php_openssl_x509_from_str()
1494 return cert; in php_openssl_x509_from_str()
1531 X509 *cert = php_openssl_x509_from_str(str, arg_num, is_from_array, option_name); in php_openssl_x509_from_zval() local
1533 return cert; in php_openssl_x509_from_zval()
1540 X509 *cert; in PHP_FUNCTION() local
1558 cert = php_openssl_x509_from_param(cert_obj, cert_str, 1); in PHP_FUNCTION()
1559 if (cert == NULL) { in PHP_FUNCTION()
1570 if (!notext && !X509_print(bio_out, cert)) { in PHP_FUNCTION()
1573 if (!PEM_write_bio_X509(bio_out, cert)) { in PHP_FUNCTION()
1589 X509_free(cert); in PHP_FUNCTION()
1846 X509 *cert; in PHP_FUNCTION() local
1862 cert = php_openssl_x509_from_param(cert_obj, cert_str, 1); in PHP_FUNCTION()
1863 if (cert == NULL) { in PHP_FUNCTION()
1873 if (!notext && !X509_print(bio_out, cert)) { in PHP_FUNCTION()
1876 if (PEM_write_bio_X509(bio_out, cert)) { in PHP_FUNCTION()
1891 X509_free(cert); in PHP_FUNCTION()
1925 X509 *cert; in PHP_FUNCTION() local
1940 cert = php_openssl_x509_from_param(cert_obj, cert_str, 1); in PHP_FUNCTION()
1941 if (cert == NULL) { in PHP_FUNCTION()
1946 fingerprint = php_openssl_x509_fingerprint(cert, method, raw_output); in PHP_FUNCTION()
1954 X509_free(cert); in PHP_FUNCTION()
1961 X509 *cert; in PHP_FUNCTION() local
1972 cert = php_openssl_x509_from_param(cert_obj, cert_str, 1); in PHP_FUNCTION()
1973 if (cert == NULL) { in PHP_FUNCTION()
1981 RETVAL_BOOL(X509_check_private_key(cert, key)); in PHP_FUNCTION()
1986 X509_free(cert); in PHP_FUNCTION()
1994 X509 *cert; in PHP_FUNCTION() local
2006 cert = php_openssl_x509_from_param(cert_obj, cert_str, 1); in PHP_FUNCTION()
2007 if (cert == NULL) { in PHP_FUNCTION()
2013 err = X509_verify(cert, key); in PHP_FUNCTION()
2022 X509_free(cert); in PHP_FUNCTION()
2103 X509 *cert; in PHP_FUNCTION() local
2128 cert = php_openssl_x509_from_param(cert_obj, cert_str, 1); in PHP_FUNCTION()
2129 if (cert == NULL) { in PHP_FUNCTION()
2135 subject_name = X509_get_subject_name(cert); in PHP_FUNCTION()
2144 snprintf(buf, sizeof(buf), "%08lx", X509_subject_name_hash(cert)); in PHP_FUNCTION()
2148 …php_openssl_add_assoc_name_entry(return_value, "issuer", X509_get_issuer_name(cert), useshortnames… in PHP_FUNCTION()
2149 add_assoc_long(return_value, "version", X509_get_version(cert)); in PHP_FUNCTION()
2151 asn1_serial = X509_get_serialNumber(cert); in PHP_FUNCTION()
2176 php_openssl_add_assoc_asn1_string(return_value, "validFrom", X509_getm_notBefore(cert)); in PHP_FUNCTION()
2177 php_openssl_add_assoc_asn1_string(return_value, "validTo", X509_getm_notAfter(cert)); in PHP_FUNCTION()
2179 …long(return_value, "validFrom_time_t", php_openssl_asn1_time_to_time_t(X509_getm_notBefore(cert))); in PHP_FUNCTION()
2180 …c_long(return_value, "validTo_time_t", php_openssl_asn1_time_to_time_t(X509_getm_notAfter(cert))); in PHP_FUNCTION()
2182 tmpstr = (char *)X509_alias_get0(cert, NULL); in PHP_FUNCTION()
2187 sig_nid = X509_get_signature_nid(cert); in PHP_FUNCTION()
2206 purpset = X509_check_purpose(cert, id, 0); in PHP_FUNCTION()
2209 purpset = X509_check_purpose(cert, id, 1); in PHP_FUNCTION()
2224 for (i = 0; i < X509_get_ext_count(cert); i++) { in PHP_FUNCTION()
2226 extension = X509_get_ext(cert, i); in PHP_FUNCTION()
2258 X509_free(cert); in PHP_FUNCTION()
2267 X509_free(cert); in PHP_FUNCTION()
2365 X509 *cert; in PHP_FUNCTION() local
2397 cert = php_openssl_x509_from_param(cert_obj, cert_str, 1); in PHP_FUNCTION()
2398 if (cert == NULL) { in PHP_FUNCTION()
2403 ret = check_cert(cainfo, cert, untrustedchain, (int)purpose); in PHP_FUNCTION()
2410 X509_free(cert); in PHP_FUNCTION()
2500 X509 *cert; in PHP_FUNCTION() local
2509 cert = php_openssl_x509_from_param(cert_obj, cert_str, 1); in PHP_FUNCTION()
2510 if (cert == NULL) { in PHP_FUNCTION()
2517 x509_cert_obj->x509 = cert_obj ? X509_dup(cert) : cert; in PHP_FUNCTION()
2550 X509 * cert; in STACK_OF() local
2558 cert = php_openssl_x509_from_zval(zcertval, &free_cert, arg_num, true, option_name); in STACK_OF()
2559 if (cert == NULL) { in STACK_OF()
2565 cert = X509_dup(cert); in STACK_OF()
2567 if (cert == NULL) { in STACK_OF()
2573 sk_X509_push(sk, cert); in STACK_OF()
2577 cert = php_openssl_x509_from_zval(zcerts, &free_cert, arg_num, false, option_name); in STACK_OF()
2579 if (cert == NULL) { in STACK_OF()
2585 cert = X509_dup(cert); in STACK_OF()
2586 if (cert == NULL) { in STACK_OF()
2591 sk_X509_push(sk, cert); in STACK_OF()
2602 X509 *cert; in PHP_FUNCTION() local
2628 cert = php_openssl_x509_from_param(cert_obj, cert_str, 1); in PHP_FUNCTION()
2629 if (cert == NULL) { in PHP_FUNCTION()
2641 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()
2697 X509_free(cert); in PHP_FUNCTION()
2705 X509 *cert; in PHP_FUNCTION() local
2729 cert = php_openssl_x509_from_param(cert_obj, cert_str, 1); in PHP_FUNCTION()
2730 if (cert == NULL) { in PHP_FUNCTION()
2742 if (!X509_check_private_key(cert, priv_key)) { in PHP_FUNCTION()
2760 p12 = PKCS12_create(pass, friendly_name, priv_key, cert, ca, 0, 0, 0, 0, 0); in PHP_FUNCTION()
2785 X509_free(cert); in PHP_FUNCTION()
2798 X509 * cert = NULL; in PHP_FUNCTION() local
2818 if (d2i_PKCS12_bio(bio_in, &p12) && PKCS12_parse(p12, pass, &pkey, &cert, &ca)) { in PHP_FUNCTION()
2827 if (cert) { in PHP_FUNCTION()
2829 if (PEM_write_bio_X509(bio_out, cert)) { in PHP_FUNCTION()
2886 if (cert) { in PHP_FUNCTION()
2887 X509_free(cert); in PHP_FUNCTION()
3244 X509 *cert = NULL, *new_cert = NULL; in PHP_FUNCTION() local
3272 cert = php_openssl_x509_from_param(cert_obj, cert_str, 2); in PHP_FUNCTION()
3273 if (cert == NULL) { in PHP_FUNCTION()
3286 if (cert && !X509_check_private_key(cert, priv_key)) { in PHP_FUNCTION()
3357 if (cert == NULL) { in PHP_FUNCTION()
3358 cert = new_cert; in PHP_FUNCTION()
3360 if (!X509_set_issuer_name(new_cert, X509_get_subject_name(cert))) { in PHP_FUNCTION()
3374 X509V3_set_ctx(&ctx, cert, new_cert, csr, NULL, 0); in PHP_FUNCTION()
3406 if (cert_str && cert && cert != new_cert) { in PHP_FUNCTION()
3407 X509_free(cert); in PHP_FUNCTION()
3605 X509 *cert = NULL; in php_openssl_pkey_from_zval() local
3672 cert = php_openssl_certificate_from_obj(Z_OBJ_P(val))->x509; in php_openssl_pkey_from_zval()
3696 cert = php_openssl_x509_from_str(val_str, arg_num, false, NULL); in php_openssl_pkey_from_zval()
3698 if (cert) { in php_openssl_pkey_from_zval()
3748 if (public_key && cert) { in php_openssl_pkey_from_zval()
3750 key = (EVP_PKEY *) X509_get_pubkey(cert); in php_openssl_pkey_from_zval()
3758 X509_free(cert); in php_openssl_pkey_from_zval()
5030 zval *cert; in PHP_FUNCTION() local
5033 if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &cert) == FAILURE) { in PHP_FUNCTION()
5036 pkey = php_openssl_pkey_from_zval(cert, 1, NULL, 0, 1); in PHP_FUNCTION()
5059 zval *cert; in PHP_FUNCTION() local
5064 …if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|s!", &cert, &passphrase, &passphrase_len) == FAILURE… in PHP_FUNCTION()
5072 pkey = php_openssl_pkey_from_zval(cert, 0, passphrase, passphrase_len, 1); in PHP_FUNCTION()
5756 X509 * cert; in PHP_FUNCTION() local
5789 cert = php_openssl_x509_from_zval(zcertval, &free_cert, 3, true, NULL); in PHP_FUNCTION()
5790 if (cert == NULL) { in PHP_FUNCTION()
5798 cert = X509_dup(cert); in PHP_FUNCTION()
5799 if (cert == NULL) { in PHP_FUNCTION()
5804 sk_X509_push(recipcerts, cert); in PHP_FUNCTION()
5810 cert = php_openssl_x509_from_zval(zrecipcerts, &free_cert, 3, false, NULL); in PHP_FUNCTION()
5811 if (cert == NULL) { in PHP_FUNCTION()
5819 cert = X509_dup(cert); in PHP_FUNCTION()
5820 if (cert == NULL) { in PHP_FUNCTION()
5825 sk_X509_push(recipcerts, cert); in PHP_FUNCTION()
5919 certs = p7->d.sign->cert; in PHP_FUNCTION()
5925 certs = p7->d.signed_and_enveloped->cert; in PHP_FUNCTION()
5983 X509 *cert = NULL; in PHP_FUNCTION() local
6030 cert = php_openssl_x509_from_param(cert_obj, cert_str, 3); in PHP_FUNCTION()
6031 if (cert == NULL) { in PHP_FUNCTION()
6048 p7 = PKCS7_sign(cert, privkey, others, infile, (int)flags); in PHP_FUNCTION()
6093 if (cert && cert_str) { in PHP_FUNCTION()
6094 X509_free(cert); in PHP_FUNCTION()
6103 X509 *cert; in PHP_FUNCTION() local
6124 cert = php_openssl_x509_from_zval(recipcert, &free_recipcert, 3, false, NULL); in PHP_FUNCTION()
6125 if (cert == NULL) { in PHP_FUNCTION()
6156 if (PKCS7_decrypt(p7, key, cert, out, PKCS7_DETACHED)) { in PHP_FUNCTION()
6166 if (cert && free_recipcert) { in PHP_FUNCTION()
6167 X509_free(cert); in PHP_FUNCTION()
6359 X509 * cert; in PHP_FUNCTION() local
6396 cert = php_openssl_x509_from_zval(zcertval, &free_cert, 3, true, NULL); in PHP_FUNCTION()
6397 if (cert == NULL) { in PHP_FUNCTION()
6404 cert = X509_dup(cert); in PHP_FUNCTION()
6405 if (cert == NULL) { in PHP_FUNCTION()
6410 sk_X509_push(recipcerts, cert); in PHP_FUNCTION()
6416 cert = php_openssl_x509_from_zval(zrecipcerts, &free_cert, 3, false, NULL); in PHP_FUNCTION()
6417 if (cert == NULL) { in PHP_FUNCTION()
6424 cert = X509_dup(cert); in PHP_FUNCTION()
6425 if (cert == NULL) { in PHP_FUNCTION()
6430 sk_X509_push(recipcerts, cert); in PHP_FUNCTION()
6629 X509 *cert = NULL; in PHP_FUNCTION() local
6679 cert = php_openssl_x509_from_param(cert_obj, cert_str, 3); in PHP_FUNCTION()
6680 if (cert == NULL) { in PHP_FUNCTION()
6716 cms = CMS_sign(cert, privkey, others, infile, (unsigned int)flags); in PHP_FUNCTION()
6802 if (cert && cert_str) { in PHP_FUNCTION()
6803 X509_free(cert); in PHP_FUNCTION()
6812 X509 *cert; in PHP_FUNCTION() local
6835 cert = php_openssl_x509_from_zval(recipcert, &free_recipcert, 3, false, NULL); in PHP_FUNCTION()
6836 if (cert == NULL) { in PHP_FUNCTION()
6880 if (CMS_decrypt(cms, key, cert, NULL, out, 0)) { in PHP_FUNCTION()
6892 if (cert && free_recipcert) { in PHP_FUNCTION()
6893 X509_free(cert); in PHP_FUNCTION()