tls/schannel: reflect changes of the tls interface
tls_new() accepts xmpp_conn_t object now.
This commit is contained in:
@@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
struct _tls {
|
struct _tls {
|
||||||
xmpp_ctx_t *ctx;
|
xmpp_ctx_t *ctx;
|
||||||
|
xmpp_conn_t *conn;
|
||||||
sock_t sock;
|
sock_t sock;
|
||||||
|
|
||||||
HANDLE hsec32;
|
HANDLE hsec32;
|
||||||
@@ -60,8 +61,10 @@ void tls_shutdown(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
tls_t *tls_new(xmpp_ctx_t *ctx, sock_t sock)
|
tls_t *tls_new(xmpp_conn_t *conn)
|
||||||
{
|
{
|
||||||
|
xmpp_ctx_t *ctx = conn->ctx;
|
||||||
|
sock_t sock = conn->sock;
|
||||||
tls_t *tls;
|
tls_t *tls;
|
||||||
PSecurityFunctionTable (*pInitSecurityInterface)(void);
|
PSecurityFunctionTable (*pInitSecurityInterface)(void);
|
||||||
SCHANNEL_CRED scred;
|
SCHANNEL_CRED scred;
|
||||||
@@ -92,6 +95,7 @@ tls_t *tls_new(xmpp_ctx_t *ctx, sock_t sock)
|
|||||||
|
|
||||||
memset(tls, 0, sizeof(*tls));
|
memset(tls, 0, sizeof(*tls));
|
||||||
tls->ctx = ctx;
|
tls->ctx = ctx;
|
||||||
|
tls->conn = conn;
|
||||||
tls->sock = sock;
|
tls->sock = sock;
|
||||||
|
|
||||||
if (!(tls->hsec32 = LoadLibrary ("secur32.dll"))) {
|
if (!(tls->hsec32 = LoadLibrary ("secur32.dll"))) {
|
||||||
@@ -216,24 +220,10 @@ int tls_start(tls_t *tls)
|
|||||||
SecBuffer sbin[2], sbout[1];
|
SecBuffer sbin[2], sbout[1];
|
||||||
SECURITY_STATUS ret;
|
SECURITY_STATUS ret;
|
||||||
int sent;
|
int sent;
|
||||||
char *name = NULL;
|
char *name;
|
||||||
|
|
||||||
/* search the ctx's conns for our sock, and use the domain there as our
|
/* use the domain there as our name */
|
||||||
* name */
|
name = strdup(tls->conn->domain);
|
||||||
{
|
|
||||||
xmpp_connlist_t *listentry = tls->ctx->connlist;
|
|
||||||
|
|
||||||
while (listentry) {
|
|
||||||
xmpp_conn_t *conn = listentry->conn;
|
|
||||||
|
|
||||||
if (conn->sock == tls->sock) {
|
|
||||||
name = strdup(conn->domain);
|
|
||||||
listentry = NULL;
|
|
||||||
} else {
|
|
||||||
listentry = listentry->next;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ctxtreq = ISC_REQ_SEQUENCE_DETECT | ISC_REQ_REPLAY_DETECT
|
ctxtreq = ISC_REQ_SEQUENCE_DETECT | ISC_REQ_REPLAY_DETECT
|
||||||
| ISC_REQ_CONFIDENTIALITY | ISC_RET_EXTENDED_ERROR
|
| ISC_REQ_CONFIDENTIALITY | ISC_RET_EXTENDED_ERROR
|
||||||
|
|||||||
Reference in New Issue
Block a user