From 50f5a8267a378a4c685364adf85e8a7f4153c5a0 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sat, 30 May 2020 20:54:36 -0700 Subject: SSL: attempt to squelch a narrowing warning. SSL_set_fd() takes an int as its second argument; that's not an issue on UN*X, as sockets are represented by file descriptors, but causes warnings on Windows, where a SOCKET is not an int. A comment in OpenSSL's intternal sockets.h header says, on 64-bit Windows: Even though sizeof(SOCKET) is 8, it's safe to cast it to int, because the value constitutes an index in per-process table of limited size and not a real pointer. so the cast should be safe. --- sslutils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sslutils.c') diff --git a/sslutils.c b/sslutils.c index 8454ebd9..7274cc34 100644 --- a/sslutils.c +++ b/sslutils.c @@ -140,7 +140,7 @@ SSL *ssl_promotion(int is_server, SOCKET s, char *errbuf, size_t errbuflen) } SSL *ssl = SSL_new(ctx); // TODO: also a DTLS context - SSL_set_fd(ssl, s); + SSL_set_fd(ssl, (int)s); if (is_server) { if (SSL_accept(ssl) <= 0) { -- cgit v1.2.3