Lines Matching refs:cert

1433 	X509 *cert = NULL;  in php_openssl_x509_from_str()  local
1447 cert = PEM_read_bio_X509(in, NULL, NULL, NULL); in php_openssl_x509_from_str()
1455 cert = (X509 *) PEM_ASN1_read_bio((d2i_of_void *)d2i_X509, PEM_STRING_X509, in, NULL, NULL, NULL); in php_openssl_x509_from_str()
1457 cert = (X509 *) PEM_ASN1_read_bio((char *(*)())d2i_X509, PEM_STRING_X509, in, NULL, NULL, NULL); in php_openssl_x509_from_str()
1465 if (cert == NULL) { in php_openssl_x509_from_str()
1470 return cert; in php_openssl_x509_from_str()
1514 X509 *cert; in PHP_FUNCTION() local
1532 cert = php_openssl_x509_from_param(cert_obj, cert_str, 1); in PHP_FUNCTION()
1533 if (cert == NULL) { in PHP_FUNCTION()
1544 if (!notext && !X509_print(bio_out, cert)) { in PHP_FUNCTION()
1547 if (!PEM_write_bio_X509(bio_out, cert)) { in PHP_FUNCTION()
1558 X509_free(cert); in PHP_FUNCTION()
1821 X509 *cert; in PHP_FUNCTION() local
1837 cert = php_openssl_x509_from_param(cert_obj, cert_str, 1); in PHP_FUNCTION()
1838 if (cert == NULL) { in PHP_FUNCTION()
1848 if (!notext && !X509_print(bio_out, cert)) { in PHP_FUNCTION()
1851 if (PEM_write_bio_X509(bio_out, cert)) { in PHP_FUNCTION()
1866 X509_free(cert); in PHP_FUNCTION()
1900 X509 *cert; in PHP_FUNCTION() local
1915 cert = php_openssl_x509_from_param(cert_obj, cert_str, 1); in PHP_FUNCTION()
1916 if (cert == NULL) { in PHP_FUNCTION()
1921 fingerprint = php_openssl_x509_fingerprint(cert, method, raw_output); in PHP_FUNCTION()
1929 X509_free(cert); in PHP_FUNCTION()
1936 X509 *cert; in PHP_FUNCTION() local
1947 cert = php_openssl_x509_from_param(cert_obj, cert_str, 1); in PHP_FUNCTION()
1948 if (cert == NULL) { in PHP_FUNCTION()
1956 RETVAL_BOOL(X509_check_private_key(cert, key)); in PHP_FUNCTION()
1961 X509_free(cert); in PHP_FUNCTION()
1969 X509 *cert; in PHP_FUNCTION() local
1981 cert = php_openssl_x509_from_param(cert_obj, cert_str, 1); in PHP_FUNCTION()
1982 if (cert == NULL) { in PHP_FUNCTION()
1988 err = X509_verify(cert, key); in PHP_FUNCTION()
1997 X509_free(cert); in PHP_FUNCTION()
2078 X509 *cert; in PHP_FUNCTION() local
2103 cert = php_openssl_x509_from_param(cert_obj, cert_str, 1); in PHP_FUNCTION()
2104 if (cert == NULL) { in PHP_FUNCTION()
2110 subject_name = X509_get_subject_name(cert); in PHP_FUNCTION()
2119 snprintf(buf, sizeof(buf), "%08lx", X509_subject_name_hash(cert)); in PHP_FUNCTION()
2123 …php_openssl_add_assoc_name_entry(return_value, "issuer", X509_get_issuer_name(cert), useshortnames… in PHP_FUNCTION()
2124 add_assoc_long(return_value, "version", X509_get_version(cert)); in PHP_FUNCTION()
2126 asn1_serial = X509_get_serialNumber(cert); in PHP_FUNCTION()
2151 php_openssl_add_assoc_asn1_string(return_value, "validFrom", X509_getm_notBefore(cert)); in PHP_FUNCTION()
2152 php_openssl_add_assoc_asn1_string(return_value, "validTo", X509_getm_notAfter(cert)); in PHP_FUNCTION()
2154 …long(return_value, "validFrom_time_t", php_openssl_asn1_time_to_time_t(X509_getm_notBefore(cert))); in PHP_FUNCTION()
2155 …c_long(return_value, "validTo_time_t", php_openssl_asn1_time_to_time_t(X509_getm_notAfter(cert))); in PHP_FUNCTION()
2157 tmpstr = (char *)X509_alias_get0(cert, NULL); in PHP_FUNCTION()
2162 sig_nid = X509_get_signature_nid(cert); in PHP_FUNCTION()
2181 purpset = X509_check_purpose(cert, id, 0); in PHP_FUNCTION()
2184 purpset = X509_check_purpose(cert, id, 1); in PHP_FUNCTION()
2199 for (i = 0; i < X509_get_ext_count(cert); i++) { in PHP_FUNCTION()
2201 extension = X509_get_ext(cert, i); in PHP_FUNCTION()
2222 X509_free(cert); in PHP_FUNCTION()
2237 X509_free(cert); in PHP_FUNCTION()
2334 X509 *cert; in PHP_FUNCTION() local
2366 cert = php_openssl_x509_from_param(cert_obj, cert_str, 1); in PHP_FUNCTION()
2367 if (cert == NULL) { in PHP_FUNCTION()
2372 ret = check_cert(cainfo, cert, untrustedchain, (int)purpose); in PHP_FUNCTION()
2379 X509_free(cert); in PHP_FUNCTION()
2469 X509 *cert; in PHP_FUNCTION() local
2478 cert = php_openssl_x509_from_param(cert_obj, cert_str, 1); in PHP_FUNCTION()
2479 if (cert == NULL) { in PHP_FUNCTION()
2486 x509_cert_obj->x509 = cert_obj ? X509_dup(cert) : cert; in PHP_FUNCTION()
2519 X509 * cert; in STACK_OF() local
2527 cert = php_openssl_x509_from_zval(zcertval, &free_cert, arg_num, true, option_name); in STACK_OF()
2528 if (cert == NULL) { in STACK_OF()
2534 cert = X509_dup(cert); in STACK_OF()
2536 if (cert == NULL) { in STACK_OF()
2542 sk_X509_push(sk, cert); in STACK_OF()
2546 cert = php_openssl_x509_from_zval(zcerts, &free_cert, arg_num, false, option_name); in STACK_OF()
2548 if (cert == NULL) { in STACK_OF()
2554 cert = X509_dup(cert); in STACK_OF()
2555 if (cert == NULL) { in STACK_OF()
2560 sk_X509_push(sk, cert); in STACK_OF()
2571 X509 *cert; in PHP_FUNCTION() local
2597 cert = php_openssl_x509_from_param(cert_obj, cert_str, 1); in PHP_FUNCTION()
2598 if (cert == NULL) { in PHP_FUNCTION()
2610 if (!X509_check_private_key(cert, priv_key)) { in PHP_FUNCTION()
2639 p12 = PKCS12_create(pass, friendly_name, priv_key, cert, ca, 0, 0, 0, 0, 0); in PHP_FUNCTION()
2666 X509_free(cert); in PHP_FUNCTION()
2674 X509 *cert; in PHP_FUNCTION() local
2698 cert = php_openssl_x509_from_param(cert_obj, cert_str, 1); in PHP_FUNCTION()
2699 if (cert == NULL) { in PHP_FUNCTION()
2711 if (!X509_check_private_key(cert, priv_key)) { in PHP_FUNCTION()
2729 p12 = PKCS12_create(pass, friendly_name, priv_key, cert, ca, 0, 0, 0, 0, 0); in PHP_FUNCTION()
2754 X509_free(cert); in PHP_FUNCTION()
2767 X509 * cert = NULL; in PHP_FUNCTION() local
2787 if (d2i_PKCS12_bio(bio_in, &p12) && PKCS12_parse(p12, pass, &pkey, &cert, &ca)) { in PHP_FUNCTION()
2796 if (cert) { in PHP_FUNCTION()
2798 if (PEM_write_bio_X509(bio_out, cert)) { in PHP_FUNCTION()
2855 if (cert) { in PHP_FUNCTION()
2856 X509_free(cert); in PHP_FUNCTION()
3194 X509 *cert = NULL, *new_cert = NULL; in PHP_FUNCTION() local
3221 cert = php_openssl_x509_from_param(cert_obj, cert_str, 2); in PHP_FUNCTION()
3222 if (cert == NULL) { in PHP_FUNCTION()
3235 if (cert && !X509_check_private_key(cert, priv_key)) { in PHP_FUNCTION()
3284 if (cert == NULL) { in PHP_FUNCTION()
3285 cert = new_cert; in PHP_FUNCTION()
3287 if (!X509_set_issuer_name(new_cert, X509_get_subject_name(cert))) { in PHP_FUNCTION()
3301 X509V3_set_ctx(&ctx, cert, new_cert, csr, NULL, 0); in PHP_FUNCTION()
3333 if (cert_str && cert && cert != new_cert) { in PHP_FUNCTION()
3334 X509_free(cert); in PHP_FUNCTION()
3532 X509 *cert = NULL; in php_openssl_pkey_from_zval() local
3598 cert = php_openssl_certificate_from_obj(Z_OBJ_P(val))->x509; in php_openssl_pkey_from_zval()
3620 cert = php_openssl_x509_from_str(Z_STR_P(val), arg_num, false, NULL); in php_openssl_pkey_from_zval()
3622 if (cert) { in php_openssl_pkey_from_zval()
3668 if (public_key && cert) { in php_openssl_pkey_from_zval()
3670 key = (EVP_PKEY *) X509_get_pubkey(cert); in php_openssl_pkey_from_zval()
3678 X509_free(cert); in php_openssl_pkey_from_zval()
4847 zval *cert; in PHP_FUNCTION() local
4850 if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &cert) == FAILURE) { in PHP_FUNCTION()
4853 pkey = php_openssl_pkey_from_zval(cert, 1, NULL, 0, 1); in PHP_FUNCTION()
4876 zval *cert; in PHP_FUNCTION() local
4881 …if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|s!", &cert, &passphrase, &passphrase_len) == FAILURE… in PHP_FUNCTION()
4889 pkey = php_openssl_pkey_from_zval(cert, 0, passphrase, passphrase_len, 1); in PHP_FUNCTION()
5530 X509 * cert; in PHP_FUNCTION() local
5563 cert = php_openssl_x509_from_zval(zcertval, &free_cert, 3, true, NULL); in PHP_FUNCTION()
5564 if (cert == NULL) { in PHP_FUNCTION()
5572 cert = X509_dup(cert); in PHP_FUNCTION()
5573 if (cert == NULL) { in PHP_FUNCTION()
5578 sk_X509_push(recipcerts, cert); in PHP_FUNCTION()
5584 cert = php_openssl_x509_from_zval(zrecipcerts, &free_cert, 3, false, NULL); in PHP_FUNCTION()
5585 if (cert == NULL) { in PHP_FUNCTION()
5593 cert = X509_dup(cert); in PHP_FUNCTION()
5594 if (cert == NULL) { in PHP_FUNCTION()
5599 sk_X509_push(recipcerts, cert); in PHP_FUNCTION()
5693 certs = p7->d.sign->cert; in PHP_FUNCTION()
5699 certs = p7->d.signed_and_enveloped->cert; in PHP_FUNCTION()
5757 X509 *cert = NULL; in PHP_FUNCTION() local
5804 cert = php_openssl_x509_from_param(cert_obj, cert_str, 3); in PHP_FUNCTION()
5805 if (cert == NULL) { in PHP_FUNCTION()
5822 p7 = PKCS7_sign(cert, privkey, others, infile, (int)flags); in PHP_FUNCTION()
5867 if (cert && cert_str) { in PHP_FUNCTION()
5868 X509_free(cert); in PHP_FUNCTION()
5877 X509 *cert; in PHP_FUNCTION() local
5898 cert = php_openssl_x509_from_zval(recipcert, &free_recipcert, 3, false, NULL); in PHP_FUNCTION()
5899 if (cert == NULL) { in PHP_FUNCTION()
5930 if (PKCS7_decrypt(p7, key, cert, out, PKCS7_DETACHED)) { in PHP_FUNCTION()
5940 if (cert && free_recipcert) { in PHP_FUNCTION()
5941 X509_free(cert); in PHP_FUNCTION()
6133 X509 * cert; in PHP_FUNCTION() local
6170 cert = php_openssl_x509_from_zval(zcertval, &free_cert, 3, true, NULL); in PHP_FUNCTION()
6171 if (cert == NULL) { in PHP_FUNCTION()
6178 cert = X509_dup(cert); in PHP_FUNCTION()
6179 if (cert == NULL) { in PHP_FUNCTION()
6184 sk_X509_push(recipcerts, cert); in PHP_FUNCTION()
6190 cert = php_openssl_x509_from_zval(zrecipcerts, &free_cert, 3, false, NULL); in PHP_FUNCTION()
6191 if (cert == NULL) { in PHP_FUNCTION()
6198 cert = X509_dup(cert); in PHP_FUNCTION()
6199 if (cert == NULL) { in PHP_FUNCTION()
6204 sk_X509_push(recipcerts, cert); in PHP_FUNCTION()
6403 X509 *cert = NULL; in PHP_FUNCTION() local
6453 cert = php_openssl_x509_from_param(cert_obj, cert_str, 3); in PHP_FUNCTION()
6454 if (cert == NULL) { in PHP_FUNCTION()
6490 cms = CMS_sign(cert, privkey, others, infile, (unsigned int)flags); in PHP_FUNCTION()
6576 if (cert && cert_str) { in PHP_FUNCTION()
6577 X509_free(cert); in PHP_FUNCTION()
6586 X509 *cert; in PHP_FUNCTION() local
6609 cert = php_openssl_x509_from_zval(recipcert, &free_recipcert, 3, false, NULL); in PHP_FUNCTION()
6610 if (cert == NULL) { in PHP_FUNCTION()
6654 if (CMS_decrypt(cms, key, cert, NULL, out, 0)) { in PHP_FUNCTION()
6666 if (cert && free_recipcert) { in PHP_FUNCTION()
6667 X509_free(cert); in PHP_FUNCTION()