Lines Matching refs:tls_ctx
155 void report_tls(struct tls *tls_ctx, char * host, char *tlsexpectname);
180 struct tls *tls_ctx = NULL;
604 if ((tls_ctx = tls_server()) == NULL)
606 if (tls_configure(tls_ctx, tls_cfg) == -1)
608 tls_error(tls_ctx));
661 (tls_cctx = tls_setup_server(tls_ctx, connfd, host)))
716 if ((tls_ctx = tls_client()) == NULL)
718 if (tls_configure(tls_ctx, tls_cfg) == -1)
720 tls_error(tls_ctx));
763 tls_setup_client(tls_ctx, s, host);
765 readwrite(s, tls_ctx);
766 if (tls_ctx) {
770 j = tls_close(tls_ctx);
773 tls_free(tls_ctx);
774 tls_ctx = NULL;
830 tls_setup_client(struct tls *tls_ctx, int s, char *host)
834 if (tls_connect_socket(tls_ctx, s,
837 tls_error(tls_ctx));
840 if ((i = tls_handshake(tls_ctx)) == -1)
842 tls_error(tls_ctx));
845 report_tls(tls_ctx, host, tls_expectname);
846 if (tls_expecthash && tls_peer_cert_hash(tls_ctx) &&
847 strcmp(tls_expecthash, tls_peer_cert_hash(tls_ctx)) != 0)
852 tls_setup_server(struct tls *tls_ctx, int connfd, char *host)
856 if (tls_accept_socket(tls_ctx, &tls_cctx,
859 tls_error(tls_ctx));
877 else if (gotcert && tls_peer_cert_hash(tls_ctx) && tls_expecthash &&
878 strcmp(tls_expecthash, tls_peer_cert_hash(tls_ctx)) != 0)
1099 readwrite(int net_fd, struct tls *tls_ctx)
1226 &stdinbufpos, tls_ctx);
1247 &netinbufpos, tls_ctx);
1671 report_tls(struct tls * tls_ctx, char * host, char *tlsexpectname)
1677 tls_conn_version(tls_ctx), tls_conn_cipher(tls_ctx), host);
1680 if (tls_peer_cert_subject(tls_ctx))
1682 tls_peer_cert_subject(tls_ctx));
1683 if (tls_peer_cert_issuer(tls_ctx))
1685 tls_peer_cert_issuer(tls_ctx));
1686 if ((t = tls_peer_cert_notbefore(tls_ctx)) != -1)
1688 if ((t = tls_peer_cert_notafter(tls_ctx)) != -1)
1690 if (tls_peer_cert_hash(tls_ctx))
1692 tls_peer_cert_hash(tls_ctx));
1693 ocsp_url = tls_peer_ocsp_url(tls_ctx);
1696 switch (tls_peer_ocsp_response_status(tls_ctx)) {
1699 tls_peer_ocsp_result(tls_ctx) == NULL ? "" :
1700 tls_peer_ocsp_result(tls_ctx));
1703 tls_peer_ocsp_response_status(tls_ctx),
1704 tls_peer_ocsp_cert_status(tls_ctx),
1705 tls_peer_ocsp_crl_reason(tls_ctx));
1706 t = tls_peer_ocsp_this_update(tls_ctx);
1709 t = tls_peer_ocsp_next_update(tls_ctx);
1712 t = tls_peer_ocsp_revocation_time(tls_ctx);
1720 tls_peer_ocsp_response_status(tls_ctx),
1721 tls_peer_ocsp_result(tls_ctx) == NULL ? "" :
1722 tls_peer_ocsp_result(tls_ctx));