-/* $OpenBSD: authfile.c,v 1.104 2014/03/12 04:51:12 djm Exp $ */
+/* $OpenBSD: authfile.c,v 1.105 2014/04/28 03:09:18 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
char **commentp)
{
u_char *key = NULL, *cp, *salt = NULL, pad, last;
- char *comment = NULL, *ciphername = NULL, *kdfname = NULL, *kdfp;
+ char *comment = NULL, *ciphername = NULL, *kdfname = NULL;
+ const u_char *kdfp;
u_int keylen = 0, ivlen, blocksize, slen, klen, len, rounds, nkeys;
u_int check1, check2, m1len, m2len;
size_t authlen;
-/* $OpenBSD: bufaux.c,v 1.57 2014/04/16 23:22:45 djm Exp $ */
+/* $OpenBSD: bufaux.c,v 1.58 2014/04/28 03:09:18 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
return ret;
}
-void *
+const void *
buffer_get_string_ptr_ret(Buffer *buffer, u_int *length_ptr)
{
void *ptr;
return (ptr);
}
-void *
+const void *
buffer_get_string_ptr(Buffer *buffer, u_int *length_ptr)
{
- void *ret;
+ const void *ret;
if ((ret = buffer_get_string_ptr_ret(buffer, length_ptr)) == NULL)
fatal("buffer_get_string_ptr: buffer error");
-/* $OpenBSD: buffer.h,v 1.23 2014/01/12 08:13:13 djm Exp $ */
+/* $OpenBSD: buffer.h,v 1.24 2014/04/28 03:09:18 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
void buffer_put_char(Buffer *, int);
void *buffer_get_string(Buffer *, u_int *);
-void *buffer_get_string_ptr(Buffer *, u_int *);
+const void *buffer_get_string_ptr(Buffer *, u_int *);
void buffer_put_string(Buffer *, const void *, u_int);
char *buffer_get_cstring(Buffer *, u_int *);
void buffer_put_cstring(Buffer *, const char *);
int buffer_get_int64_ret(u_int64_t *, Buffer *);
void *buffer_get_string_ret(Buffer *, u_int *);
char *buffer_get_cstring_ret(Buffer *, u_int *);
-void *buffer_get_string_ptr_ret(Buffer *, u_int *);
+const void *buffer_get_string_ptr_ret(Buffer *, u_int *);
int buffer_get_char_ret(u_char *, Buffer *);
void *buffer_get_bignum2_as_string_ret(Buffer *, u_int *);
-/* $OpenBSD: channels.c,v 1.331 2014/02/26 20:29:29 djm Exp $ */
+/* $OpenBSD: channels.c,v 1.332 2014/04/28 03:09:18 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
channel_input_data(int type, u_int32_t seq, void *ctxt)
{
int id;
- char *data;
+ const u_char *data;
u_int data_len, win_len;
Channel *c;
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $OpenBSD: krl.c,v 1.14 2014/01/31 16:39:19 tedu Exp $ */
+/* $OpenBSD: krl.c,v 1.15 2014/04/28 03:09:18 djm Exp $ */
#include <sys/types.h>
#include <sys/param.h>
parse_revoked_certs(Buffer *buf, struct ssh_krl *krl)
{
int ret = -1, nbits;
- u_char type, *blob;
+ u_char type;
+ const u_char *blob;
u_int blen;
Buffer subsect;
u_int64_t serial, serial_lo, serial_hi;
char timestamp[64];
int ret = -1, r, sig_seen;
Key *key = NULL, **ca_used = NULL;
- u_char type, *blob, *rdata = NULL;
+ u_char type, *rdata = NULL;
+ const u_char *blob;
u_int i, j, sig_off, sects_off, rlen, blen, format_version, nca_used;
nca_used = 0;
-/* $OpenBSD: mux.c,v 1.44 2013/07/12 00:19:58 djm Exp $ */
+/* $OpenBSD: mux.c,v 1.45 2014/04/28 03:09:18 djm Exp $ */
/*
* Copyright (c) 2002-2008 Damien Miller <djm@openbsd.org>
*
{
struct mux_master_state *state = (struct mux_master_state *)c->mux_ctx;
Buffer in, out;
- void *ptr;
+ const u_char *ptr;
u_int type, rid, have, i;
int ret = -1;
{
Buffer queue;
u_int need, have;
- void *ptr;
+ const u_char *ptr;
int oerrno;
buffer_init(&queue);
-/* $OpenBSD: packet.c,v 1.193 2014/04/01 05:32:57 djm Exp $ */
+/* $OpenBSD: packet.c,v 1.194 2014/04/28 03:09:18 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
return buffer_get_string(&active_state->incoming_packet, length_ptr);
}
-void *
+const void *
packet_get_string_ptr(u_int *length_ptr)
{
return buffer_get_string_ptr(&active_state->incoming_packet, length_ptr);
-/* $OpenBSD: packet.h,v 1.59 2013/07/12 00:19:59 djm Exp $ */
+/* $OpenBSD: packet.h,v 1.60 2014/04/28 03:09:18 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
void *packet_get_raw(u_int *length_ptr);
void *packet_get_string(u_int *length_ptr);
char *packet_get_cstring(u_int *length_ptr);
-void *packet_get_string_ptr(u_int *length_ptr);
+const void *packet_get_string_ptr(u_int *length_ptr);
void packet_disconnect(const char *fmt,...) __attribute__((noreturn)) __attribute__((format(printf, 1, 2)));
void packet_send_debug(const char *fmt,...) __attribute__((format(printf, 1, 2)));
-/* $OpenBSD: ssh-keygen.c,v 1.244 2014/04/20 09:24:26 logan Exp $ */
+/* $OpenBSD: ssh-keygen.c,v 1.245 2014/04/28 03:09:18 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
static void
show_options(const Buffer *optbuf, int v00, int in_critical)
{
- char *name;
- u_char *data;
+ char *name, *arg;
+ const u_char *data;
u_int dlen;
Buffer options, option;
else if ((v00 || in_critical) &&
(strcmp(name, "force-command") == 0 ||
strcmp(name, "source-address") == 0)) {
- data = buffer_get_string(&option, NULL);
- printf(" %s\n", data);
- free(data);
+ arg = buffer_get_cstring(&option, NULL);
+ printf(" %s\n", arg);
+ free(arg);
} else {
printf(" UNKNOWN OPTION (len %u)\n",
buffer_len(&option));