diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | authfile.c | 5 | ||||
-rw-r--r-- | bufaux.c | 8 | ||||
-rw-r--r-- | buffer.h | 6 | ||||
-rw-r--r-- | channels.c | 4 | ||||
-rw-r--r-- | krl.c | 8 | ||||
-rw-r--r-- | mux.c | 6 | ||||
-rw-r--r-- | packet.c | 4 | ||||
-rw-r--r-- | packet.h | 4 | ||||
-rw-r--r-- | ssh-keygen.c | 12 |
10 files changed, 36 insertions, 27 deletions
@@ -25,6 +25,12 @@ | |||
25 | - djm@cvs.openbsd.org 2014/04/23 12:42:34 | 25 | - djm@cvs.openbsd.org 2014/04/23 12:42:34 |
26 | [readconf.c] | 26 | [readconf.c] |
27 | don't record duplicate IdentityFiles | 27 | don't record duplicate IdentityFiles |
28 | - djm@cvs.openbsd.org 2014/04/28 03:09:18 | ||
29 | [authfile.c bufaux.c buffer.h channels.c krl.c mux.c packet.c packet.h] | ||
30 | [ssh-keygen.c] | ||
31 | buffer_get_string_ptr's return should be const to remind | ||
32 | callers that futzing with it will futz with the actual buffer | ||
33 | contents | ||
28 | 34 | ||
29 | 20140430 | 35 | 20140430 |
30 | - (dtucker) [defines.h] Define __GNUC_PREREQ__ macro if we don't already | 36 | - (dtucker) [defines.h] Define __GNUC_PREREQ__ macro if we don't already |
diff --git a/authfile.c b/authfile.c index 0e97ba4ea..44994a810 100644 --- a/authfile.c +++ b/authfile.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: authfile.c,v 1.104 2014/03/12 04:51:12 djm Exp $ */ | 1 | /* $OpenBSD: authfile.c,v 1.105 2014/04/28 03:09:18 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -204,7 +204,8 @@ key_parse_private2(Buffer *blob, int type, const char *passphrase, | |||
204 | char **commentp) | 204 | char **commentp) |
205 | { | 205 | { |
206 | u_char *key = NULL, *cp, *salt = NULL, pad, last; | 206 | u_char *key = NULL, *cp, *salt = NULL, pad, last; |
207 | char *comment = NULL, *ciphername = NULL, *kdfname = NULL, *kdfp; | 207 | char *comment = NULL, *ciphername = NULL, *kdfname = NULL; |
208 | const u_char *kdfp; | ||
208 | u_int keylen = 0, ivlen, blocksize, slen, klen, len, rounds, nkeys; | 209 | u_int keylen = 0, ivlen, blocksize, slen, klen, len, rounds, nkeys; |
209 | u_int check1, check2, m1len, m2len; | 210 | u_int check1, check2, m1len, m2len; |
210 | size_t authlen; | 211 | size_t authlen; |
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bufaux.c,v 1.57 2014/04/16 23:22:45 djm Exp $ */ | 1 | /* $OpenBSD: bufaux.c,v 1.58 2014/04/28 03:09:18 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -236,7 +236,7 @@ buffer_get_cstring(Buffer *buffer, u_int *length_ptr) | |||
236 | return ret; | 236 | return ret; |
237 | } | 237 | } |
238 | 238 | ||
239 | void * | 239 | const void * |
240 | buffer_get_string_ptr_ret(Buffer *buffer, u_int *length_ptr) | 240 | buffer_get_string_ptr_ret(Buffer *buffer, u_int *length_ptr) |
241 | { | 241 | { |
242 | void *ptr; | 242 | void *ptr; |
@@ -255,10 +255,10 @@ buffer_get_string_ptr_ret(Buffer *buffer, u_int *length_ptr) | |||
255 | return (ptr); | 255 | return (ptr); |
256 | } | 256 | } |
257 | 257 | ||
258 | void * | 258 | const void * |
259 | buffer_get_string_ptr(Buffer *buffer, u_int *length_ptr) | 259 | buffer_get_string_ptr(Buffer *buffer, u_int *length_ptr) |
260 | { | 260 | { |
261 | void *ret; | 261 | const void *ret; |
262 | 262 | ||
263 | if ((ret = buffer_get_string_ptr_ret(buffer, length_ptr)) == NULL) | 263 | if ((ret = buffer_get_string_ptr_ret(buffer, length_ptr)) == NULL) |
264 | fatal("buffer_get_string_ptr: buffer error"); | 264 | fatal("buffer_get_string_ptr: buffer error"); |
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: buffer.h,v 1.23 2014/01/12 08:13:13 djm Exp $ */ | 1 | /* $OpenBSD: buffer.h,v 1.24 2014/04/28 03:09:18 djm Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 4 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
@@ -66,7 +66,7 @@ int buffer_get_char(Buffer *); | |||
66 | void buffer_put_char(Buffer *, int); | 66 | void buffer_put_char(Buffer *, int); |
67 | 67 | ||
68 | void *buffer_get_string(Buffer *, u_int *); | 68 | void *buffer_get_string(Buffer *, u_int *); |
69 | void *buffer_get_string_ptr(Buffer *, u_int *); | 69 | const void *buffer_get_string_ptr(Buffer *, u_int *); |
70 | void buffer_put_string(Buffer *, const void *, u_int); | 70 | void buffer_put_string(Buffer *, const void *, u_int); |
71 | char *buffer_get_cstring(Buffer *, u_int *); | 71 | char *buffer_get_cstring(Buffer *, u_int *); |
72 | void buffer_put_cstring(Buffer *, const char *); | 72 | void buffer_put_cstring(Buffer *, const char *); |
@@ -83,7 +83,7 @@ int buffer_get_int_ret(u_int *, Buffer *); | |||
83 | int buffer_get_int64_ret(u_int64_t *, Buffer *); | 83 | int buffer_get_int64_ret(u_int64_t *, Buffer *); |
84 | void *buffer_get_string_ret(Buffer *, u_int *); | 84 | void *buffer_get_string_ret(Buffer *, u_int *); |
85 | char *buffer_get_cstring_ret(Buffer *, u_int *); | 85 | char *buffer_get_cstring_ret(Buffer *, u_int *); |
86 | void *buffer_get_string_ptr_ret(Buffer *, u_int *); | 86 | const void *buffer_get_string_ptr_ret(Buffer *, u_int *); |
87 | int buffer_get_char_ret(u_char *, Buffer *); | 87 | int buffer_get_char_ret(u_char *, Buffer *); |
88 | 88 | ||
89 | void *buffer_get_bignum2_as_string_ret(Buffer *, u_int *); | 89 | void *buffer_get_bignum2_as_string_ret(Buffer *, u_int *); |
diff --git a/channels.c b/channels.c index 9efe89c9c..1020071ff 100644 --- a/channels.c +++ b/channels.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: channels.c,v 1.331 2014/02/26 20:29:29 djm Exp $ */ | 1 | /* $OpenBSD: channels.c,v 1.332 2014/04/28 03:09:18 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -2315,7 +2315,7 @@ void | |||
2315 | channel_input_data(int type, u_int32_t seq, void *ctxt) | 2315 | channel_input_data(int type, u_int32_t seq, void *ctxt) |
2316 | { | 2316 | { |
2317 | int id; | 2317 | int id; |
2318 | char *data; | 2318 | const u_char *data; |
2319 | u_int data_len, win_len; | 2319 | u_int data_len, win_len; |
2320 | Channel *c; | 2320 | Channel *c; |
2321 | 2321 | ||
@@ -14,7 +14,7 @@ | |||
14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | /* $OpenBSD: krl.c,v 1.14 2014/01/31 16:39:19 tedu Exp $ */ | 17 | /* $OpenBSD: krl.c,v 1.15 2014/04/28 03:09:18 djm Exp $ */ |
18 | 18 | ||
19 | #include "includes.h" | 19 | #include "includes.h" |
20 | 20 | ||
@@ -753,7 +753,8 @@ static int | |||
753 | parse_revoked_certs(Buffer *buf, struct ssh_krl *krl) | 753 | parse_revoked_certs(Buffer *buf, struct ssh_krl *krl) |
754 | { | 754 | { |
755 | int ret = -1, nbits; | 755 | int ret = -1, nbits; |
756 | u_char type, *blob; | 756 | u_char type; |
757 | const u_char *blob; | ||
757 | u_int blen; | 758 | u_int blen; |
758 | Buffer subsect; | 759 | Buffer subsect; |
759 | u_int64_t serial, serial_lo, serial_hi; | 760 | u_int64_t serial, serial_lo, serial_hi; |
@@ -887,7 +888,8 @@ ssh_krl_from_blob(Buffer *buf, struct ssh_krl **krlp, | |||
887 | char timestamp[64]; | 888 | char timestamp[64]; |
888 | int ret = -1, r, sig_seen; | 889 | int ret = -1, r, sig_seen; |
889 | Key *key = NULL, **ca_used = NULL; | 890 | Key *key = NULL, **ca_used = NULL; |
890 | u_char type, *blob, *rdata = NULL; | 891 | u_char type, *rdata = NULL; |
892 | const u_char *blob; | ||
891 | u_int i, j, sig_off, sects_off, rlen, blen, format_version, nca_used; | 893 | u_int i, j, sig_off, sects_off, rlen, blen, format_version, nca_used; |
892 | 894 | ||
893 | nca_used = 0; | 895 | nca_used = 0; |
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: mux.c,v 1.44 2013/07/12 00:19:58 djm Exp $ */ | 1 | /* $OpenBSD: mux.c,v 1.45 2014/04/28 03:09:18 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2002-2008 Damien Miller <djm@openbsd.org> | 3 | * Copyright (c) 2002-2008 Damien Miller <djm@openbsd.org> |
4 | * | 4 | * |
@@ -1010,7 +1010,7 @@ mux_master_read_cb(Channel *c) | |||
1010 | { | 1010 | { |
1011 | struct mux_master_state *state = (struct mux_master_state *)c->mux_ctx; | 1011 | struct mux_master_state *state = (struct mux_master_state *)c->mux_ctx; |
1012 | Buffer in, out; | 1012 | Buffer in, out; |
1013 | void *ptr; | 1013 | const u_char *ptr; |
1014 | u_int type, rid, have, i; | 1014 | u_int type, rid, have, i; |
1015 | int ret = -1; | 1015 | int ret = -1; |
1016 | 1016 | ||
@@ -1429,7 +1429,7 @@ mux_client_read_packet(int fd, Buffer *m) | |||
1429 | { | 1429 | { |
1430 | Buffer queue; | 1430 | Buffer queue; |
1431 | u_int need, have; | 1431 | u_int need, have; |
1432 | void *ptr; | 1432 | const u_char *ptr; |
1433 | int oerrno; | 1433 | int oerrno; |
1434 | 1434 | ||
1435 | buffer_init(&queue); | 1435 | buffer_init(&queue); |
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: packet.c,v 1.193 2014/04/01 05:32:57 djm Exp $ */ | 1 | /* $OpenBSD: packet.c,v 1.194 2014/04/28 03:09:18 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -1618,7 +1618,7 @@ packet_get_string(u_int *length_ptr) | |||
1618 | return buffer_get_string(&active_state->incoming_packet, length_ptr); | 1618 | return buffer_get_string(&active_state->incoming_packet, length_ptr); |
1619 | } | 1619 | } |
1620 | 1620 | ||
1621 | void * | 1621 | const void * |
1622 | packet_get_string_ptr(u_int *length_ptr) | 1622 | packet_get_string_ptr(u_int *length_ptr) |
1623 | { | 1623 | { |
1624 | return buffer_get_string_ptr(&active_state->incoming_packet, length_ptr); | 1624 | return buffer_get_string_ptr(&active_state->incoming_packet, length_ptr); |
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: packet.h,v 1.59 2013/07/12 00:19:59 djm Exp $ */ | 1 | /* $OpenBSD: packet.h,v 1.60 2014/04/28 03:09:18 djm Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 4 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
@@ -70,7 +70,7 @@ void packet_get_ecpoint(const EC_GROUP *, EC_POINT *); | |||
70 | void *packet_get_raw(u_int *length_ptr); | 70 | void *packet_get_raw(u_int *length_ptr); |
71 | void *packet_get_string(u_int *length_ptr); | 71 | void *packet_get_string(u_int *length_ptr); |
72 | char *packet_get_cstring(u_int *length_ptr); | 72 | char *packet_get_cstring(u_int *length_ptr); |
73 | void *packet_get_string_ptr(u_int *length_ptr); | 73 | const void *packet_get_string_ptr(u_int *length_ptr); |
74 | void packet_disconnect(const char *fmt,...) __attribute__((noreturn)) __attribute__((format(printf, 1, 2))); | 74 | void packet_disconnect(const char *fmt,...) __attribute__((noreturn)) __attribute__((format(printf, 1, 2))); |
75 | void packet_send_debug(const char *fmt,...) __attribute__((format(printf, 1, 2))); | 75 | void packet_send_debug(const char *fmt,...) __attribute__((format(printf, 1, 2))); |
76 | 76 | ||
diff --git a/ssh-keygen.c b/ssh-keygen.c index d37b7f7f2..85eaf2ef5 100644 --- a/ssh-keygen.c +++ b/ssh-keygen.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssh-keygen.c,v 1.244 2014/04/20 09:24:26 logan Exp $ */ | 1 | /* $OpenBSD: ssh-keygen.c,v 1.245 2014/04/28 03:09:18 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -1820,8 +1820,8 @@ add_cert_option(char *opt) | |||
1820 | static void | 1820 | static void |
1821 | show_options(const Buffer *optbuf, int v00, int in_critical) | 1821 | show_options(const Buffer *optbuf, int v00, int in_critical) |
1822 | { | 1822 | { |
1823 | char *name; | 1823 | char *name, *arg; |
1824 | u_char *data; | 1824 | const u_char *data; |
1825 | u_int dlen; | 1825 | u_int dlen; |
1826 | Buffer options, option; | 1826 | Buffer options, option; |
1827 | 1827 | ||
@@ -1844,9 +1844,9 @@ show_options(const Buffer *optbuf, int v00, int in_critical) | |||
1844 | else if ((v00 || in_critical) && | 1844 | else if ((v00 || in_critical) && |
1845 | (strcmp(name, "force-command") == 0 || | 1845 | (strcmp(name, "force-command") == 0 || |
1846 | strcmp(name, "source-address") == 0)) { | 1846 | strcmp(name, "source-address") == 0)) { |
1847 | data = buffer_get_string(&option, NULL); | 1847 | arg = buffer_get_cstring(&option, NULL); |
1848 | printf(" %s\n", data); | 1848 | printf(" %s\n", arg); |
1849 | free(data); | 1849 | free(arg); |
1850 | } else { | 1850 | } else { |
1851 | printf(" UNKNOWN OPTION (len %u)\n", | 1851 | printf(" UNKNOWN OPTION (len %u)\n", |
1852 | buffer_len(&option)); | 1852 | buffer_len(&option)); |