From: Matt Caswell Date: Tue, 4 Oct 2016 20:22:19 +0000 (+0100) Subject: Update misc function params in libssl for size_t X-Git-Tag: OpenSSL_1_1_1-pre1~3214 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d736bc1a7d45744300b2c81f7296b0d1e550ae0d;p=oweals%2Fopenssl.git Update misc function params in libssl for size_t Reviewed-by: Rich Salz --- diff --git a/ssl/ssl_locl.h b/ssl/ssl_locl.h index db7ca80eba..eea9b86612 100644 --- a/ssl/ssl_locl.h +++ b/ssl/ssl_locl.h @@ -1934,8 +1934,8 @@ __owur long tls1_default_timeout(void); __owur int dtls1_do_write(SSL *s, int type); void dtls1_set_message_header(SSL *s, unsigned char mt, - unsigned long len, - unsigned long frag_off, unsigned long frag_len); + size_t len, + size_t frag_off, size_t frag_len); int dtls1_write_app_data_bytes(SSL *s, int type, const void *buf_, size_t len, size_t *written); @@ -2037,7 +2037,7 @@ __owur int ssl_prepare_serverhello_tlsext(SSL *s); # ifndef OPENSSL_NO_HEARTBEATS __owur int dtls1_heartbeat(SSL *s); __owur int dtls1_process_heartbeat(SSL *s, unsigned char *p, - unsigned int length); + size_t length); # endif __owur int tls_check_serverhello_tlsext_early(SSL *s, const PACKET *ext, @@ -2077,7 +2077,7 @@ __owur int ssl_parse_clienthello_renegotiate_ext(SSL *s, PACKET *pkt, int *al); __owur long ssl_get_algorithm2(SSL *s); __owur int tls12_copy_sigalgs(SSL *s, WPACKET *pkt, const unsigned char *psig, size_t psiglen); -__owur int tls1_save_sigalgs(SSL *s, const unsigned char *data, int dsize); +__owur int tls1_save_sigalgs(SSL *s, const unsigned char *data, size_t dsize); __owur int tls1_process_sigalgs(SSL *s); __owur size_t tls12_get_psigalgs(SSL *s, const unsigned char **psigs); __owur int tls12_check_peer_sigalg(const EVP_MD **pmd, SSL *s, diff --git a/ssl/statem/statem_clnt.c b/ssl/statem/statem_clnt.c index af0882597c..cdf8bb0d92 100644 --- a/ssl/statem/statem_clnt.c +++ b/ssl/statem/statem_clnt.c @@ -1780,7 +1780,7 @@ MSG_PROCESS_RETURN tls_process_certificate_request(SSL *s, PACKET *pkt) goto err; } memcpy(s->cert->ctypes, data, ctype_num); - s->cert->ctype_num = (size_t)ctype_num; + s->cert->ctype_num = ctype_num; ctype_num = SSL3_CT_NUMBER; } for (i = 0; i < ctype_num; i++) diff --git a/ssl/statem/statem_dtls.c b/ssl/statem/statem_dtls.c index 0e54ea5ddb..a651e65fab 100644 --- a/ssl/statem/statem_dtls.c +++ b/ssl/statem/statem_dtls.c @@ -1119,8 +1119,8 @@ int dtls1_retransmit_message(SSL *s, unsigned short seq, int *found) } void dtls1_set_message_header(SSL *s, - unsigned char mt, unsigned long len, - unsigned long frag_off, unsigned long frag_len) + unsigned char mt, size_t len, + size_t frag_off, size_t frag_len) { if (frag_off == 0) { s->d1->handshake_write_seq = s->d1->next_handshake_write_seq; diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c index 3918caf2dc..3621fbb18d 100644 --- a/ssl/t1_lib.c +++ b/ssl/t1_lib.c @@ -20,7 +20,7 @@ #include "ssl_locl.h" #include -static int tls_decrypt_ticket(SSL *s, const unsigned char *tick, int ticklen, +static int tls_decrypt_ticket(SSL *s, const unsigned char *tick, size_t ticklen, const unsigned char *sess_id, size_t sesslen, SSL_SESSION **psess); static int ssl_check_clienthello_tlsext_early(SSL *s); @@ -2963,7 +2963,7 @@ int tls_check_serverhello_tlsext_early(SSL *s, const PACKET *ext, * 4: same as 3, but the ticket needs to be renewed. */ static int tls_decrypt_ticket(SSL *s, const unsigned char *etick, - int eticklen, const unsigned char *sess_id, + size_t eticklen, const unsigned char *sess_id, size_t sesslen, SSL_SESSION **psess) { SSL_SESSION *sess; @@ -3017,13 +3017,14 @@ static int tls_decrypt_ticket(SSL *s, const unsigned char *etick, * Attempt to process session ticket, first conduct sanity and integrity * checks on ticket. */ + /* TODO(size_t) : convert me */ mlen = HMAC_size(hctx); if (mlen < 0) { goto err; } /* Sanity check ticket length: must exceed keyname + IV + HMAC */ if (eticklen <= - TLSEXT_KEYNAME_LENGTH + EVP_CIPHER_CTX_iv_length(ctx) + mlen) { + TLSEXT_KEYNAME_LENGTH + EVP_CIPHER_CTX_iv_length(ctx) + (size_t)mlen) { ret = 2; goto err; } @@ -3411,7 +3412,7 @@ static int tls1_set_shared_sigalgs(SSL *s) /* Set preferred digest for each key type */ -int tls1_save_sigalgs(SSL *s, const unsigned char *data, int dsize) +int tls1_save_sigalgs(SSL *s, const unsigned char *data, size_t dsize) { CERT *c = s->cert; /* Extension ignored for inappropriate versions */