Lines Matching refs:cert
197 const CERT_CONTEXT *cert; member
320 if (priv->cert) in cryptoapi_free_data()
321 CertFreeCertificateContext(priv->cert); in cryptoapi_free_data()
383 X509 *cert = NULL; in tls_cryptoapi_cert() local
403 priv->cert = cryptoapi_find_cert(name, CERT_SYSTEM_STORE_CURRENT_USER); in tls_cryptoapi_cert()
404 if (priv->cert == NULL) { in tls_cryptoapi_cert()
405 priv->cert = cryptoapi_find_cert( in tls_cryptoapi_cert()
408 if (priv->cert == NULL) { in tls_cryptoapi_cert()
414 cert = d2i_X509(NULL, in tls_cryptoapi_cert()
415 (const unsigned char **) &priv->cert->pbCertEncoded, in tls_cryptoapi_cert()
416 priv->cert->cbCertEncoded); in tls_cryptoapi_cert()
417 if (cert == NULL) { in tls_cryptoapi_cert()
423 if (!CryptAcquireCertificatePrivateKey(priv->cert, in tls_cryptoapi_cert()
449 if (!SSL_use_certificate(ssl, cert)) { in tls_cryptoapi_cert()
454 pub_rsa = cert->cert_info->key->pkey->pkey.rsa; in tls_cryptoapi_cert()
455 X509_free(cert); in tls_cryptoapi_cert()
456 cert = NULL; in tls_cryptoapi_cert()
470 if (cert) in tls_cryptoapi_cert()
471 X509_free(cert); in tls_cryptoapi_cert()
486 X509 *cert; in tls_cryptoapi_ca_cert() local
515 cert = d2i_X509(NULL, in tls_cryptoapi_ca_cert()
518 if (cert == NULL) { in tls_cryptoapi_ca_cert()
524 X509_NAME_oneline(X509_get_subject_name(cert), buf, in tls_cryptoapi_ca_cert()
529 if (!X509_STORE_add_cert(ssl_ctx->cert_store, cert)) { in tls_cryptoapi_ca_cert()
535 X509_free(cert); in tls_cryptoapi_ca_cert()
1218 static int tls_match_altsubject_component(X509 *cert, int type, in tls_match_altsubject_component() argument
1226 ext = X509_get_ext_d2i(cert, NID_subject_alt_name, NULL, NULL); in tls_match_altsubject_component()
1241 static int tls_match_altsubject(X509 *cert, const char *match) in tls_match_altsubject() argument
1275 if (tls_match_altsubject_component(cert, type, pos, len) > 0) in tls_match_altsubject()
1318 static int tls_match_suffix(X509 *cert, const char *match, int full) in tls_match_suffix() argument
1334 ext = X509_get_ext_d2i(cert, NID_subject_alt_name, NULL, NULL); in tls_match_suffix()
1358 name = X509_get_subject_name(cert); in tls_match_suffix()
1428 static struct wpabuf * get_x509_cert(X509 *cert) in get_x509_cert() argument
1433 int cert_len = i2d_X509(cert, NULL); in get_x509_cert()
1442 i2d_X509(cert, &tmp); in get_x509_cert()
1453 struct wpabuf *cert = NULL; in openssl_tls_fail_event() local
1459 cert = get_x509_cert(err_cert); in openssl_tls_fail_event()
1466 ev.cert_fail.cert = cert; in openssl_tls_fail_event()
1468 wpabuf_free(cert); in openssl_tls_fail_event()
1476 struct wpabuf *cert = NULL; in openssl_tls_cert_event() local
1493 cert = get_x509_cert(err_cert); in openssl_tls_cert_event()
1494 ev.peer_cert.cert = cert; in openssl_tls_cert_event()
1497 if (cert) { in openssl_tls_cert_event()
1500 addr[0] = wpabuf_head(cert); in openssl_tls_cert_event()
1501 len[0] = wpabuf_len(cert); in openssl_tls_cert_event()
1553 wpabuf_free(cert); in openssl_tls_cert_event()
1617 struct wpabuf *cert; in tls_verify_cb() local
1618 cert = get_x509_cert(err_cert); in tls_verify_cb()
1619 if (!cert) { in tls_verify_cb()
1627 addr[0] = wpabuf_head(cert); in tls_verify_cb()
1628 len[0] = wpabuf_len(cert); in tls_verify_cb()
1643 wpabuf_free(cert); in tls_verify_cb()
1807 X509 *cert = d2i_X509(NULL, in tls_connection_ca_cert() local
1810 if (cert == NULL) { in tls_connection_ca_cert()
1817 cert)) { in tls_connection_ca_cert()
1829 X509_free(cert); in tls_connection_ca_cert()
1833 X509_free(cert); in tls_connection_ca_cert()
2186 X509 *cert; in tls_parse_pkcs12() local
2192 cert = NULL; in tls_parse_pkcs12()
2196 if (!PKCS12_parse(p12, passwd, &pkey, &cert, &certs)) { in tls_parse_pkcs12()
2204 if (cert) { in tls_parse_pkcs12()
2205 X509_NAME_oneline(X509_get_subject_name(cert), buf, in tls_parse_pkcs12()
2210 if (SSL_use_certificate(ssl, cert) != 1) in tls_parse_pkcs12()
2213 if (SSL_CTX_use_certificate(data->ssl, cert) != 1) in tls_parse_pkcs12()
2216 X509_free(cert); in tls_parse_pkcs12()
2234 while ((cert = sk_X509_pop(certs)) != NULL) { in tls_parse_pkcs12()
2235 X509_NAME_oneline(X509_get_subject_name(cert), buf, in tls_parse_pkcs12()
2239 if (SSL_add1_chain_cert(ssl, cert) != 1) { in tls_parse_pkcs12()
2271 while ((cert = sk_X509_pop(certs)) != NULL) { in tls_parse_pkcs12()
2272 X509_NAME_oneline(X509_get_subject_name(cert), buf, in tls_parse_pkcs12()
2280 if (SSL_CTX_add_extra_chain_cert(data->ssl, cert) != 1) in tls_parse_pkcs12()
2356 X509 **cert) in tls_engine_get_cert() argument
2361 X509 *cert; in tls_engine_get_cert() member
2364 params.cert = NULL; in tls_engine_get_cert()
2377 if (!params.cert) { in tls_engine_get_cert()
2382 *cert = params.cert; in tls_engine_get_cert()
2392 X509 *cert; in tls_connection_engine_client_cert() local
2394 if (tls_engine_get_cert(conn, cert_id, &cert)) in tls_connection_engine_client_cert()
2397 if (!SSL_use_certificate(conn->ssl, cert)) { in tls_connection_engine_client_cert()
2400 X509_free(cert); in tls_connection_engine_client_cert()
2403 X509_free(cert); in tls_connection_engine_client_cert()
2419 X509 *cert; in tls_connection_engine_ca_cert() local
2423 if (tls_engine_get_cert(conn, ca_cert_id, &cert)) in tls_connection_engine_ca_cert()
2431 X509_free(cert); in tls_connection_engine_ca_cert()
2435 if (!X509_STORE_add_cert(store, cert)) { in tls_connection_engine_ca_cert()
2446 X509_free(cert); in tls_connection_engine_ca_cert()
2450 X509_free(cert); in tls_connection_engine_ca_cert()
3543 static void debug_print_cert(X509 *cert, const char *title) in debug_print_cert() argument
3558 X509_print(out, cert); in debug_print_cert()
3629 X509 *cert; in ocsp_resp_cb() local
3630 cert = X509_dup(conn->peer_issuer); in ocsp_resp_cb()
3631 if (cert && !sk_X509_push(certs, cert)) { in ocsp_resp_cb()
3635 X509_free(cert); in ocsp_resp_cb()
3640 cert = X509_dup(conn->peer_issuer_issuer); in ocsp_resp_cb()
3641 if (cert && !sk_X509_push(certs, cert)) { in ocsp_resp_cb()
3645 X509_free(cert); in ocsp_resp_cb()