]> jfr.im git - solanum.git/blobdiff - modules/m_starttls.c
Kill CLICAP_FLAGS_REQACK
[solanum.git] / modules / m_starttls.c
index fba20e7da58ec19c3bfd36ac77ff6d4a53aded42..c5b98a0772fcb1cab4a95dab72a7bd5a572032db 100644 (file)
@@ -20,7 +20,6 @@
 
 #include "stdinc.h"
 #include "client.h"
-#include "common.h"
 #include "match.h"
 #include "hash.h"
 #include "ircd.h"
@@ -46,23 +45,16 @@ mapi_clist_av1 starttls_clist[] = { &starttls_msgtab, NULL };
 
 unsigned int CLICAP_TLS = 0;
 
-#ifdef HAVE_LIBCRYPTO
 mapi_cap_list_av2 starttls_cap_list[] = {
        { MAPI_CAP_CLIENT, "tls", NULL, &CLICAP_TLS },
        { 0, NULL, NULL, NULL }
 };
-#else /* HAVE_LIBCRYPTO */
-
-mapi_cap_list_av2 starttls_cap_list[] = { { 0, NULL, NULL, NULL } };
-
-#endif /* HAVE_LIBCRYPTO */
 
 DECLARE_MODULE_AV2(starttls, NULL, NULL, starttls_clist, NULL, NULL, starttls_cap_list, NULL, starttls_desc);
 
 static void
 mr_starttls(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
-#ifdef HAVE_LIBCRYPTO
        ssl_ctl_t *ctl;
        rb_fde_t *F[2];
 
@@ -75,7 +67,7 @@ mr_starttls(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sou
                return;
        }
 
-       if (!ssl_ok || !get_ssld_count())
+       if (!ircd_ssl_ok || !get_ssld_count())
        {
                sendto_one_numeric(client_p, ERR_STARTTLS, form_str(ERR_STARTTLS), "TLS is not configured");
                return;
@@ -96,14 +88,13 @@ mr_starttls(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sou
        sendto_one_numeric(client_p, RPL_STARTTLS, form_str(RPL_STARTTLS));
        send_queued(client_p);
 
-       ctl = start_ssld_accept(client_p->localClient->F, F[1], rb_get_fd(F[0]));
+       /* TODO: set localClient->ssl_callback and handle success/failure */
+
+       ctl = start_ssld_accept(client_p->localClient->F, F[1], connid_get(client_p));
        if (ctl != NULL)
        {
                client_p->localClient->F = F[0];
                client_p->localClient->ssl_ctl = ctl;
                SetSSL(client_p);
        }
-#else /* HAVE_LIBCRYPTO */
-       sendto_one_numeric(client_p, ERR_STARTTLS, form_str(ERR_STARTTLS), "TLS is not configured");
-#endif /* HAVE_LIBCRYPTO */
 }