summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--algo.h2
-rw-r--r--auth.h2
-rw-r--r--channel.h2
-rw-r--r--chansession.h6
-rw-r--r--cli-kex.c10
-rw-r--r--common-kex.c2
-rw-r--r--configure.ac8
-rw-r--r--dbrandom.c2
-rw-r--r--dbrandom.h2
-rw-r--r--ecc.h2
-rw-r--r--gendss.c2
-rw-r--r--keyimport.c10
-rw-r--r--libtomcrypt/src/ciphers/aes/aes.c10
-rw-r--r--libtomcrypt/src/ciphers/des.c1
-rw-r--r--libtomcrypt/src/ciphers/twofish/twofish.c1
-rw-r--r--libtomcrypt/src/hashes/helper/hash_file.c1
-rw-r--r--libtomcrypt/src/hashes/helper/hash_filehandle.c1
-rw-r--r--libtomcrypt/src/mac/hmac/hmac_file.c1
-rw-r--r--libtomcrypt/src/misc/crypt/crypt_argchk.c2
-rw-r--r--libtomcrypt/src/pk/ecc/ltc_ecc_mulmod_timing.c4
-rw-r--r--session.h4
-rw-r--r--svr-authpubkeyoptions.c2
-rw-r--r--tcp-accept.c2
-rw-r--r--tcpfwd.h10
24 files changed, 50 insertions, 39 deletions
diff --git a/algo.h b/algo.h
index 5b7b874..49c4f41 100644
--- a/algo.h
+++ b/algo.h
@@ -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 --git a/auth.h b/auth.h
index 78397ed..250a7f7 100644
--- a/auth.h
+++ b/auth.h
@@ -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
diff --git a/channel.h b/channel.h
index d16cb03..c73fbe8 100644
--- a/channel.h
+++ b/channel.h
@@ -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();
diff --git a/chansession.h b/chansession.h
index 3dd58ac..6eb8c76 100644
--- a/chansession.h
+++ b/chansession.h
@@ -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;
diff --git a/cli-kex.c b/cli-kex.c
index e1924e1..07ee431 100644
--- a/cli-kex.c
+++ b/cli-kex.c
@@ -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
diff --git a/common-kex.c b/common-kex.c
index 84b6efd..2907715 100644
--- a/common-kex.c
+++ b/common-kex.c
@@ -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
diff --git a/configure.ac b/configure.ac
index b0e85e5..6ae8c32 100644
--- a/configure.ac
+++ b/configure.ac
@@ -265,7 +265,7 @@ AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage
#include <sys/types.h>
#include <sys/socket.h>
]],
- [[ 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 @@ AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
#include <sys/types.h>
#include <netinet/in.h>
]],
- [[ 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 @@ AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
#include <sys/types.h>
#include <netinet/in.h>
]],
- [[ 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 @@ AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
#include <sys/socket.h>
#include <netdb.h>
]],
- [[ 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 --git a/dbrandom.c b/dbrandom.c
index cf280f4..02e7803 100644
--- a/dbrandom.c
+++ b/dbrandom.c
@@ -141,7 +141,7 @@ out:
return ret;
}
-void addrandom(char * buf, unsigned int len)
+void addrandom(unsigned char * buf, unsigned int len)
{
hash_state hs;
diff --git a/dbrandom.h b/dbrandom.h
index 3434f69..6e262f3 100644
--- a/dbrandom.h
+++ b/dbrandom.h
@@ -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 --git a/ecc.h b/ecc.h
index 703c717..93f85cf 100644
--- a/ecc.h
+++ b/ecc.h
@@ -12,7 +12,7 @@ struct dropbear_ecc_curve {
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 --git a/gendss.c b/gendss.c
index 21d13a0..783e25f 100644
--- a/gendss.c
+++ b/gendss.c
@@ -67,7 +67,7 @@ dropbear_dss_key * gen_dss_priv_key(unsigned int size) {
static void getq(dropbear_dss_key *key) {
- char buf[QSIZE];
+ unsigned char buf[QSIZE];
/* 160 bit prime */
genrandom(buf, QSIZE);
diff --git a/keyimport.c b/keyimport.c
index 362d775..d45914f 100644
--- a/keyimport.c
+++ b/keyimport.c
@@ -193,7 +193,7 @@ out:
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 @@ static struct openssh_key *load_openssh_key(const char *filename)
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 @@ static sign_key *openssh_read(const char *filename, char * UNUSED(passphrase))
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 @@ static sign_key *openssh_read(const char *filename, char * UNUSED(passphrase))
*/
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 @@ static int openssh_write(const char *filename, sign_key *key,
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 --git a/libtomcrypt/src/ciphers/aes/aes.c b/libtomcrypt/src/ciphers/aes/aes.c
index 74798e8..55f6333 100644
--- a/libtomcrypt/src/ciphers/aes/aes.c
+++ b/libtomcrypt/src/ciphers/aes/aes.c
@@ -122,9 +122,10 @@ static ulong32 setup_mix2(ulong32 temp)
*/
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 @@ int SETUP(const unsigned char *key, int keylen, int num_rounds, symmetric_key *s
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 @@ int SETUP(const unsigned char *key, int keylen, int num_rounds, symmetric_key *s
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 @@ int SETUP(const unsigned char *key, int keylen, int num_rounds, symmetric_key *s
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 @@ int ECB_TEST(void)
*/
void ECB_DONE(symmetric_key *skey)
{
+ (void)skey;
}
diff --git a/libtomcrypt/src/ciphers/des.c b/libtomcrypt/src/ciphers/des.c
index e505b14..6005e84 100644
--- a/libtomcrypt/src/ciphers/des.c
+++ b/libtomcrypt/src/ciphers/des.c
@@ -1871,6 +1871,7 @@ void des_done(symmetric_key *skey)
*/
void des3_done(symmetric_key *skey)
{
+ (void)skey;
}
diff --git a/libtomcrypt/src/ciphers/twofish/twofish.c b/libtomcrypt/src/ciphers/twofish/twofish.c
index 9e6d0d4..8f81bdd 100644
--- a/libtomcrypt/src/ciphers/twofish/twofish.c
+++ b/libtomcrypt/src/ciphers/twofish/twofish.c
@@ -684,6 +684,7 @@ int twofish_test(void)
*/
void twofish_done(symmetric_key *skey)
{
+ (void)skey;
}
/**
diff --git a/libtomcrypt/src/hashes/helper/hash_file.c b/libtomcrypt/src/hashes/helper/hash_file.c
index a92025c..df31606 100644
--- a/libtomcrypt/src/hashes/helper/hash_file.c
+++ b/libtomcrypt/src/hashes/helper/hash_file.c
@@ -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 --git a/libtomcrypt/src/hashes/helper/hash_filehandle.c b/libtomcrypt/src/hashes/helper/hash_filehandle.c
index be2cbf9..03155ea 100644
--- a/libtomcrypt/src/hashes/helper/hash_filehandle.c
+++ b/libtomcrypt/src/hashes/helper/hash_filehandle.c
@@ -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 --git a/libtomcrypt/src/mac/hmac/hmac_file.c b/libtomcrypt/src/mac/hmac/hmac_file.c
index b296320..d7c40b1 100644
--- a/libtomcrypt/src/mac/hmac/hmac_file.c
+++ b/libtomcrypt/src/mac/hmac/hmac_file.c
@@ -32,6 +32,7 @@ int hmac_file(int hash, const char *fname,
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 --git a/libtomcrypt/src/misc/crypt/crypt_argchk.c b/libtomcrypt/src/misc/crypt/crypt_argchk.c
index c6675ef..a6d2a48 100644
--- a/libtomcrypt/src/misc/crypt/crypt_argchk.c
+++ b/libtomcrypt/src/misc/crypt/crypt_argchk.c
@@ -21,7 +21,7 @@ void crypt_argchk(char *v, char *s, int d)
{
fprintf(stderr, "LTC_ARGCHK '%s' failure on line %d of file %s\n",
v, d, s);
- (void)raise(SIGABRT);
+ abort();
}
#endif
diff --git a/libtomcrypt/src/pk/ecc/ltc_ecc_mulmod_timing.c b/libtomcrypt/src/pk/ecc/ltc_ecc_mulmod_timing.c
index b94a50c..8cbcdf3 100644
--- a/libtomcrypt/src/pk/ecc/ltc_ecc_mulmod_timing.c
+++ b/libtomcrypt/src/pk/ecc/ltc_ecc_mulmod_timing.c
@@ -40,7 +40,7 @@ int ltc_ecc_mulmod(void *k, ecc_point *G, ecc_point *R, void *modulus, int map)
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 @@ int ltc_ecc_mulmod(void *k, ecc_point *G, ecc_point *R, void *modulus, int map)
bitcnt = 1;
buf = 0;
digidx = mp_get_digit_count(k) - 1;
- bitcpy = bitbuf = 0;
- first = 1;
/* perform ops */
for (;;) {
diff --git a/session.h b/session.h
index 0059d94..99c96cb 100644
--- a/session.h
+++ b/session.h
@@ -63,7 +63,7 @@ void svr_dropbear_log(int priority, const char* format, va_list param);
/* 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 @@ struct sshsession {
/* 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 --git a/svr-authpubkeyoptions.c b/svr-authpubkeyoptions.c
index 71d7c14..c296141 100644
--- a/svr-authpubkeyoptions.c
+++ b/svr-authpubkeyoptions.c
@@ -120,7 +120,7 @@ static int match_option(buffer *options_buf, const char *opt_name) {
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 --git a/tcp-accept.c b/tcp-accept.c
index 35be32d..4456920 100644
--- a/tcp-accept.c
+++ b/tcp-accept.c
@@ -75,7 +75,7 @@ static void tcp_acceptor(struct Listener *listener, int sock) {
}
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 --git a/tcpfwd.h b/tcpfwd.h
index 51a1575..64139f0 100644
--- a/tcpfwd.h
+++ b/tcpfwd.h
@@ -31,16 +31,16 @@ struct TCPListener {
/* 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 @@ struct TCPListener {
/* 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 */