# HG changeset patch # User Gaƫl PORTAY # Date 1430575146 -7200 # Node ID c45d65392c1abc0adf9490db172fa217de1f09ce # Parent aae71c5f7d5bb05dd1487237958446d33fb8d834 Fix pointer differ in signess warnings [-Werror=pointer-sign] diff -r aae71c5f7d5b -r c45d65392c1a auth.h --- a/auth.h Sat May 02 16:02:22 2015 +0200 +++ b/auth.h Sat May 02 15:59:06 2015 +0200 @@ -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 aae71c5f7d5b -r c45d65392c1a cli-auth.c --- a/cli-auth.c Sat May 02 16:02:22 2015 +0200 +++ b/cli-auth.c Sat May 02 15:59:06 2015 +0200 @@ -43,11 +43,11 @@ TRACE(("enter cli_auth_getmethods")) CHECKCLEARTOWRITE(); buf_putbyte(ses.writepayload, SSH_MSG_USERAUTH_REQUEST); - buf_putstring(ses.writepayload, cli_opts.username, + buf_putstring(ses.writepayload, (const unsigned char *)cli_opts.username, strlen(cli_opts.username)); - buf_putstring(ses.writepayload, SSH_SERVICE_CONNECTION, + buf_putstring(ses.writepayload, (const unsigned char *)SSH_SERVICE_CONNECTION, SSH_SERVICE_CONNECTION_LEN); - buf_putstring(ses.writepayload, "none", 4); /* 'none' method */ + buf_putstring(ses.writepayload, (const unsigned char *)"none", 4); /* 'none' method */ encrypt_packet(); diff -r aae71c5f7d5b -r c45d65392c1a cli-authinteract.c --- a/cli-authinteract.c Sat May 02 16:02:22 2015 +0200 +++ b/cli-authinteract.c Sat May 02 15:59:06 2015 +0200 @@ -149,22 +149,22 @@ buf_putbyte(ses.writepayload, SSH_MSG_USERAUTH_REQUEST); /* username */ - buf_putstring(ses.writepayload, cli_opts.username, + buf_putstring(ses.writepayload, (const unsigned char *)cli_opts.username, strlen(cli_opts.username)); /* service name */ - buf_putstring(ses.writepayload, SSH_SERVICE_CONNECTION, + buf_putstring(ses.writepayload, (const unsigned char *)SSH_SERVICE_CONNECTION, SSH_SERVICE_CONNECTION_LEN); /* method */ - buf_putstring(ses.writepayload, AUTH_METHOD_INTERACT, + buf_putstring(ses.writepayload, (const unsigned char *)AUTH_METHOD_INTERACT, AUTH_METHOD_INTERACT_LEN); /* empty language tag */ - buf_putstring(ses.writepayload, "", 0); + buf_putstring(ses.writepayload, (const unsigned char *)"", 0); /* empty submethods */ - buf_putstring(ses.writepayload, "", 0); + buf_putstring(ses.writepayload, (const unsigned char *)"", 0); encrypt_packet(); cli_ses.interact_request_received = 0; diff -r aae71c5f7d5b -r c45d65392c1a cli-authpasswd.c --- a/cli-authpasswd.c Sat May 02 16:02:22 2015 +0200 +++ b/cli-authpasswd.c Sat May 02 15:59:06 2015 +0200 @@ -140,18 +140,18 @@ buf_putbyte(ses.writepayload, SSH_MSG_USERAUTH_REQUEST); - buf_putstring(ses.writepayload, cli_opts.username, + buf_putstring(ses.writepayload, (const unsigned char *)cli_opts.username, strlen(cli_opts.username)); - buf_putstring(ses.writepayload, SSH_SERVICE_CONNECTION, + buf_putstring(ses.writepayload, (const unsigned char *)SSH_SERVICE_CONNECTION, SSH_SERVICE_CONNECTION_LEN); - buf_putstring(ses.writepayload, AUTH_METHOD_PASSWORD, + buf_putstring(ses.writepayload, (const unsigned char *)AUTH_METHOD_PASSWORD, AUTH_METHOD_PASSWORD_LEN); buf_putbyte(ses.writepayload, 0); /* FALSE - so says the spec */ - buf_putstring(ses.writepayload, password, strlen(password)); + buf_putstring(ses.writepayload, (const unsigned char *)password, strlen(password)); encrypt_packet(); m_burn(password, strlen(password)); diff -r aae71c5f7d5b -r c45d65392c1a cli-authpubkey.c --- a/cli-authpubkey.c Sat May 02 16:02:22 2015 +0200 +++ b/cli-authpubkey.c Sat May 02 15:59:06 2015 +0200 @@ -63,7 +63,7 @@ TRACE(("enter recv_msg_userauth_pk_ok")) - algotype = buf_getstring(ses.payload, &algolen); + algotype = (char *)buf_getstring(ses.payload, &algolen); keytype = signkey_type_from_name(algotype, algolen); TRACE(("recv_msg_userauth_pk_ok: type %d", keytype)) m_free(algotype); @@ -141,7 +141,7 @@ static void send_msg_userauth_pubkey(sign_key *key, int type, int realsign) { const char *algoname = NULL; - int algolen; + unsigned int algolen; buffer* sigbuf = NULL; TRACE(("enter send_msg_userauth_pubkey")) @@ -149,20 +149,20 @@ buf_putbyte(ses.writepayload, SSH_MSG_USERAUTH_REQUEST); - buf_putstring(ses.writepayload, cli_opts.username, + buf_putstring(ses.writepayload, (const unsigned char *)cli_opts.username, strlen(cli_opts.username)); - buf_putstring(ses.writepayload, SSH_SERVICE_CONNECTION, + buf_putstring(ses.writepayload, (const unsigned char *)SSH_SERVICE_CONNECTION, SSH_SERVICE_CONNECTION_LEN); - buf_putstring(ses.writepayload, AUTH_METHOD_PUBKEY, + buf_putstring(ses.writepayload, (const unsigned char *)AUTH_METHOD_PUBKEY, AUTH_METHOD_PUBKEY_LEN); buf_putbyte(ses.writepayload, realsign); algoname = signkey_name_from_type(type, &algolen); - buf_putstring(ses.writepayload, algoname, algolen); + buf_putstring(ses.writepayload, (const unsigned char *)algoname, algolen); buf_put_pub_key(ses.writepayload, key, type); if (realsign) { diff -r aae71c5f7d5b -r c45d65392c1a cli-chansession.c --- a/cli-chansession.c Sat May 02 16:02:22 2015 +0200 +++ b/cli-chansession.c Sat May 02 15:59:06 2015 +0200 @@ -261,7 +261,7 @@ CHECKCLEARTOWRITE(); buf_putbyte(ses.writepayload, SSH_MSG_CHANNEL_REQUEST); buf_putint(ses.writepayload, channel->remotechan); - buf_putstring(ses.writepayload, "window-change", 13); + buf_putstring(ses.writepayload, (const unsigned char *) "window-change", 13); buf_putbyte(ses.writepayload, 0); /* FALSE says the spec */ put_winsize(); encrypt_packet(); @@ -324,7 +324,7 @@ /* XXX TODO */ buf_putbyte(ses.writepayload, 0); /* Don't want replies */ if (cli_opts.cmd) { - buf_putstring(ses.writepayload, cli_opts.cmd, strlen(cli_opts.cmd)); + buf_putstring(ses.writepayload, (const unsigned char *)cli_opts.cmd, strlen(cli_opts.cmd)); } encrypt_packet(); @@ -392,7 +392,7 @@ void cli_send_netcat_request() { - const unsigned char* source_host = "127.0.0.1"; + const char* source_host = "127.0.0.1"; const int source_port = 22; TRACE(("enter cli_send_netcat_request")) @@ -403,12 +403,12 @@ dropbear_exit("Couldn't open initial channel"); } - buf_putstring(ses.writepayload, cli_opts.netcat_host, + buf_putstring(ses.writepayload, (const unsigned char *)cli_opts.netcat_host, strlen(cli_opts.netcat_host)); buf_putint(ses.writepayload, cli_opts.netcat_port); /* originator ip - localhost is accurate enough */ - buf_putstring(ses.writepayload, source_host, strlen(source_host)); + buf_putstring(ses.writepayload, (const unsigned char *)source_host, strlen(source_host)); buf_putint(ses.writepayload, source_port); encrypt_packet(); diff -r aae71c5f7d5b -r c45d65392c1a cli-kex.c --- a/cli-kex.c Sat May 02 16:02:22 2015 +0200 +++ b/cli-kex.c Sat May 02 15:59:06 2015 +0200 @@ -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 aae71c5f7d5b -r c45d65392c1a cli-session.c --- a/cli-session.c Sat May 02 16:02:22 2015 +0200 +++ b/cli-session.c Sat May 02 15:59:06 2015 +0200 @@ -192,7 +192,7 @@ CHECKCLEARTOWRITE(); buf_putbyte(ses.writepayload, SSH_MSG_SERVICE_REQUEST); - buf_putstring(ses.writepayload, servicename, strlen(servicename)); + buf_putstring(ses.writepayload, (const unsigned char *)servicename, strlen(servicename)); encrypt_packet(); TRACE(("leave send_msg_service_request")) diff -r aae71c5f7d5b -r c45d65392c1a cli-tcpfwd.c --- a/cli-tcpfwd.c Sat May 02 16:02:22 2015 +0200 +++ b/cli-tcpfwd.c Sat May 02 15:59:06 2015 +0200 @@ -136,9 +136,9 @@ CHECKCLEARTOWRITE(); buf_putbyte(ses.writepayload, SSH_MSG_GLOBAL_REQUEST); - buf_putstring(ses.writepayload, "tcpip-forward", 13); + buf_putstring(ses.writepayload, (const unsigned char *)"tcpip-forward", 13); buf_putbyte(ses.writepayload, 1); /* want_reply */ - buf_putstring(ses.writepayload, addr, strlen(addr)); + buf_putstring(ses.writepayload, (const unsigned char *)addr, strlen(addr)); buf_putint(ses.writepayload, port); encrypt_packet(); @@ -218,7 +218,7 @@ char portstring[NI_MAXSERV]; int err = SSH_OPEN_ADMINISTRATIVELY_PROHIBITED; - origaddr = buf_getstring(ses.payload, NULL); + origaddr = (char *)buf_getstring(ses.payload, NULL); origport = buf_getint(ses.payload); /* Find which port corresponds. First try and match address as well as port, diff -r aae71c5f7d5b -r c45d65392c1a common-algo.c --- a/common-algo.c Sat May 02 16:02:22 2015 +0200 +++ b/common-algo.c Sat May 02 15:59:06 2015 +0200 @@ -338,19 +338,19 @@ enum kexguess2_used *kexguess2, int *goodguess) { - unsigned char * algolist = NULL; - const unsigned char *remotenames[MAX_PROPOSED_ALGO], *localnames[MAX_PROPOSED_ALGO]; + char * algolist = NULL; + const char *remotenames[MAX_PROPOSED_ALGO], *localnames[MAX_PROPOSED_ALGO]; unsigned int len; unsigned int remotecount, localcount, clicount, servcount, i, j; algo_type * ret = NULL; - const unsigned char **clinames, **servnames; + const char **clinames, **servnames; if (goodguess) { *goodguess = 0; } /* get the comma-separated list from the buffer ie "algo1,algo2,algo3" */ - algolist = buf_getstring(buf, &len); + algolist = (char *) buf_getstring(buf, &len); TRACE(("buf_match_algo: %s", algolist)) if (len > MAX_PROPOSED_ALGO*(MAX_NAME_LEN+1)) { goto out; @@ -488,7 +488,7 @@ buf_setpos(b, b->len); buf_putbyte(b, '\0'); buf_setpos(b, 4); - ret_list = m_strdup(buf_getptr(b, b->len - b->pos)); + ret_list = m_strdup((const char *) buf_getptr(b, b->len - b->pos)); buf_free(b); return ret_list; } diff -r aae71c5f7d5b -r c45d65392c1a common-channel.c --- a/common-channel.c Sat May 02 16:02:22 2015 +0200 +++ b/common-channel.c Sat May 02 15:59:06 2015 +0200 @@ -921,7 +921,7 @@ /* Handle a new channel request, performing any channel-type-specific setup */ void recv_msg_channel_open() { - unsigned char *type; + char *type; unsigned int typelen; unsigned int remotechan, transwindow, transmaxpacket; struct Channel *channel; @@ -934,7 +934,7 @@ TRACE(("enter recv_msg_channel_open")) /* get the packet contents */ - type = buf_getstring(ses.payload, &typelen); + type = (char *) buf_getstring(ses.payload, &typelen); remotechan = buf_getint(ses.payload); transwindow = buf_getint(ses.payload); @@ -1149,7 +1149,7 @@ CHECKCLEARTOWRITE(); buf_putbyte(ses.writepayload, SSH_MSG_CHANNEL_OPEN); - buf_putstring(ses.writepayload, type->name, strlen(type->name)); + buf_putstring(ses.writepayload, (const unsigned char *) type->name, strlen(type->name)); buf_putint(ses.writepayload, chan->index); buf_putint(ses.writepayload, opts.recv_window); buf_putint(ses.writepayload, RECV_MAX_CHANNEL_DATA_LEN); diff -r aae71c5f7d5b -r c45d65392c1a common-kex.c --- a/common-kex.c Sat May 02 16:02:22 2015 +0200 +++ b/common-kex.c Sat May 02 15:59:06 2015 +0200 @@ -128,10 +128,10 @@ buf_put_algolist(ses.writepayload, ses.compress_algos); /* languages_client_to_server */ - buf_putstring(ses.writepayload, "", 0); + buf_putstring(ses.writepayload, (const unsigned char *) "", 0); /* languages_server_to_client */ - buf_putstring(ses.writepayload, "", 0); + buf_putstring(ses.writepayload, (const unsigned char *) "", 0); /* first_kex_packet_follows */ buf_putbyte(ses.writepayload, (ses.send_kex_first_guess != NULL)); diff -r aae71c5f7d5b -r c45d65392c1a common-session.c --- a/common-session.c Sat May 02 16:02:22 2015 +0200 +++ b/common-session.c Sat May 02 15:59:06 2015 +0200 @@ -329,7 +329,7 @@ void send_session_identification() { buffer *writebuf = buf_new(strlen(LOCAL_IDENT "\r\n") + 1); - buf_putbytes(writebuf, LOCAL_IDENT "\r\n", strlen(LOCAL_IDENT "\r\n")); + buf_putbytes(writebuf, (const unsigned char *) LOCAL_IDENT "\r\n", strlen(LOCAL_IDENT "\r\n")); writebuf_enqueue(writebuf, 0); } @@ -469,7 +469,7 @@ /* Some peers will reply with SSH_MSG_REQUEST_FAILURE, some will reply with SSH_MSG_UNIMPLEMENTED, some will exit. */ buf_putbyte(ses.writepayload, SSH_MSG_GLOBAL_REQUEST); - buf_putstring(ses.writepayload, DROPBEAR_KEEPALIVE_STRING, + buf_putstring(ses.writepayload, (const unsigned char *) DROPBEAR_KEEPALIVE_STRING, strlen(DROPBEAR_KEEPALIVE_STRING)); } buf_putbyte(ses.writepayload, 1); /* want_reply */ diff -r aae71c5f7d5b -r c45d65392c1a dss.c --- a/dss.c Sat May 02 16:02:22 2015 +0200 +++ b/dss.c Sat May 02 15:59:06 2015 +0200 @@ -136,7 +136,7 @@ void buf_put_dss_pub_key(buffer* buf, dropbear_dss_key *key) { dropbear_assert(key != NULL); - buf_putstring(buf, SSH_SIGNKEY_DSS, SSH_SIGNKEY_DSS_LEN); + buf_putstring(buf, (const unsigned char*) SSH_SIGNKEY_DSS, SSH_SIGNKEY_DSS_LEN); buf_putmpint(buf, key->p); buf_putmpint(buf, key->q); buf_putmpint(buf, key->g); @@ -165,7 +165,7 @@ DEF_MP_INT(val3); DEF_MP_INT(val4); char * string = NULL; - int stringlen; + unsigned int stringlen; TRACE(("enter buf_dss_verify")) dropbear_assert(key != NULL); @@ -173,7 +173,7 @@ m_mp_init_multi(&val1, &val2, &val3, &val4, NULL); /* get blob, check length */ - string = buf_getstring(buf, &stringlen); + string = (char*) buf_getstring(buf, &stringlen); if (stringlen != 2*SHA1_HASH_SIZE) { goto out; } @@ -186,7 +186,7 @@ /* create the signature - s' and r' are the received signatures in buf */ /* w = (s')-1 mod q */ /* let val1 = s' */ - bytes_to_mp(&val1, &string[SHA1_HASH_SIZE], SHA1_HASH_SIZE); + bytes_to_mp(&val1, (const unsigned char*) &string[SHA1_HASH_SIZE], SHA1_HASH_SIZE); if (mp_cmp(&val1, key->q) != MP_LT) { TRACE(("verify failed, s' >= q")) @@ -208,7 +208,7 @@ /* u2 = ((r')w) mod q */ /* let val1 = r' */ - bytes_to_mp(&val1, &string[0], SHA1_HASH_SIZE); + bytes_to_mp(&val1, (const unsigned char*) &string[0], SHA1_HASH_SIZE); if (mp_cmp(&val1, key->q) != MP_LT) { TRACE(("verify failed, r' >= q")) goto out; @@ -310,7 +310,7 @@ dropbear_exit("DSS error"); } - buf_putstring(buf, SSH_SIGNKEY_DSS, SSH_SIGNKEY_DSS_LEN); + buf_putstring(buf, (const unsigned char*) SSH_SIGNKEY_DSS, SSH_SIGNKEY_DSS_LEN); buf_putint(buf, 2*SHA1_HASH_SIZE); writelen = mp_unsigned_bin_size(&dss_r); diff -r aae71c5f7d5b -r c45d65392c1a gendss.c --- a/gendss.c Sat May 02 16:02:22 2015 +0200 +++ b/gendss.c Sat May 02 15:59:06 2015 +0200 @@ -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 aae71c5f7d5b -r c45d65392c1a keyimport.c --- a/keyimport.c Sat May 02 16:02:22 2015 +0200 +++ b/keyimport.c Sat May 02 15:59:06 2015 +0200 @@ -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; @@ -602,13 +602,13 @@ #ifdef DROPBEAR_DSS if (key->type == OSSH_DSA) { - buf_putstring(blobbuf, "ssh-dss", 7); + buf_putstring(blobbuf, (const unsigned char *)"ssh-dss", 7); retkey->type = DROPBEAR_SIGNKEY_DSS; } #endif #ifdef DROPBEAR_RSA if (key->type == OSSH_RSA) { - buf_putstring(blobbuf, "ssh-rsa", 7); + buf_putstring(blobbuf, (const unsigned char *)"ssh-rsa", 7); retkey->type = DROPBEAR_SIGNKEY_RSA; } #endif diff -r aae71c5f7d5b -r c45d65392c1a netio.c --- a/netio.c Sat May 02 16:02:22 2015 +0200 +++ b/netio.c Sat May 02 15:59:06 2015 +0200 @@ -100,7 +100,7 @@ if (c->writequeue) { /* 6 is arbitrary, enough to hold initial packets */ - int iovlen = 6; /* Linux msg_iovlen is a size_t */ + unsigned int iovlen = 6; /* Linux msg_iovlen is a size_t */ struct iovec iov[6]; packet_queue_to_iovec(c->writequeue, iov, &iovlen); message.msg_iov = iov; diff -r aae71c5f7d5b -r c45d65392c1a rsa.c --- a/rsa.c Sat May 02 16:02:22 2015 +0200 +++ b/rsa.c Sat May 02 15:59:06 2015 +0200 @@ -174,7 +174,7 @@ TRACE(("enter buf_put_rsa_pub_key")) dropbear_assert(key != NULL); - buf_putstring(buf, SSH_SIGNKEY_RSA, SSH_SIGNKEY_RSA_LEN); + buf_putstring(buf, (const unsigned char *) SSH_SIGNKEY_RSA, SSH_SIGNKEY_RSA_LEN); buf_putmpint(buf, key->e); buf_putmpint(buf, key->n); @@ -327,7 +327,7 @@ mp_clear_multi(&rsa_tmp1, &rsa_tmp2, &rsa_tmp3, NULL); /* create the signature to return */ - buf_putstring(buf, SSH_SIGNKEY_RSA, SSH_SIGNKEY_RSA_LEN); + buf_putstring(buf, (const unsigned char *) SSH_SIGNKEY_RSA, SSH_SIGNKEY_RSA_LEN); nsize = mp_unsigned_bin_size(key->n); diff -r aae71c5f7d5b -r c45d65392c1a signkey.c --- a/signkey.c Sat May 02 16:02:22 2015 +0200 +++ b/signkey.c Sat May 02 15:59:06 2015 +0200 @@ -138,14 +138,14 @@ * on return is set to the type read (useful when type = _ANY) */ int buf_get_pub_key(buffer *buf, sign_key *key, enum signkey_type *type) { - unsigned char* ident; + char *ident; unsigned int len; enum signkey_type keytype; int ret = DROPBEAR_FAILURE; TRACE2(("enter buf_get_pub_key")) - ident = buf_getstring(buf, &len); + ident = (char *) buf_getstring(buf, &len); keytype = signkey_type_from_name(ident, len); m_free(ident); @@ -209,14 +209,14 @@ * on return is set to the type read (useful when type = _ANY) */ int buf_get_priv_key(buffer *buf, sign_key *key, enum signkey_type *type) { - unsigned char* ident; + char *ident; unsigned int len; enum signkey_type keytype; int ret = DROPBEAR_FAILURE; TRACE2(("enter buf_get_priv_key")) - ident = buf_getstring(buf, &len); + ident = (char *)buf_getstring(buf, &len); keytype = signkey_type_from_name(ident, len); m_free(ident); @@ -515,14 +515,14 @@ * signature blob */ int buf_verify(buffer * buf, sign_key *key, buffer *data_buf) { - unsigned char * type_name = NULL; + char *type_name = NULL; unsigned int type_name_len = 0; enum signkey_type type; TRACE(("enter buf_verify")) buf_getint(buf); /* blob length */ - type_name = buf_getstring(buf, &type_name_len); + type_name = (char *) buf_getstring(buf, &type_name_len); type = signkey_type_from_name(type_name, type_name_len); m_free(type_name); diff -r aae71c5f7d5b -r c45d65392c1a svr-auth.c --- a/svr-auth.c Sat May 02 16:02:22 2015 +0200 +++ b/svr-auth.c Sat May 02 15:59:06 2015 +0200 @@ -89,7 +89,7 @@ buf_putbyte(ses.writepayload, SSH_MSG_USERAUTH_BANNER); buf_putbufstring(ses.writepayload, banner); - buf_putstring(ses.writepayload, "en", 2); + buf_putstring(ses.writepayload, (const unsigned char *)"en", 2); encrypt_packet(); @@ -333,14 +333,14 @@ typebuf = buf_new(30); /* long enough for PUBKEY and PASSWORD */ if (ses.authstate.authtypes & AUTH_TYPE_PUBKEY) { - buf_putbytes(typebuf, AUTH_METHOD_PUBKEY, AUTH_METHOD_PUBKEY_LEN); + buf_putbytes(typebuf, (const unsigned char *)AUTH_METHOD_PUBKEY, AUTH_METHOD_PUBKEY_LEN); if (ses.authstate.authtypes & AUTH_TYPE_PASSWORD) { buf_putbyte(typebuf, ','); } } if (ses.authstate.authtypes & AUTH_TYPE_PASSWORD) { - buf_putbytes(typebuf, AUTH_METHOD_PASSWORD, AUTH_METHOD_PASSWORD_LEN); + buf_putbytes(typebuf, (const unsigned char *)AUTH_METHOD_PASSWORD, AUTH_METHOD_PASSWORD_LEN); } buf_putbufstring(ses.writepayload, typebuf); diff -r aae71c5f7d5b -r c45d65392c1a svr-authpubkey.c --- a/svr-authpubkey.c Sat May 02 16:02:22 2015 +0200 +++ b/svr-authpubkey.c Sat May 02 15:59:06 2015 +0200 @@ -260,9 +260,9 @@ /* check the key type - will fail if there are options */ TRACE(("a line!")) - if (strncmp(buf_getptr(line, algolen), algo, algolen) != 0) { + if (strncmp((const char *) buf_getptr(line, algolen), algo, algolen) != 0) { int is_comment = 0; - char *options_start = NULL; + unsigned char *options_start = NULL; int options_len = 0; int escape, quoted; @@ -308,7 +308,7 @@ if (line->pos + algolen+3 > line->len) { continue; } - if (strncmp(buf_getptr(line, algolen), algo, algolen) != 0) { + if (strncmp((const char *) buf_getptr(line, algolen), algo, algolen) != 0) { continue; } } diff -r aae71c5f7d5b -r c45d65392c1a svr-authpubkeyoptions.c --- a/svr-authpubkeyoptions.c Sat May 02 16:02:22 2015 +0200 +++ b/svr-authpubkeyoptions.c Sat May 02 15:59:06 2015 +0200 @@ -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 aae71c5f7d5b -r c45d65392c1a svr-chansession.c --- a/svr-chansession.c Sat May 02 16:02:22 2015 +0200 +++ b/svr-chansession.c Sat May 02 15:59:06 2015 +0200 @@ -183,7 +183,7 @@ buf_putbyte(ses.writepayload, SSH_MSG_CHANNEL_REQUEST); buf_putint(ses.writepayload, channel->remotechan); - buf_putstring(ses.writepayload, "exit-status", 11); + buf_putstring(ses.writepayload, (const unsigned char *) "exit-status", 11); buf_putbyte(ses.writepayload, 0); /* boolean FALSE */ buf_putint(ses.writepayload, chansess->exit.exitstatus); @@ -219,12 +219,12 @@ buf_putbyte(ses.writepayload, SSH_MSG_CHANNEL_REQUEST); buf_putint(ses.writepayload, channel->remotechan); - buf_putstring(ses.writepayload, "exit-signal", 11); + buf_putstring(ses.writepayload, (const unsigned char *) "exit-signal", 11); buf_putbyte(ses.writepayload, 0); /* boolean FALSE */ buf_putstring(ses.writepayload, signame, strlen(signame)); buf_putbyte(ses.writepayload, chansess->exit.exitcore); - buf_putstring(ses.writepayload, "", 0); /* error msg */ - buf_putstring(ses.writepayload, "", 0); /* lang */ + buf_putstring(ses.writepayload, (const unsigned char *) "", 0); /* error msg */ + buf_putstring(ses.writepayload, (const unsigned char *) "", 0); /* lang */ encrypt_packet(); } @@ -557,7 +557,7 @@ static int sessionpty(struct ChanSess * chansess) { unsigned int termlen; - unsigned char namebuf[65]; + char namebuf[65]; struct passwd * pw = NULL; TRACE(("enter sessionpty")) diff -r aae71c5f7d5b -r c45d65392c1a svr-tcpfwd.c --- a/svr-tcpfwd.c Sat May 02 16:02:22 2015 +0200 +++ b/svr-tcpfwd.c Sat May 02 15:59:06 2015 +0200 @@ -237,7 +237,7 @@ unsigned char* orighost = NULL; unsigned int origport; char portstring[NI_MAXSERV]; - int len; + unsigned int len; int err = SSH_OPEN_ADMINISTRATIVELY_PROHIBITED; TRACE(("newtcpdirect channel %d", channel->index)) diff -r aae71c5f7d5b -r c45d65392c1a svr-x11fwd.c --- a/svr-x11fwd.c Sat May 02 16:02:22 2015 +0200 +++ b/svr-x11fwd.c Sat May 02 15:59:06 2015 +0200 @@ -58,8 +58,8 @@ } chansess->x11singleconn = buf_getbool(ses.payload); - chansess->x11authprot = buf_getstring(ses.payload, NULL); - chansess->x11authcookie = buf_getstring(ses.payload, NULL); + chansess->x11authprot = (char *)buf_getstring(ses.payload, NULL); + chansess->x11authcookie = (char *)buf_getstring(ses.payload, NULL); chansess->x11screennum = buf_getint(ses.payload); /* create listening socket */ @@ -203,7 +203,7 @@ if (send_msg_channel_open_init(fd, &chan_x11) == DROPBEAR_SUCCESS) { ipstring = inet_ntoa(addr->sin_addr); - buf_putstring(ses.writepayload, ipstring, strlen(ipstring)); + buf_putstring(ses.writepayload, (const unsigned char *)ipstring, strlen(ipstring)); buf_putint(ses.writepayload, addr->sin_port); encrypt_packet(); diff -r aae71c5f7d5b -r c45d65392c1a tcp-accept.c --- a/tcp-accept.c Sat May 02 16:02:22 2015 +0200 +++ b/tcp-accept.c Sat May 02 15:59:06 2015 +0200 @@ -98,7 +98,7 @@ buf_putint(ses.writepayload, port); /* originator ip */ - buf_putstring(ses.writepayload, ipstring, strlen(ipstring)); + buf_putstring(ses.writepayload, (const unsigned char *)ipstring, strlen(ipstring)); /* originator port */ buf_putint(ses.writepayload, atol(portstring));