summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Rühsen <tim.ruehsen@gmx.de>2019-12-20 16:13:33 +0100
committerTim Rühsen <tim.ruehsen@gmx.de>2020-01-28 13:11:52 +0100
commit03a70ed76e08018a995a665f10e75a2ae2599a0e (patch)
treece86b737fa525e1c5600a0dd2a894253598350bc
parenta53814fe0fc6242f66cb44bcc1cba918bbd56b73 (diff)
downloadgnutls-tmp-clang-ubsan+asan.tar.gz
Fix "implicit conversion from type 'int' -1 to 'unsigned'"tmp-clang-ubsan+asan
Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
-rw-r--r--lib/alert.c2
-rw-r--r--lib/gnutls_int.h2
-rw-r--r--lib/includes/gnutls/gnutls.h.in3
3 files changed, 3 insertions, 4 deletions
diff --git a/lib/alert.c b/lib/alert.c
index cfd1205d01..aaa16edf68 100644
--- a/lib/alert.c
+++ b/lib/alert.c
@@ -166,7 +166,7 @@ gnutls_alert_send(gnutls_session_t session, gnutls_alert_level_t level,
data[1], name);
if ((ret =
- _gnutls_send_int(session, GNUTLS_ALERT, -1,
+ _gnutls_send_int(session, GNUTLS_ALERT, GNUTLS_HANDSHAKE_ANY,
EPOCH_WRITE_CURRENT, data, 2,
MBUFFER_FLUSH)) >= 0)
return 0;
diff --git a/lib/gnutls_int.h b/lib/gnutls_int.h
index b48805190a..8937eb6a94 100644
--- a/lib/gnutls_int.h
+++ b/lib/gnutls_int.h
@@ -1240,7 +1240,7 @@ typedef struct {
gnutls_handshake_post_client_hello_func user_hello_func;
/* handshake hook function */
gnutls_handshake_hook_func h_hook;
- unsigned int h_type; /* the hooked type */
+ gnutls_handshake_description_t h_type; /* the hooked type */
int16_t h_post; /* whether post-generation/receive */
/* holds the selected certificate and key.
diff --git a/lib/includes/gnutls/gnutls.h.in b/lib/includes/gnutls/gnutls.h.in
index d05ef8e5a9..47ebccf4f5 100644
--- a/lib/includes/gnutls/gnutls.h.in
+++ b/lib/includes/gnutls/gnutls.h.in
@@ -622,6 +622,7 @@ typedef enum {
* Enumeration of different TLS handshake packets.
*/
typedef enum {
+ GNUTLS_HANDSHAKE_ANY = -1,
GNUTLS_HANDSHAKE_HELLO_REQUEST = 0,
GNUTLS_HANDSHAKE_CLIENT_HELLO = 1,
GNUTLS_HANDSHAKE_SERVER_HELLO = 2,
@@ -644,8 +645,6 @@ typedef enum {
GNUTLS_HANDSHAKE_HELLO_RETRY_REQUEST = 1025,
} gnutls_handshake_description_t;
-#define GNUTLS_HANDSHAKE_ANY ((unsigned int)-1)
-
const char
*gnutls_handshake_description_get_name(gnutls_handshake_description_t
type);