Commit 9fdab3ce authored by Gaël PORTAY's avatar Gaël PORTAY
Browse files

Merge branch 'fix-pointer-sign-warnings' into fix-warnings

parents ef0aac43 6e15e753
......@@ -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 */
......
......@@ -133,7 +133,7 @@ struct PubKeyOptions {
int no_x11_forwarding_flag;
int no_pty_flag;
/* "command=" option. */
unsigned char * forced_command;
char * forced_command;
};
#endif
......
......@@ -135,7 +135,7 @@ int send_msg_channel_open_init(int fd, const struct ChanType *type);
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();
......
......@@ -39,14 +39,14 @@ struct exitinfo {
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;
......
......@@ -43,11 +43,11 @@ void cli_auth_getmethods() {
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();
......@@ -75,7 +75,7 @@ void cli_auth_getmethods() {
void recv_msg_userauth_banner() {
unsigned char* banner = NULL;
char* banner = NULL;
unsigned int bannerlen;
unsigned int i, linecount;
......@@ -85,7 +85,7 @@ void recv_msg_userauth_banner() {
return;
}
banner = buf_getstring(ses.payload, &bannerlen);
banner = (char *)buf_getstring(ses.payload, &bannerlen);
buf_eatstring(ses.payload); /* The language string */
if (bannerlen > MAX_BANNER_SIZE) {
......@@ -151,8 +151,8 @@ void recv_msg_userauth_specific_60() {
void recv_msg_userauth_failure() {
unsigned char * methods = NULL;
unsigned char * tok = NULL;
char * methods = NULL;
char * tok = NULL;
unsigned int methlen = 0;
unsigned int partial = 0;
unsigned int i = 0;
......@@ -201,7 +201,7 @@ void recv_msg_userauth_failure() {
cli_ses.lastauthtype = AUTH_TYPE_NONE;
}
methods = buf_getstring(ses.payload, &methlen);
methods = (char *)buf_getstring(ses.payload, &methlen);
partial = buf_getbool(ses.payload);
......
......@@ -31,10 +31,10 @@
#ifdef ENABLE_CLI_INTERACT_AUTH
static unsigned char* get_response(unsigned char* prompt)
static char* get_response(char* prompt)
{
FILE* tty = NULL;
unsigned char* response = NULL;
char* response = NULL;
/* not a password, but a reasonable limit */
char buf[DROPBEAR_MAX_CLI_PASS];
char* ret = NULL;
......@@ -50,13 +50,13 @@ static unsigned char* get_response(unsigned char* prompt)
}
if (ret == NULL) {
response = (unsigned char*)m_strdup("");
response = m_strdup("");
} else {
unsigned int buflen = strlen(buf);
/* fgets includes newlines */
if (buflen > 0 && buf[buflen-1] == '\n')
buf[buflen-1] = '\0';
response = (unsigned char*)m_strdup(buf);
response = m_strdup(buf);
}
m_burn(buf, sizeof(buf));
......@@ -66,14 +66,14 @@ static unsigned char* get_response(unsigned char* prompt)
void recv_msg_userauth_info_request() {
unsigned char *name = NULL;
unsigned char *instruction = NULL;
char *name = NULL;
char *instruction = NULL;
unsigned int num_prompts = 0;
unsigned int i;
unsigned char *prompt = NULL;
char *prompt = NULL;
unsigned int echo = 0;
unsigned char *response = NULL;
char *response = NULL;
TRACE(("enter recv_msg_recv_userauth_info_request"))
......@@ -84,8 +84,8 @@ void recv_msg_userauth_info_request() {
}
cli_ses.interact_request_received = 1;
name = buf_getstring(ses.payload, NULL);
instruction = buf_getstring(ses.payload, NULL);
name = (char *)buf_getstring(ses.payload, NULL);
instruction = (char *)buf_getstring(ses.payload, NULL);
/* language tag */
buf_eatstring(ses.payload);
......@@ -115,13 +115,13 @@ void recv_msg_userauth_info_request() {
for (i = 0; i < num_prompts; i++) {
unsigned int response_len = 0;
prompt = buf_getstring(ses.payload, NULL);
prompt = (char *)buf_getstring(ses.payload, NULL);
cleantext(prompt);
echo = buf_getbool(ses.payload);
if (!echo) {
unsigned char* p = getpass_or_cancel(prompt);
char* p = getpass_or_cancel(prompt);
response = m_strdup(p);
m_burn(p, strlen(p));
} else {
......@@ -129,7 +129,7 @@ void recv_msg_userauth_info_request() {
}
response_len = strlen(response);
buf_putstring(ses.writepayload, response, response_len);
buf_putstring(ses.writepayload, (const unsigned char *)response, response_len);
m_burn(response, response_len);
m_free(prompt);
m_free(response);
......@@ -149,22 +149,22 @@ void cli_auth_interactive() {
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;
......
......@@ -140,18 +140,18 @@ void cli_auth_password() {
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));
......
......@@ -63,7 +63,7 @@ void recv_msg_userauth_pk_ok() {
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 @@ void cli_buf_put_sign(buffer* buf, sign_key *key, int type,
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 @@ static void send_msg_userauth_pubkey(sign_key *key, int type, int realsign) {
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) {
......
......@@ -56,12 +56,12 @@ const struct ChanType clichansess = {
static void cli_chansessreq(struct Channel *channel) {
unsigned char* type = NULL;
char* type = NULL;
int wantreply;
TRACE(("enter cli_chansessreq"))
type = buf_getstring(ses.payload, NULL);
type = (char *) buf_getstring(ses.payload, NULL);
wantreply = buf_getbool(ses.payload);
if (strcmp(type, "exit-status") == 0) {
......@@ -261,7 +261,7 @@ void cli_chansess_winchange() {
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();
......@@ -272,7 +272,7 @@ void cli_chansess_winchange() {
static void send_chansess_pty_req(struct Channel *channel) {
unsigned char* term = NULL;
char* term = NULL;
TRACE(("enter send_chansess_pty_req"))
......@@ -286,7 +286,7 @@ static void send_chansess_pty_req(struct Channel *channel) {
if (term == NULL) {
term = "vt100"; /* Seems a safe default */
}
buf_putstring(ses.writepayload, term, strlen(term));
buf_putstring(ses.writepayload, (const unsigned char *)term, strlen(term));
/* Window size */
put_winsize();
......@@ -305,7 +305,7 @@ static void send_chansess_pty_req(struct Channel *channel) {
static void send_chansess_shell_req(struct Channel *channel) {
unsigned char* reqtype = NULL;
char* reqtype = NULL;
TRACE(("enter send_chansess_shell_req"))
......@@ -324,7 +324,7 @@ static void send_chansess_shell_req(struct Channel *channel) {
/* 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 @@ static const struct ChanType cli_chan_netcat = {
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 @@ void cli_send_netcat_request() {
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();
......
......@@ -322,7 +322,7 @@ static void checkhostkey(unsigned char* keyblob, unsigned int keybloblen) {
}
/* 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 @@ static void checkhostkey(unsigned char* keyblob, unsigned int keybloblen) {
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 @@ static void checkhostkey(unsigned char* keyblob, unsigned int keybloblen) {
}
/* 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 @@ static void checkhostkey(unsigned char* keyblob, unsigned int keybloblen) {
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
......
......@@ -192,7 +192,7 @@ static void send_msg_service_request(char* servicename) {
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"))
......@@ -372,10 +372,10 @@ static void cli_remoteclosed() {
/* Operates in-place turning dirty (untrusted potentially containing control
* characters) text into clean text.
* Note: this is safe only with ascii - other charsets could have problems. */
void cleantext(unsigned char* dirtytext) {
void cleantext(char* dirtytext) {
unsigned int i, j;
unsigned char c;
char c;
j = 0;
for (i = 0; dirtytext[i] != '\0'; i++) {
......
......@@ -136,9 +136,9 @@ static void send_msg_global_request_remotetcp(const char *addr, int port) {
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 @@ static int newtcpforwarded(struct Channel * channel) {
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,
......
......@@ -322,7 +322,7 @@ void buf_put_algolist(buffer * buf, algo_type localalgos[]) {
buf_putbyte(algolist, ',');
donefirst = 1;
len = strlen(localalgos[i].name);
buf_putbytes(algolist, localalgos[i].name, len);
buf_putbytes(algolist, (const unsigned char *) localalgos[i].name, len);
}
}
buf_putstring(buf, algolist->data, algolist->len);
......@@ -338,19 +338,19 @@ algo_type * buf_match_algo(buffer* buf, algo_type localalgos[],
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 @@ algolist_string(algo_type algos[])
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;
}
......
......@@ -38,7 +38,7 @@
#include "netio.h"
static void send_msg_channel_open_failure(unsigned int remotechan, int reason,
const unsigned char *text, const unsigned char *lang);
const char *text, const char *lang);
static void send_msg_channel_open_confirmation(struct Channel* channel,
unsigned int recvwindow,
unsigned int recvmaxpacket);
......@@ -921,7 +921,7 @@ static void send_msg_channel_window_adjust(struct Channel* channel,
/* 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 @@ void recv_msg_channel_open() {
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);
......@@ -1039,7 +1039,7 @@ void send_msg_channel_success(struct Channel *channel) {
/* Send a channel open failure message, with a corresponding reason
* code (usually resource shortage or unknown chan type) */
static void send_msg_channel_open_failure(unsigned int remotechan,
int reason, const unsigned char *text, const unsigned char *lang) {
int reason, const char *text, const char *lang) {
TRACE(("enter send_msg_channel_open_failure"))
CHECKCLEARTOWRITE();
......@@ -1047,8 +1047,8 @@ static void send_msg_channel_open_failure(unsigned int remotechan,
buf_putbyte(ses.writepayload, SSH_MSG_CHANNEL_OPEN_FAILURE);
buf_putint(ses.writepayload, remotechan);
buf_putint(ses.writepayload, reason);
buf_putstring(ses.writepayload, text, strlen((char*)text));
buf_putstring(ses.writepayload, lang, strlen((char*)lang));
buf_putstring(ses.writepayload, (const unsigned char *) text, strlen(text));
buf_putstring(ses.writepayload, (const unsigned char *) lang, strlen(lang));
encrypt_packet();
TRACE(("leave send_msg_channel_open_failure"))
......@@ -1149,7 +1149,7 @@ int send_msg_channel_open_init(int fd, const struct ChanType *type) {
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);
......@@ -1244,12 +1244,12 @@ struct Channel* get_any_ready_channel() {
}
void start_send_channel_request(struct Channel *channel,
unsigned char *type) {
char *type) {
CHECKCLEARTOWRITE();
buf_putbyte(ses.writepayload, SSH_MSG_CHANNEL_REQUEST);
buf_putint(ses.writepayload, channel->remotechan);
buf_putstring(ses.writepayload, type, strlen(type));
buf_putstring(ses.writepayload, (const unsigned char *) type, strlen(type));
}
......@@ -128,10 +128,10 @@ void send_msg_kexinit() {
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));
......@@ -511,7 +511,7 @@ void recv_msg_kexinit() {
/* 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
......@@ -528,7 +528,7 @@ void recv_msg_kexinit() {
buf_putstring(ses.kexhashbuf,
(unsigned char*)LOCAL_IDENT, local_ident_len);
/* V_S, the server's version string (CR and NL excluded) */
buf_putstring(ses.kexhashbuf, ses.remoteident, remote_ident_len);
buf_putstring(ses.kexhashbuf, (unsigned char*)ses.remoteident, remote_ident_len);
/* I_C, the payload of the client's SSH_MSG_KEXINIT */
buf_putstring(ses.kexhashbuf,
......@@ -545,7 +545,7 @@ void recv_msg_kexinit() {
/* read the peer's choice of algos */
read_kex_algos();
/* V_C, the client's version string (CR and NL excluded) */
buf_putstring(ses.kexhashbuf, ses.remoteident, remote_ident_len);
buf_putstring(ses.kexhashbuf, (unsigned char*)ses.remoteident, remote_ident_len);
/* V_S, the server's version string (CR and NL excluded) */
buf_putstring(ses.kexhashbuf,
(unsigned char*)LOCAL_IDENT, local_ident_len);
......
......@@ -329,7 +329,7 @@ void session_cleanup() {
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 @@ static void send_msg_keepalive() {
/* 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 */
......
......@@ -141,7 +141,7 @@ out:
return ret;