# HG changeset patch # User Matt Johnston # Date 1433431448 -28800 # Node ID 6aeadee3f16b59bdd9e2bcbb471185e8f1ccc56e # Parent d7b752525b9147a6b6e6667666dffc7434996c06# Parent aaf576b27a10cf2f3b82723363238432a2394c65 merge diff -r aaf576b27a10 -r 6aeadee3f16b algo.h --- a/algo.h Thu Jun 04 23:08:50 2015 +0800 +++ b/algo.h Thu Jun 04 23:24:08 2015 +0800 @@ -35,7 +35,7 @@ struct Algo_Type { - const unsigned char *name; /* identifying name */ + const char *name; /* identifying name */ char val; /* a value for this cipher, or -1 for invalid */ const void *data; /* algorithm specific data */ char usable; /* whether we can use this algorithm */ diff -r aaf576b27a10 -r 6aeadee3f16b auth.h --- a/auth.h Thu Jun 04 23:08:50 2015 +0800 +++ b/auth.h Thu Jun 04 23:24:08 2015 +0800 @@ -133,7 +133,7 @@ int no_x11_forwarding_flag; int no_pty_flag; /* "command=" option. */ - unsigned char * forced_command; + char * forced_command; }; #endif diff -r aaf576b27a10 -r 6aeadee3f16b channel.h --- a/channel.h Thu Jun 04 23:08:50 2015 +0800 +++ b/channel.h Thu Jun 04 23:24:08 2015 +0800 @@ -135,7 +135,7 @@ void recv_msg_channel_open_confirmation(); void recv_msg_channel_open_failure(); #endif -void start_send_channel_request(struct Channel *channel, unsigned char *type); +void start_send_channel_request(struct Channel *channel, char *type); void send_msg_request_success(); void send_msg_request_failure(); diff -r aaf576b27a10 -r 6aeadee3f16b chansession.h --- a/chansession.h Thu Jun 04 23:08:50 2015 +0800 +++ b/chansession.h Thu Jun 04 23:24:08 2015 +0800 @@ -39,14 +39,14 @@ struct ChanSess { - unsigned char * cmd; /* command to exec */ + char * cmd; /* command to exec */ pid_t pid; /* child process pid */ /* pty details */ int master; /* the master terminal fd*/ int slave; - unsigned char * tty; - unsigned char * term; + char * tty; + char * term; /* exit details */ struct exitinfo exit; diff -r aaf576b27a10 -r 6aeadee3f16b cli-kex.c --- a/cli-kex.c Thu Jun 04 23:08:50 2015 +0800 +++ b/cli-kex.c Thu Jun 04 23:24:08 2015 +0800 @@ -322,7 +322,7 @@ } /* Compare hostnames */ - if (strncmp(cli_opts.remotehost, buf_getptr(line, hostlen), + if (strncmp(cli_opts.remotehost, (const char *) buf_getptr(line, hostlen), hostlen) != 0) { continue; } @@ -334,7 +334,7 @@ continue; } - if (strncmp(buf_getptr(line, algolen), algoname, algolen) != 0) { + if (strncmp((const char *) buf_getptr(line, algolen), algoname, algolen) != 0) { TRACE(("algo doesn't match")) continue; } @@ -346,7 +346,7 @@ } /* Now we're at the interesting hostkey */ - ret = cmp_base64_key(keyblob, keybloblen, algoname, algolen, + ret = cmp_base64_key(keyblob, keybloblen, (const unsigned char *) algoname, algolen, line, &fingerprint); if (ret == DROPBEAR_SUCCESS) { @@ -382,9 +382,9 @@ fseek(hostsfile, 0, SEEK_END); /* In case it wasn't opened append */ buf_setpos(line, 0); buf_setlen(line, 0); - buf_putbytes(line, cli_opts.remotehost, hostlen); + buf_putbytes(line, (const unsigned char *) cli_opts.remotehost, hostlen); buf_putbyte(line, ' '); - buf_putbytes(line, algoname, algolen); + buf_putbytes(line, (const unsigned char *) algoname, algolen); buf_putbyte(line, ' '); len = line->size - line->pos; /* The only failure with base64 is buffer_overflow, but buf_getwriteptr diff -r aaf576b27a10 -r 6aeadee3f16b cli-session.c diff -r aaf576b27a10 -r 6aeadee3f16b cli-tcpfwd.c diff -r aaf576b27a10 -r 6aeadee3f16b common-algo.c diff -r aaf576b27a10 -r 6aeadee3f16b common-kex.c --- a/common-kex.c Thu Jun 04 23:08:50 2015 +0800 +++ b/common-kex.c Thu Jun 04 23:24:08 2015 +0800 @@ -511,7 +511,7 @@ /* start the kex hash */ local_ident_len = strlen(LOCAL_IDENT); - remote_ident_len = strlen((char*)ses.remoteident); + remote_ident_len = strlen(ses.remoteident); kexhashbuf_len = local_ident_len + remote_ident_len + ses.transkexinit->len + ses.payload->len diff -r aaf576b27a10 -r 6aeadee3f16b common-session.c diff -r aaf576b27a10 -r 6aeadee3f16b configure.ac --- a/configure.ac Thu Jun 04 23:08:50 2015 +0800 +++ b/configure.ac Thu Jun 04 23:24:08 2015 +0800 @@ -265,7 +265,7 @@ #include #include ]], - [[ struct sockaddr_storage s; ]])], + [[ if (sizeof(struct sockaddr_storage)) return 0 ]])], [ ac_cv_have_struct_sockaddr_storage="yes" ], [ ac_cv_have_struct_sockaddr_storage="no" ] ) @@ -279,7 +279,7 @@ #include #include ]], - [[ struct sockaddr_in6 s; s.sin6_family = 0; ]])], + [[ if (sizeof(struct sockaddr_in6)) return 0 ]])], [ ac_cv_have_struct_sockaddr_in6="yes" ], [ ac_cv_have_struct_sockaddr_in6="no" ] ) @@ -293,7 +293,7 @@ #include #include ]], - [[ struct in6_addr s; s.s6_addr[0] = 0; ]])], + [[ if (sizeof(struct in6_addr)) return 0 ]])], [ ac_cv_have_struct_in6_addr="yes" ], [ ac_cv_have_struct_in6_addr="no" ] ) @@ -308,7 +308,7 @@ #include #include ]], - [[ struct addrinfo s; s.ai_flags = AI_PASSIVE; ]])], + [[ if (sizeof(struct addrinfo)) return 0 ]])], [ ac_cv_have_struct_addrinfo="yes" ], [ ac_cv_have_struct_addrinfo="no" ] ) diff -r aaf576b27a10 -r 6aeadee3f16b dbrandom.c --- a/dbrandom.c Thu Jun 04 23:08:50 2015 +0800 +++ b/dbrandom.c Thu Jun 04 23:24:08 2015 +0800 @@ -141,7 +141,7 @@ return ret; } -void addrandom(char * buf, unsigned int len) +void addrandom(unsigned char * buf, unsigned int len) { hash_state hs; diff -r aaf576b27a10 -r 6aeadee3f16b dbrandom.h --- a/dbrandom.h Thu Jun 04 23:08:50 2015 +0800 +++ b/dbrandom.h Thu Jun 04 23:24:08 2015 +0800 @@ -29,7 +29,7 @@ void seedrandom(); void genrandom(unsigned char* buf, unsigned int len); -void addrandom(char * buf, unsigned int len); +void addrandom(unsigned char * buf, unsigned int len); void gen_random_mpint(mp_int *max, mp_int *rand); #endif /* DROPBEAR_RANDOM_H_ */ diff -r aaf576b27a10 -r 6aeadee3f16b ecc.h --- a/ecc.h Thu Jun 04 23:08:50 2015 +0800 +++ b/ecc.h Thu Jun 04 23:24:08 2015 +0800 @@ -12,7 +12,7 @@ int ltc_size; /* to match the byte sizes in ltc_ecc_sets[] */ const ltc_ecc_set_type *dp; /* curve domain parameters */ const struct ltc_hash_descriptor *hash_desc; - const unsigned char *name; + const char *name; }; extern struct dropbear_ecc_curve ecc_curve_nistp256; diff -r aaf576b27a10 -r 6aeadee3f16b gendss.c --- a/gendss.c Thu Jun 04 23:08:50 2015 +0800 +++ b/gendss.c Thu Jun 04 23:24:08 2015 +0800 @@ -67,7 +67,7 @@ static void getq(dropbear_dss_key *key) { - char buf[QSIZE]; + unsigned char buf[QSIZE]; /* 160 bit prime */ genrandom(buf, QSIZE); diff -r aaf576b27a10 -r 6aeadee3f16b keyimport.c --- a/keyimport.c Thu Jun 04 23:08:50 2015 +0800 +++ b/keyimport.c Thu Jun 04 23:24:08 2015 +0800 @@ -193,7 +193,7 @@ static void base64_encode_fp(FILE * fp, unsigned char *data, int datalen, int cpl) { - char out[100]; + unsigned char out[100]; int n; unsigned long outlen; int rawcpl; @@ -445,7 +445,7 @@ ret->keyblob_size); } outlen = ret->keyblob_size - ret->keyblob_len; - if (base64_decode(buffer, len, + if (base64_decode((const unsigned char *)buffer, len, ret->keyblob + ret->keyblob_len, &outlen) != CRYPT_OK){ errmsg = "Error decoding base64"; goto error; @@ -507,7 +507,7 @@ int i, num_integers = 0; sign_key *retval = NULL; char *errmsg; - char *modptr = NULL; + unsigned char *modptr = NULL; int modlen = -9999; enum signkey_type type; @@ -646,7 +646,7 @@ */ if (i == 1) { /* Save the details for after we deal with number 2. */ - modptr = (char *)p; + modptr = p; modlen = len; } else if (i >= 2 && i <= 5) { buf_putstring(blobbuf, (const char*)p, len); @@ -1043,7 +1043,7 @@ int curve_oid_len = 0; const void* curve_oid = NULL; unsigned long pubkey_size = 2*curve_size+1; - unsigned int k_size; + int k_size; int err = 0; /* version. less than 10 bytes */ diff -r aaf576b27a10 -r 6aeadee3f16b libtomcrypt/src/ciphers/aes/aes.c --- a/libtomcrypt/src/ciphers/aes/aes.c Thu Jun 04 23:08:50 2015 +0800 +++ b/libtomcrypt/src/ciphers/aes/aes.c Thu Jun 04 23:24:08 2015 +0800 @@ -122,9 +122,10 @@ */ int SETUP(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey) { - int i, j; + int i; ulong32 temp, *rk; #ifndef ENCRYPT_ONLY + int j; ulong32 *rrk; #endif LTC_ARGCHK(key != NULL); @@ -148,7 +149,9 @@ LOAD32H(rk[2], key + 8); LOAD32H(rk[3], key + 12); if (keylen == 16) { + #ifndef ENCRYPT_ONLY j = 44; + #endif for (;;) { temp = rk[3]; rk[4] = rk[0] ^ setup_mix(temp) ^ rcon[i]; @@ -161,7 +164,9 @@ rk += 4; } } else if (keylen == 24) { + #ifndef ENCRYPT_ONLY j = 52; + #endif LOAD32H(rk[4], key + 16); LOAD32H(rk[5], key + 20); for (;;) { @@ -182,7 +187,9 @@ rk += 6; } } else if (keylen == 32) { + #ifndef ENCRYPT_ONLY j = 60; + #endif LOAD32H(rk[4], key + 16); LOAD32H(rk[5], key + 20); LOAD32H(rk[6], key + 24); @@ -728,6 +735,7 @@ */ void ECB_DONE(symmetric_key *skey) { + (void)skey; } diff -r aaf576b27a10 -r 6aeadee3f16b libtomcrypt/src/ciphers/des.c --- a/libtomcrypt/src/ciphers/des.c Thu Jun 04 23:08:50 2015 +0800 +++ b/libtomcrypt/src/ciphers/des.c Thu Jun 04 23:24:08 2015 +0800 @@ -1871,6 +1871,7 @@ */ void des3_done(symmetric_key *skey) { + (void)skey; } diff -r aaf576b27a10 -r 6aeadee3f16b libtomcrypt/src/ciphers/twofish/twofish.c --- a/libtomcrypt/src/ciphers/twofish/twofish.c Thu Jun 04 23:08:50 2015 +0800 +++ b/libtomcrypt/src/ciphers/twofish/twofish.c Thu Jun 04 23:24:08 2015 +0800 @@ -684,6 +684,7 @@ */ void twofish_done(symmetric_key *skey) { + (void)skey; } /** diff -r aaf576b27a10 -r 6aeadee3f16b libtomcrypt/src/hashes/helper/hash_file.c --- a/libtomcrypt/src/hashes/helper/hash_file.c Thu Jun 04 23:08:50 2015 +0800 +++ b/libtomcrypt/src/hashes/helper/hash_file.c Thu Jun 04 23:24:08 2015 +0800 @@ -25,6 +25,7 @@ int hash_file(int hash, const char *fname, unsigned char *out, unsigned long *outlen) { #ifdef LTC_NO_FILE + (void)hash; (void)fname; (void)out; (void)outlen; return CRYPT_NOP; #else FILE *in; diff -r aaf576b27a10 -r 6aeadee3f16b libtomcrypt/src/hashes/helper/hash_filehandle.c --- a/libtomcrypt/src/hashes/helper/hash_filehandle.c Thu Jun 04 23:08:50 2015 +0800 +++ b/libtomcrypt/src/hashes/helper/hash_filehandle.c Thu Jun 04 23:24:08 2015 +0800 @@ -26,6 +26,7 @@ int hash_filehandle(int hash, FILE *in, unsigned char *out, unsigned long *outlen) { #ifdef LTC_NO_FILE + (void)hash; (void)in; (void)out; (void)outlen; return CRYPT_NOP; #else hash_state md; diff -r aaf576b27a10 -r 6aeadee3f16b libtomcrypt/src/mac/hmac/hmac_file.c --- a/libtomcrypt/src/mac/hmac/hmac_file.c Thu Jun 04 23:08:50 2015 +0800 +++ b/libtomcrypt/src/mac/hmac/hmac_file.c Thu Jun 04 23:24:08 2015 +0800 @@ -32,6 +32,7 @@ unsigned char *out, unsigned long *outlen) { #ifdef LTC_NO_FILE + (void)hash; (void)fname; (void)key; (void)keylen; (void)out; (void)outlen; return CRYPT_NOP; #else hmac_state hmac; diff -r aaf576b27a10 -r 6aeadee3f16b libtomcrypt/src/misc/crypt/crypt_argchk.c --- a/libtomcrypt/src/misc/crypt/crypt_argchk.c Thu Jun 04 23:08:50 2015 +0800 +++ b/libtomcrypt/src/misc/crypt/crypt_argchk.c Thu Jun 04 23:24:08 2015 +0800 @@ -21,7 +21,7 @@ { fprintf(stderr, "LTC_ARGCHK '%s' failure on line %d of file %s\n", v, d, s); - (void)raise(SIGABRT); + abort(); } #endif diff -r aaf576b27a10 -r 6aeadee3f16b libtomcrypt/src/pk/ecc/ltc_ecc_mulmod_timing.c --- a/libtomcrypt/src/pk/ecc/ltc_ecc_mulmod_timing.c Thu Jun 04 23:08:50 2015 +0800 +++ b/libtomcrypt/src/pk/ecc/ltc_ecc_mulmod_timing.c Thu Jun 04 23:24:08 2015 +0800 @@ -40,7 +40,7 @@ int i, j, err; void *mu, *mp; unsigned long buf; - int first, bitbuf, bitcpy, bitcnt, mode, digidx; + int bitcnt, mode, digidx; LTC_ARGCHK(k != NULL); LTC_ARGCHK(G != NULL); @@ -98,8 +98,6 @@ bitcnt = 1; buf = 0; digidx = mp_get_digit_count(k) - 1; - bitcpy = bitbuf = 0; - first = 1; /* perform ops */ for (;;) { diff -r aaf576b27a10 -r 6aeadee3f16b rsa.c diff -r aaf576b27a10 -r 6aeadee3f16b session.h --- a/session.h Thu Jun 04 23:08:50 2015 +0800 +++ b/session.h Thu Jun 04 23:24:08 2015 +0800 @@ -63,7 +63,7 @@ /* Client */ void cli_session(int sock_in, int sock_out, struct dropbear_progress_connection *progress) ATTRIB_NORETURN; void cli_connected(int result, int sock, void* userdata, const char *errstring); -void cleantext(unsigned char* dirtytext); +void cleantext(char* dirtytext); /* crypto parameters that are stored individually for transmit and receive */ struct key_context_directional { @@ -115,7 +115,7 @@ /* remotehost will be initially NULL as we delay * reading the remote version string. it will be set * by the time any recv_() packet methods are called */ - unsigned char *remoteident; + char *remoteident; int maxfd; /* the maximum file descriptor to check with select() */ diff -r aaf576b27a10 -r 6aeadee3f16b svr-authpubkeyoptions.c --- a/svr-authpubkeyoptions.c Thu Jun 04 23:08:50 2015 +0800 +++ b/svr-authpubkeyoptions.c Thu Jun 04 23:24:08 2015 +0800 @@ -120,7 +120,7 @@ if (options_buf->len - options_buf->pos < len) { return DROPBEAR_FAILURE; } - if (strncasecmp(buf_getptr(options_buf, len), opt_name, len) == 0) { + if (strncasecmp((const char *) buf_getptr(options_buf, len), opt_name, len) == 0) { buf_incrpos(options_buf, len); return DROPBEAR_SUCCESS; } diff -r aaf576b27a10 -r 6aeadee3f16b tcp-accept.c --- a/tcp-accept.c Thu Jun 04 23:08:50 2015 +0800 +++ b/tcp-accept.c Thu Jun 04 23:24:08 2015 +0800 @@ -75,7 +75,7 @@ } if (send_msg_channel_open_init(fd, tcpinfo->chantype) == DROPBEAR_SUCCESS) { - unsigned char* addr = NULL; + char* addr = NULL; unsigned int port = 0; if (tcpinfo->tcp_type == direct) { diff -r aaf576b27a10 -r 6aeadee3f16b tcpfwd.h --- a/tcpfwd.h Thu Jun 04 23:08:50 2015 +0800 +++ b/tcpfwd.h Thu Jun 04 23:24:08 2015 +0800 @@ -31,16 +31,16 @@ /* For a direct-tcpip request, it's the addr/port we want the other * end to connect to */ - unsigned char *sendaddr; + char *sendaddr; unsigned int sendport; /* This is the address/port that we listen on. The address has special * meanings as per the rfc, "" for all interfaces, "localhost" for * localhost, or a normal interface name. */ - unsigned char *listenaddr; + char *listenaddr; unsigned int listenport; /* The address that the remote host asked to listen on */ - unsigned char *request_listenaddr; + char *request_listenaddr; const struct ChanType *chantype; enum {direct, forwarded} tcp_type; @@ -48,9 +48,9 @@ /* A forwarding entry */ struct TCPFwdEntry { - const unsigned char* connectaddr; + const char *connectaddr; unsigned int connectport; - const unsigned char* listenaddr; + const char *listenaddr; unsigned int listenport; unsigned int have_reply; /* is set to 1 after a reply has been received when setting up the forwarding */