From bf1348e89dd87a759654e60922ccb41392c9f5a9 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 28 Oct 2021 16:30:04 +0200 Subject: [PATCH] add required internal TLS API's for dummy and schannel Signed-off-by: Steffen Jaeckel --- src/tls.h | 4 ++++ src/tls_dummy.c | 6 ++++++ src/tls_schannel.c | 7 +++++++ 3 files changed, 17 insertions(+) diff --git a/src/tls.h b/src/tls.h index 7f13ed1..dc4c9f3 100644 --- a/src/tls.h +++ b/src/tls.h @@ -31,6 +31,8 @@ struct _xmpp_tlscert_t { dnsname_t *dnsnames; }; +/* provided by the real TLS implementation */ + void tls_initialize(void); void tls_shutdown(void); @@ -55,6 +57,8 @@ int tls_write(tls_t *tls, const void *buff, size_t len); int tls_clear_pending_write(tls_t *tls); int tls_is_recoverable(int error); +/* provided by tls.c */ + xmpp_tlscert_t *tlscert_new(xmpp_ctx_t *ctx); int tlscert_add_dnsname(xmpp_tlscert_t *cert, const char *dnsname); diff --git a/src/tls_dummy.c b/src/tls_dummy.c index b7d9acd..44df067 100644 --- a/src/tls_dummy.c +++ b/src/tls_dummy.c @@ -61,6 +61,12 @@ void tls_free(tls_t *tls) return; } +xmpp_tlscert_t *tls_peer_cert(xmpp_conn_t *conn) +{ + UNUSED(conn); + return NULL; +} + int tls_set_credentials(tls_t *tls, const char *cafilename) { UNUSED(tls); diff --git a/src/tls_schannel.c b/src/tls_schannel.c index 7f4d865..a90580f 100644 --- a/src/tls_schannel.c +++ b/src/tls_schannel.c @@ -222,6 +222,13 @@ void tls_free(tls_t *tls) return; } +xmpp_tlscert_t *tls_peer_cert(xmpp_conn_t *conn) +{ + /* always fail */ + xmpp_error(conn->ctx, "tls", "tls_peer_cert() not implemented"); + return NULL; +} + int tls_set_credentials(tls_t *tls, const char *cafilename) { UNUSED(tls);