diff options
author | Guy Harris <gharris@sonic.net> | 2020-05-30 20:54:36 -0700 |
---|---|---|
committer | Guy Harris <gharris@sonic.net> | 2020-05-30 20:54:36 -0700 |
commit | 50f5a8267a378a4c685364adf85e8a7f4153c5a0 (patch) | |
tree | 0f8cf7956fadcf7d4890cfdc0efbba430ed8dc9d /sslutils.c | |
parent | bb45f64c9de785980f792c6028b5e7d53bfb2681 (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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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) { |