aboutsummaryrefslogtreecommitdiff
path: root/sslutils.c
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2020-05-30 20:54:36 -0700
committerGuy Harris <gharris@sonic.net>2020-05-30 20:54:36 -0700
commit50f5a8267a378a4c685364adf85e8a7f4153c5a0 (patch)
tree0f8cf7956fadcf7d4890cfdc0efbba430ed8dc9d /sslutils.c
parentbb45f64c9de785980f792c6028b5e7d53bfb2681 (diff)
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.
Diffstat (limited to 'sslutils.c')
-rw-r--r--sslutils.c2
1 files changed, 1 insertions, 1 deletions
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) {