From: Rich Salz Date: Wed, 27 Jul 2016 15:09:07 +0000 (-0400) Subject: Add missing casts. X-Git-Tag: OpenSSL_1_0_2i~100 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=cdddc96d5defb418457b91817650971311816298;p=oweals%2Fopenssl.git Add missing casts. Reviewed-by: Dr. Stephen Henson --- diff --git a/apps/s_client.c b/apps/s_client.c index ec130dcc98..b909c9a91a 100644 --- a/apps/s_client.c +++ b/apps/s_client.c @@ -273,7 +273,7 @@ static unsigned int psk_client_cb(SSL *ssl, const char *hint, char *identity, psk_key); return 0; } - if (key_len > max_psk_len) { + if ((unsigned long)key_len > (unsigned long)max_psk_len) { BIO_printf(bio_err, "psk buffer of callback is too small (%d) for key (%ld)\n", max_psk_len, key_len); diff --git a/ssl/s3_srvr.c b/ssl/s3_srvr.c index c95d6102fa..b5eff987f7 100644 --- a/ssl/s3_srvr.c +++ b/ssl/s3_srvr.c @@ -980,7 +980,8 @@ int ssl3_get_client_hello(SSL *s) session_length = *(p + SSL3_RANDOM_SIZE); - if (SSL3_RANDOM_SIZE + session_length + 1 >= (d + n) - p) { + if (SSL3_RANDOM_SIZE + session_length + 1 + >= (unsigned int)((d + n) - p)) { al = SSL_AD_DECODE_ERROR; SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_TOO_SHORT); goto f_err; @@ -1061,7 +1062,7 @@ int ssl3_get_client_hello(SSL *s) } cookie_len = *(p++); - if ((d + n ) - p < cookie_len) { + if ((unsigned int)((d + n ) - p) < cookie_len) { al = SSL_AD_DECODE_ERROR; SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_TOO_SHORT); goto f_err;