summaryrefslogtreecommitdiff
path: root/libmu_auth/tls.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmu_auth/tls.c')
-rw-r--r--libmu_auth/tls.c88
1 files changed, 0 insertions, 88 deletions
diff --git a/libmu_auth/tls.c b/libmu_auth/tls.c
index 3b89baca1..2d3bd817a 100644
--- a/libmu_auth/tls.c
+++ b/libmu_auth/tls.c
@@ -164,94 +164,6 @@ initialize_tls_session (void)
return session;
}
-int
-mu_tls_begin (void *iodata,
- mu_tls_readline_fn reader,
- mu_tls_writeline_fn writer,
- mu_tls_stream_ctl_fn stream_ctl,
- char *keywords[])
-{
- int i = 0;
- int status;
- mu_stream_t streams[2], newstr;
-
- if (keywords == NULL)
- return EINVAL;
-
- for (i = 0; keywords[i]; i++)
- {
- switch (i)
- {
- case 0:
- /*
- * Send STLS/STARTTLS
- */
- status = writer (iodata, keywords[i]);
- if (status != 0)
- {
- mu_error ("mu_tls_begin: writer (0): %s", mu_strerror (status));
- return status;
- }
-
- status = reader (iodata, i);
- if (status != 0)
- {
- mu_error ("mu_tls_begin: reader (0): %s", mu_strerror (status));
- return status;
- }
-
- status = stream_ctl (iodata, MU_TLS_SESS_GET_STREAMS, streams);
- if (status)
- return status;
- status = mu_tls_client_stream_create (&newstr,
- streams[0], streams[1], 0);
- if (status != 0)
- {
- mu_error ("mu_tls_begin: mu_tls_client_stream_create(0): %s",
- mu_strerror (status));
- stream_ctl (iodata, MU_TLS_SESS_SET_STREAMS, streams);
- return status;
- }
-
- status = mu_stream_open (newstr);
- if (status != 0)
- {
- mu_error ("mu_tls_begin: mu_stream_open (0): %s",
- mu_strerror (status));
- stream_ctl (iodata, MU_TLS_SESS_SET_STREAMS, streams);
- return status;
- }
-
- streams[0] = streams[1] = newstr;
- stream_ctl (iodata, MU_TLS_SESS_SET_STREAMS, streams);
- /* FIXME: Unref newstr */
- break;
-
- case 1:
- /*
- * Send CAPABILITIES request
- */
- status = writer (iodata, keywords[i]);
- if (status != 0)
- {
- mu_error ("mu_tls_begin: writer (1): %s", mu_strerror (status));
- return status;
- }
-
- status = reader (iodata, i);
- if (status != 0)
- {
- mu_error ("mu_tls_begin: reader (1): %s", mu_strerror (status));
- return status;
- }
- break;
-
- default:
- return 1;
- }
- }
- return 0;
-}
/* ************************* TLS Stream Support **************************** */

Return to:

Send suggestions and report system problems to the System administrator.