From: Dr. Stephen Henson Date: Tue, 26 Apr 2005 17:43:53 +0000 (+0000) Subject: Fixes for signed/unsigned warnings and shadows. X-Git-Tag: OpenSSL_0_9_8-beta1~13^2~123 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=4e321ffafff3a1f31bbbfdcf1b17c0ecbde2121f;p=oweals%2Fopenssl.git Fixes for signed/unsigned warnings and shadows. --- diff --git a/apps/s_apps.h b/apps/s_apps.h index bb48244ead..886a95a2b8 100644 --- a/apps/s_apps.h +++ b/apps/s_apps.h @@ -148,7 +148,7 @@ typedef fd_mask fd_set; #define PORT_STR "4433" #define PROTOCOL "tcp" -int do_server(int port, int type, int *ret, int (*cb) (char *hostname, int s, unsigned char *context), char *context); +int do_server(int port, int type, int *ret, int (*cb) (char *hostname, int s, unsigned char *context), unsigned char *context); #ifdef HEADER_X509_H int MS_CALLBACK verify_callback(int ok, X509_STORE_CTX *ctx); #endif diff --git a/apps/s_client.c b/apps/s_client.c index 2f0f568daf..d468778cd1 100644 --- a/apps/s_client.c +++ b/apps/s_client.c @@ -275,7 +275,7 @@ int MAIN(int argc, char **argv) #endif struct sockaddr peer; - int peerlen = sizeof(peer); + socklen_t peerlen = sizeof(peer); int enable_timeouts = 0 ; long mtu = 0; diff --git a/apps/s_server.c b/apps/s_server.c index 059c4a06c7..a5e8bcd024 100644 --- a/apps/s_server.c +++ b/apps/s_server.c @@ -525,7 +525,7 @@ int MAIN(int argc, char *argv[]) int vflags = 0; short port=PORT; char *CApath=NULL,*CAfile=NULL; - char *context = NULL; + unsigned char *context = NULL; char *dhfile = NULL; char *named_curve = NULL; int badop=0,bugs=0; @@ -604,7 +604,7 @@ int MAIN(int argc, char *argv[]) else if (strcmp(*argv,"-context") == 0) { if (--argc < 1) goto bad; - context= *(++argv); + context= (unsigned char *)*(++argv); } else if (strcmp(*argv,"-cert") == 0) { diff --git a/apps/s_socket.c b/apps/s_socket.c index b5dd47d76b..c022585978 100644 --- a/apps/s_socket.c +++ b/apps/s_socket.c @@ -277,7 +277,7 @@ static int init_client_ip(int *sock, unsigned char ip[4], int port, int type) return(1); } -int do_server(int port, int type, int *ret, int (*cb)(char *hostname, int s, unsigned char *context), char *context) +int do_server(int port, int type, int *ret, int (*cb)(char *hostname, int s, unsigned char *context), unsigned char *context) { int sock; char *name = NULL; diff --git a/ssl/d1_both.c b/ssl/d1_both.c index 68908810bd..fb98bf49d0 100644 --- a/ssl/d1_both.c +++ b/ssl/d1_both.c @@ -262,7 +262,7 @@ int dtls1_do_write(SSL *s, int type) dtls1_fix_message_header(s, frag_off, len - DTLS1_HM_HEADER_LENGTH); - dtls1_write_message_header(s, &s->init_buf->data[s->init_off]); + dtls1_write_message_header(s, (unsigned char *)&s->init_buf->data[s->init_off]); OPENSSL_assert(len >= DTLS1_HM_HEADER_LENGTH); } @@ -472,7 +472,7 @@ dtls1_process_handshake_fragment(SSL *s, int frag_len) { unsigned char *p; - p = s->init_buf->data; + p = (unsigned char *)s->init_buf->data; ssl3_finish_mac(s, &p[s->init_num - frag_len], frag_len); } @@ -492,7 +492,7 @@ dtls1_process_out_of_seq_message(SSL *s, struct hm_header_st *msg_hdr, int *ok) goto err; } - p = s->init_buf->data; + p = (unsigned char *)s->init_buf->data; /* read the body of the fragment (header has already been read */ if ( msg_hdr->frag_len > 0) @@ -666,7 +666,7 @@ dtls1_get_message_fragment(SSL *s, int st1, int stn, long max, int *ok) s->state=stn; /* next state (stn) */ - p = s->init_buf->data; + p = (unsigned char *)s->init_buf->data; if ( frag_len > 0) { diff --git a/ssl/d1_pkt.c b/ssl/d1_pkt.c index 4b3aabcfa7..c84e6865a0 100644 --- a/ssl/d1_pkt.c +++ b/ssl/d1_pkt.c @@ -775,7 +775,7 @@ start: * fill that so that we can process the data at a fixed place. */ { - unsigned int i, dest_maxlen = 0; + unsigned int k, dest_maxlen = 0; unsigned char *dest = NULL; unsigned int *dest_len = NULL; @@ -807,9 +807,9 @@ start: } /* now move 'n' bytes: */ - for ( i = 0; i < dest_maxlen; i++) + for ( k = 0; k < dest_maxlen; k++) { - dest[i] = rr->data[rr->off++]; + dest[k] = rr->data[rr->off++]; rr->length--; } *dest_len = dest_maxlen; @@ -1504,8 +1504,8 @@ int dtls1_dispatch_alert(SSL *s) { int i,j; void (*cb)(const SSL *ssl,int type,int val)=NULL; - char buf[2 + 2 + 3]; /* alert level + alert desc + message seq +frag_off */ - char *ptr = &buf[0]; + unsigned char buf[2 + 2 + 3]; /* alert level + alert desc + message seq +frag_off */ + unsigned char *ptr = &buf[0]; s->s3->alert_dispatch=0;