Skip to content

Commit

Permalink
add required internal TLS API's for dummy and schannel
Browse files Browse the repository at this point in the history
Signed-off-by: Steffen Jaeckel <[email protected]>
  • Loading branch information
sjaeckel committed Oct 28, 2021
1 parent 795675d commit bf1348e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/tls.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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);

Expand Down
6 changes: 6 additions & 0 deletions src/tls_dummy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
7 changes: 7 additions & 0 deletions src/tls_schannel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit bf1348e

Please sign in to comment.