Commit 1cb5c690 authored by Niels Möller's avatar Niels Möller

Changed back CONST->const, and fixed some missing const declarations.

Rev: src/atoms.c:1.7
Rev: src/atoms.h:1.4
Rev: src/client.c:1.40
Rev: src/client.h:1.16
Rev: src/client_userauth.c:1.8
Rev: src/crypto.c:1.17
Rev: src/debug.c:1.19
Rev: src/keyexchange.c:1.29
Rev: src/parse.c:1.21
Rev: src/server.c:1.30
Rev: src/symmetric/include/blowfish.h:1.3
Rev: src/symmetric/include/idea.h:1.4
Rev: src/symmetric/include/rc4.h:1.4
Rev: src/werror.c:1.15
Rev: src/werror.h:1.11
parent d47d73e8
......@@ -29,11 +29,11 @@
struct atom_rassoc
{
CONST UINT8 *name;
const UINT8 *name;
UINT32 length;
};
struct atom_assoc *gperf_atom (CONST char *str, unsigned int len);
struct atom_assoc *gperf_atom (const char *str, unsigned int len);
#include "atoms_gperf.c"
......@@ -44,7 +44,7 @@ struct atom_rassoc atom_table[] =
UINT32 get_atom_length(int atom)
{ return atom_table[atom].length; }
UINT8 *get_atom_name(int atom)
const UINT8 *get_atom_name(int atom)
{ return atom_table[atom].name; }
UINT32 lookup_atom(UINT32 length, UINT8 *name)
......
......@@ -30,7 +30,7 @@
#include "atoms_defines.h"
UINT32 get_atom_length(int atom);
UINT8 *get_atom_name(int atom);
const UINT8 *get_atom_name(int atom);
UINT32 lookup_atom(UINT32 length, UINT8 *name);
#endif /* LSH_ATOMS_H_INCLUDED */
......@@ -60,7 +60,7 @@
(vars
(backend object io_backend)
(block_size simple UINT32)
(id_comment simple "char *")
(id_comment simple "const char *")
(random object randomness)
(init object make_kexinit)
(kexinit_handler object packet_handler)))
......@@ -178,7 +178,7 @@ struct read_handler *make_client_read_line(struct ssh_connection *c)
struct fd_callback *
make_client_callback(struct io_backend *b,
CONST char *comment,
const char *comment,
UINT32 block_size,
struct randomness *random,
struct make_kexinit *init,
......
......@@ -31,7 +31,7 @@
struct fd_callback *
make_client_callback(struct io_backend *b,
CONST char *comment,
const char *comment,
UINT32 block_size,
struct randomness *random,
struct make_kexinit *init,
......
......@@ -147,6 +147,9 @@ static int do_userauth_success(struct packet_handler *c,
return LSH_FAIL | LSH_DIE;
}
/* Arbitrary limit on list length */
#define USERAUTH_MAX_METHODS 47
static int do_userauth_failure(struct packet_handler *c,
struct ssh_connection *connection,
struct lsh_string *packet)
......@@ -162,7 +165,7 @@ static int do_userauth_failure(struct packet_handler *c,
if (parse_uint8(&buffer, &msg_number)
&& (msg_number == SSH_MSG_USERAUTH_FAILURE)
&& ( (methods = parse_atom_list(&buffer)) )
&& ( (methods = parse_atom_list(&buffer, USERAUTH_MAX_METHODS)) )
&& parse_boolean(&buffer, &partial_success)
&& parse_eod(&buffer))
{
......
......@@ -56,7 +56,7 @@ static void do_crypt_rc4(struct crypto_instance *s,
}
static struct crypto_instance *
make_rc4_instance(UNUSED struct crypto_algorithm *ignored, int mode, UINT8 *key)
make_rc4_instance(struct crypto_algorithm *ignored UNUSED, int mode, UINT8 *key)
{
NEW(rc4_instance, self);
......@@ -126,7 +126,7 @@ static void do_crypt_blowfish(struct crypto_instance *s,
}
static struct crypto_instance *
make_blowfish_instance(UNUSED struct crypto_algorithm *ignored, int mode,
make_blowfish_instance(struct crypto_algorithm *ignored UNUSED, int mode,
UINT8 *key)
{
/* struct blowfish_instance *self; */
......@@ -181,8 +181,8 @@ static struct hash_instance *do_sha_copy(struct hash_instance *s)
return &CLONE(sha_instance, s)->super;
}
static struct hash_instance *make_sha_instance(
UNUSED struct hash_algorithm *ignored)
static struct hash_instance *
make_sha_instance(struct hash_algorithm *ignored UNUSED)
{
NEW(sha_instance, res);
......
......@@ -39,7 +39,7 @@
(name packet_debug)
(super abstract_write_pipe)
(vars
(prefix simple "char *")))
(prefix simple "const char *")))
*/
static int do_debug(struct abstract_write *w,
......
......@@ -65,6 +65,9 @@
#define NLISTS 10
/* Arbitrary limit on list length */
#define KEXINIT_MAX_ALGORITMS 47
static struct kexinit *parse_kexinit(struct lsh_string *packet)
{
NEW(kexinit, res);
......@@ -94,7 +97,7 @@ static struct kexinit *parse_kexinit(struct lsh_string *packet)
for (i = 0; i<NLISTS; i++)
{
if (!parse_sub_buffer(&buffer, &sub_buffer)
|| ! (lists[i] = parse_atom_list(&sub_buffer)))
|| ! (lists[i] = parse_atom_list(&sub_buffer, KEXINIT_MAX_ALGORITMS)))
break;
}
......
......@@ -30,6 +30,7 @@
#include "werror.h"
#include "xalloc.h"
#include <assert.h>
#include <string.h>
void simple_buffer_init(struct simple_buffer *buffer,
......
......@@ -114,7 +114,7 @@
(host_key string) ; Public key
(block_size simple UINT32)
(id_comment simple "char *")
(id_comment simple "const char *")
(random object randomness)
(init object make_kexinit)
......
......@@ -40,12 +40,12 @@ typedef struct {
} BLOWFISH_context;
CONST char *
const char *
blowfish_get_info( int algo, size_t *keylen,
size_t *blocksize, size_t *contextsize,
int (**setkey)( void *c, CONST byte *key, unsigned keylen ),
void (**encrypt)( void *c, byte *outbuf, CONST byte *inbuf ),
void (**decrypt)( void *c, byte *outbuf, CONST byte *inbuf )
int (**setkey)( void *c, const byte *key, unsigned keylen ),
void (**encrypt)( void *c, byte *outbuf, const byte *inbuf ),
void (**decrypt)( void *c, byte *outbuf, const byte *inbuf )
);
#endif /*G10_BLOWFISH_H*/
......@@ -19,13 +19,13 @@
#include "crypto_types.h"
void idea_expand(UINT16 *ctx,
CONST UINT8 *key);
const UINT8 *key);
void idea_invert(UINT16 *d,
CONST UINT16 *e);
const UINT16 *e);
void idea_crypt(CONST UINT16 *ctx,
void idea_crypt(const UINT16 *ctx,
UINT8 *dest,
CONST UINT8 *src);
const UINT8 *src);
#endif /* IDEA_H_INCLUDED */
......@@ -16,7 +16,7 @@ struct rc4_ctx {
void rc4_init(struct rc4_ctx *ctx);
#endif
void rc4_set_key(struct rc4_ctx *ctx, CONST UINT8 *key, UINT32 len);
void rc4_crypt(struct rc4_ctx *ctx, UINT8 *dest, CONST UINT8 *src, UINT32 len);
void rc4_set_key(struct rc4_ctx *ctx, const UINT8 *key, UINT32 len);
void rc4_crypt(struct rc4_ctx *ctx, UINT8 *dest, const UINT8 *src, UINT32 len);
#endif /* RC4_H_INCLUDED */
......@@ -36,7 +36,7 @@ int debug_flag = 0;
int quiet_flag = 0;
int verbose_flag = 0;
void werror(CONST char *format, ...)
void werror(const char *format, ...)
{
va_list args;
......@@ -48,7 +48,7 @@ void werror(CONST char *format, ...)
}
}
void debug(CONST char *format, ...)
void debug(const char *format, ...)
{
va_list args;
......@@ -60,7 +60,7 @@ void debug(CONST char *format, ...)
}
}
void verbose(CONST char *format, ...)
void verbose(const char *format, ...)
{
va_list args;
......@@ -228,7 +228,7 @@ void verbose_hex(UINT32 length, UINT8 *data)
write_hex(length, data);
}
void fatal(CONST char *format, ...)
void fatal(const char *format, ...)
{
va_list args;
......
......@@ -35,9 +35,9 @@ extern int debug_flag;
extern int quiet_flag;
extern int verbose_flag;
void werror(CONST char *format, ...) PRINTF_STYLE(1,2);
void debug(CONST char *format, ...) PRINTF_STYLE(1,2);
void verbose(CONST char *format, ...) PRINTF_STYLE(1,2);
void werror(const char *format, ...) PRINTF_STYLE(1,2);
void debug(const char *format, ...) PRINTF_STYLE(1,2);
void verbose(const char *format, ...) PRINTF_STYLE(1,2);
/* For outputting data recieved from the other end */
void werror_safe(UINT32 length, UINT8 *msg);
......@@ -48,7 +48,7 @@ void werror_utf8(UINT32 length, UINT8 *msg);
void debug_utf8(UINT32 length, UINT8 *msg);
void verbose_utf8(UINT32 length, UINT8 *msg);
void fatal(CONST char *format, ...) PRINTF_STYLE(1,2) NORETURN;
void fatal(const char *format, ...) PRINTF_STYLE(1,2) NORETURN;
void werror_hex(UINT32 length, UINT8 *data);
void debug_hex(UINT32 length, UINT8 *data);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment