From 0fa174ebe129f3d0aeaf4e2d1dd8de745870d0ff Mon Sep 17 00:00:00 2001 From: "djm@openbsd.org" Date: Sat, 19 Jan 2019 21:31:32 +0000 Subject: upstream: begin landing remaining refactoring of packet parsing API, started almost exactly six years ago. This change stops including the old packet_* API by default and makes each file that requires the old API include it explicitly. We will commit file-by-file refactoring to remove the old API in consistent steps. with & ok markus@ OpenBSD-Commit-ID: 93c98a6b38f6911fd1ae025a1ec57807fb4d4ef4 --- opacket.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'opacket.c') diff --git a/opacket.c b/opacket.c index e637d7a71..56a76939e 100644 --- a/opacket.c +++ b/opacket.c @@ -2,11 +2,12 @@ /* Written by Markus Friedl. Placed in the public domain. */ #include "includes.h" - +/* $OpenBSD: opacket.c,v 1.8 2019/01/19 21:31:32 djm Exp $ */ #include #include "ssherr.h" #include "packet.h" +#include "opacket.h" /* XXX */ #include "log.h" struct ssh *active_state, *backup_state; -- cgit v1.2.3 From ad60b1179c9682ca5aef0b346f99ef68cbbbc4e5 Mon Sep 17 00:00:00 2001 From: "djm@openbsd.org" Date: Sat, 19 Jan 2019 21:33:13 +0000 Subject: upstream: allow sshpkt_fatal() to take a varargs format; we'll use this to give packet-related fatal error messages more context (esp. the remote endpoint) ok markus@ OpenBSD-Commit-ID: de57211f9543426b515a8a10a4f481666b2b2a50 --- dispatch.c | 6 +++--- opacket.c | 14 +++++++------- packet.c | 29 +++++++++++++++++++++++------ packet.h | 5 +++-- 4 files changed, 36 insertions(+), 18 deletions(-) (limited to 'opacket.c') diff --git a/dispatch.c b/dispatch.c index 0b3ea614e..6e4c501e0 100644 --- a/dispatch.c +++ b/dispatch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dispatch.c,v 1.31 2017/05/31 07:00:13 markus Exp $ */ +/* $OpenBSD: dispatch.c,v 1.32 2019/01/19 21:33:13 djm Exp $ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. * @@ -47,7 +47,7 @@ dispatch_protocol_error(int type, u_int32_t seq, struct ssh *ssh) (r = sshpkt_put_u32(ssh, seq)) != 0 || (r = sshpkt_send(ssh)) != 0 || (r = ssh_packet_write_wait(ssh)) != 0) - sshpkt_fatal(ssh, __func__, r); + sshpkt_fatal(ssh, r, "%s", __func__); return 0; } @@ -131,5 +131,5 @@ ssh_dispatch_run_fatal(struct ssh *ssh, int mode, volatile sig_atomic_t *done) int r; if ((r = ssh_dispatch_run(ssh, mode, done)) != 0) - sshpkt_fatal(ssh, __func__, r); + sshpkt_fatal(ssh, r, "%s", __func__); } diff --git a/opacket.c b/opacket.c index 56a76939e..e5ccf8099 100644 --- a/opacket.c +++ b/opacket.c @@ -1,4 +1,4 @@ -/* $OpenBSD: opacket.c,v 1.7 2017/10/20 01:56:39 djm Exp $ */ +/* $OpenBSD: opacket.c,v 1.9 2019/01/19 21:33:14 djm Exp $ */ /* Written by Markus Friedl. Placed in the public domain. */ #include "includes.h" @@ -238,7 +238,7 @@ packet_read_seqnr(u_int32_t *seqnr) int r; if ((r = ssh_packet_read_seqnr(active_state, &type, seqnr)) != 0) - sshpkt_fatal(active_state, __func__, r); + sshpkt_fatal(active_state, r, "%s", __func__); return type; } @@ -249,7 +249,7 @@ packet_read_poll_seqnr(u_int32_t *seqnr) int r; if ((r = ssh_packet_read_poll_seqnr(active_state, &type, seqnr))) - sshpkt_fatal(active_state, __func__, r); + sshpkt_fatal(active_state, r, "%s", __func__); return type; } @@ -266,7 +266,7 @@ packet_process_incoming(const char *buf, u_int len) int r; if ((r = ssh_packet_process_incoming(active_state, buf, len)) != 0) - sshpkt_fatal(active_state, __func__, r); + sshpkt_fatal(active_state, r, "%s", __func__); } void @@ -275,7 +275,7 @@ packet_write_wait(void) int r; if ((r = ssh_packet_write_wait(active_state)) != 0) - sshpkt_fatal(active_state, __func__, r); + sshpkt_fatal(active_state, r, "%s", __func__); } void @@ -284,7 +284,7 @@ packet_write_poll(void) int r; if ((r = ssh_packet_write_poll(active_state)) != 0) - sshpkt_fatal(active_state, __func__, r); + sshpkt_fatal(active_state, r, "%s", __func__); } void @@ -293,7 +293,7 @@ packet_read_expect(int expected_type) int r; if ((r = ssh_packet_read_expect(active_state, expected_type)) != 0) - sshpkt_fatal(active_state, __func__, r); + sshpkt_fatal(active_state, r, "%s", __func__); } void diff --git a/packet.c b/packet.c index ded5a3201..aa8be8c94 100644 --- a/packet.c +++ b/packet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: packet.c,v 1.279 2019/01/04 03:23:00 djm Exp $ */ +/* $OpenBSD: packet.c,v 1.280 2019/01/19 21:33:14 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -1809,10 +1809,10 @@ sshpkt_fmt_connection_id(struct ssh *ssh, char *s, size_t l) /* * Pretty-print connection-terminating errors and exit. */ -void -sshpkt_fatal(struct ssh *ssh, const char *tag, int r) +static void +sshpkt_vfatal(struct ssh *ssh, int r, const char *fmt, va_list ap) { - char remote_id[512]; + char *tag = NULL, remote_id[512]; sshpkt_fmt_connection_id(ssh, remote_id, sizeof(remote_id)); @@ -1846,6 +1846,11 @@ sshpkt_fatal(struct ssh *ssh, const char *tag, int r) } /* FALLTHROUGH */ default: + if (vasprintf(&tag, fmt, ap) == -1) { + ssh_packet_clear_keys(ssh); + logdie("%s: could not allocate failure message", + __func__); + } ssh_packet_clear_keys(ssh); logdie("%s%sConnection %s %s: %s", tag != NULL ? tag : "", tag != NULL ? ": " : "", @@ -1854,6 +1859,18 @@ sshpkt_fatal(struct ssh *ssh, const char *tag, int r) } } +void +sshpkt_fatal(struct ssh *ssh, int r, const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + sshpkt_vfatal(ssh, r, fmt, ap); + /* NOTREACHED */ + va_end(ap); + logdie("%s: should have exited", __func__); +} + /* * Logs the error plus constructs and sends a disconnect packet, closes the * connection, and exits. This function never returns. The error message @@ -1889,10 +1906,10 @@ ssh_packet_disconnect(struct ssh *ssh, const char *fmt,...) * for it to get sent. */ if ((r = sshpkt_disconnect(ssh, "%s", buf)) != 0) - sshpkt_fatal(ssh, __func__, r); + sshpkt_fatal(ssh, r, "%s", __func__); if ((r = ssh_packet_write_wait(ssh)) != 0) - sshpkt_fatal(ssh, __func__, r); + sshpkt_fatal(ssh, r, "%s", __func__); /* Close the connection. */ ssh_packet_close(ssh); diff --git a/packet.h b/packet.h index c58b52d39..74bb51108 100644 --- a/packet.h +++ b/packet.h @@ -1,4 +1,4 @@ -/* $OpenBSD: packet.h,v 1.87 2019/01/19 21:31:32 djm Exp $ */ +/* $OpenBSD: packet.h,v 1.88 2019/01/19 21:33:14 djm Exp $ */ /* * Author: Tatu Ylonen @@ -176,7 +176,8 @@ int sshpkt_send(struct ssh *ssh); int sshpkt_disconnect(struct ssh *, const char *fmt, ...) __attribute__((format(printf, 2, 3))); int sshpkt_add_padding(struct ssh *, u_char); -void sshpkt_fatal(struct ssh *ssh, const char *tag, int r); +void sshpkt_fatal(struct ssh *ssh, int r, const char *fmt, ...) + __attribute__((format(printf, 3, 4))); int sshpkt_msg_ignore(struct ssh *, u_int); int sshpkt_put(struct ssh *ssh, const void *v, size_t len); -- cgit v1.2.3 From 245c6a0b220b58686ee35bc5fc1c359e9be2faaa Mon Sep 17 00:00:00 2001 From: "djm@openbsd.org" Date: Sat, 19 Jan 2019 21:45:31 +0000 Subject: upstream: remove last traces of old packet API! with & ok markus@ OpenBSD-Commit-ID: 9bd10437026423eb8245636ad34797a20fbafd7d --- Makefile.in | 2 +- dispatch.h | 9 +- opacket.c | 321 ------------------------------------------------------------ opacket.h | 154 ----------------------------- 4 files changed, 2 insertions(+), 484 deletions(-) delete mode 100644 opacket.c delete mode 100644 opacket.h (limited to 'opacket.c') diff --git a/Makefile.in b/Makefile.in index 6ffccb482..2d2de7b49 100644 --- a/Makefile.in +++ b/Makefile.in @@ -88,7 +88,7 @@ LIBSSH_OBJS=${LIBOPENSSH_OBJS} \ canohost.o channels.o cipher.o cipher-aes.o cipher-aesctr.o \ cipher-ctr.o cleanup.o \ compat.o crc32.o fatal.o hostfile.o \ - log.o match.o moduli.o nchan.o packet.o opacket.o \ + log.o match.o moduli.o nchan.o packet.o \ readpass.o ttymodes.o xmalloc.o addrmatch.o \ atomicio.o dispatch.o mac.o uuencode.o misc.o utf8.o \ monitor_fdpass.o rijndael.o ssh-dss.o ssh-ecdsa.o ssh-rsa.o dh.o \ diff --git a/dispatch.h b/dispatch.h index 17a6f3db6..a22d7749f 100644 --- a/dispatch.h +++ b/dispatch.h @@ -1,4 +1,4 @@ -/* $OpenBSD: dispatch.h,v 1.14 2017/05/31 07:00:13 markus Exp $ */ +/* $OpenBSD: dispatch.h,v 1.15 2019/01/19 21:45:31 djm Exp $ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. @@ -46,11 +46,4 @@ void ssh_dispatch_range(struct ssh *, u_int, u_int, dispatch_fn *); int ssh_dispatch_run(struct ssh *, int, volatile sig_atomic_t *); void ssh_dispatch_run_fatal(struct ssh *, int, volatile sig_atomic_t *); -#define dispatch_init(dflt) \ - ssh_dispatch_init(active_state, (dflt)) -#define dispatch_range(from, to, fn) \ - ssh_dispatch_range(active_state, (from), (to), (fn)) -#define dispatch_set(type, fn) \ - ssh_dispatch_set(active_state, (type), (fn)) - #endif diff --git a/opacket.c b/opacket.c deleted file mode 100644 index e5ccf8099..000000000 --- a/opacket.c +++ /dev/null @@ -1,321 +0,0 @@ -/* $OpenBSD: opacket.c,v 1.9 2019/01/19 21:33:14 djm Exp $ */ -/* Written by Markus Friedl. Placed in the public domain. */ - -#include "includes.h" -/* $OpenBSD: opacket.c,v 1.8 2019/01/19 21:31:32 djm Exp $ */ -#include - -#include "ssherr.h" -#include "packet.h" -#include "opacket.h" /* XXX */ -#include "log.h" - -struct ssh *active_state, *backup_state; - -/* Map old to new API */ - -void -ssh_packet_start(struct ssh *ssh, u_char type) -{ - int r; - - if ((r = sshpkt_start(ssh, type)) != 0) - fatal("%s: %s", __func__, ssh_err(r)); -} - -void -ssh_packet_put_char(struct ssh *ssh, int value) -{ - u_char ch = value; - int r; - - if ((r = sshpkt_put_u8(ssh, ch)) != 0) - fatal("%s: %s", __func__, ssh_err(r)); -} - -void -ssh_packet_put_int(struct ssh *ssh, u_int value) -{ - int r; - - if ((r = sshpkt_put_u32(ssh, value)) != 0) - fatal("%s: %s", __func__, ssh_err(r)); -} - -void -ssh_packet_put_int64(struct ssh *ssh, u_int64_t value) -{ - int r; - - if ((r = sshpkt_put_u64(ssh, value)) != 0) - fatal("%s: %s", __func__, ssh_err(r)); -} - -void -ssh_packet_put_string(struct ssh *ssh, const void *buf, u_int len) -{ - int r; - - if ((r = sshpkt_put_string(ssh, buf, len)) != 0) - fatal("%s: %s", __func__, ssh_err(r)); -} - -void -ssh_packet_put_cstring(struct ssh *ssh, const char *str) -{ - int r; - - if ((r = sshpkt_put_cstring(ssh, str)) != 0) - fatal("%s: %s", __func__, ssh_err(r)); -} - -void -ssh_packet_put_raw(struct ssh *ssh, const void *buf, u_int len) -{ - int r; - - if ((r = sshpkt_put(ssh, buf, len)) != 0) - fatal("%s: %s", __func__, ssh_err(r)); -} - - -#ifdef WITH_OPENSSL -void -ssh_packet_put_bignum2(struct ssh *ssh, BIGNUM * value) -{ - int r; - - if ((r = sshpkt_put_bignum2(ssh, value)) != 0) - fatal("%s: %s", __func__, ssh_err(r)); -} - -# ifdef OPENSSL_HAS_ECC -void -ssh_packet_put_ecpoint(struct ssh *ssh, const EC_GROUP *curve, - const EC_POINT *point) -{ - int r; - - if ((r = sshpkt_put_ec(ssh, point, curve)) != 0) - fatal("%s: %s", __func__, ssh_err(r)); -} -# endif -#endif /* WITH_OPENSSL */ - -void -ssh_packet_send(struct ssh *ssh) -{ - int r; - - if ((r = sshpkt_send(ssh)) != 0) - fatal("%s: %s", __func__, ssh_err(r)); -} - -u_int -ssh_packet_get_char(struct ssh *ssh) -{ - u_char ch; - int r; - - if ((r = sshpkt_get_u8(ssh, &ch)) != 0) - fatal("%s: %s", __func__, ssh_err(r)); - return ch; -} - -u_int -ssh_packet_get_int(struct ssh *ssh) -{ - u_int val; - int r; - - if ((r = sshpkt_get_u32(ssh, &val)) != 0) - fatal("%s: %s", __func__, ssh_err(r)); - return val; -} - -u_int64_t -ssh_packet_get_int64(struct ssh *ssh) -{ - u_int64_t val; - int r; - - if ((r = sshpkt_get_u64(ssh, &val)) != 0) - fatal("%s: %s", __func__, ssh_err(r)); - return val; -} - - -#ifdef WITH_OPENSSL -void -ssh_packet_get_bignum2(struct ssh *ssh, BIGNUM * value) -{ - int r; - - if ((r = sshpkt_get_bignum2(ssh, value)) != 0) - fatal("%s: %s", __func__, ssh_err(r)); -} - -# ifdef OPENSSL_HAS_ECC -void -ssh_packet_get_ecpoint(struct ssh *ssh, const EC_GROUP *curve, EC_POINT *point) -{ - int r; - - if ((r = sshpkt_get_ec(ssh, point, curve)) != 0) - fatal("%s: %s", __func__, ssh_err(r)); -} -# endif -#endif /* WITH_OPENSSL */ - -void * -ssh_packet_get_string(struct ssh *ssh, u_int *length_ptr) -{ - int r; - size_t len; - u_char *val; - - if ((r = sshpkt_get_string(ssh, &val, &len)) != 0) - fatal("%s: %s", __func__, ssh_err(r)); - if (length_ptr != NULL) - *length_ptr = (u_int)len; - return val; -} - -const void * -ssh_packet_get_string_ptr(struct ssh *ssh, u_int *length_ptr) -{ - int r; - size_t len; - const u_char *val; - - if ((r = sshpkt_get_string_direct(ssh, &val, &len)) != 0) - fatal("%s: %s", __func__, ssh_err(r)); - if (length_ptr != NULL) - *length_ptr = (u_int)len; - return val; -} - -char * -ssh_packet_get_cstring(struct ssh *ssh, u_int *length_ptr) -{ - int r; - size_t len; - char *val; - - if ((r = sshpkt_get_cstring(ssh, &val, &len)) != 0) - fatal("%s: %s", __func__, ssh_err(r)); - if (length_ptr != NULL) - *length_ptr = (u_int)len; - return val; -} - -/* Old API, that had to be reimplemented */ - -void -packet_set_connection(int fd_in, int fd_out) -{ - active_state = ssh_packet_set_connection(active_state, fd_in, fd_out); - if (active_state == NULL) - fatal("%s: ssh_packet_set_connection failed", __func__); -} - -u_int -packet_get_char(void) -{ - return (ssh_packet_get_char(active_state)); -} - -u_int -packet_get_int(void) -{ - return (ssh_packet_get_int(active_state)); -} - -int -packet_read_seqnr(u_int32_t *seqnr) -{ - u_char type; - int r; - - if ((r = ssh_packet_read_seqnr(active_state, &type, seqnr)) != 0) - sshpkt_fatal(active_state, r, "%s", __func__); - return type; -} - -int -packet_read_poll_seqnr(u_int32_t *seqnr) -{ - u_char type; - int r; - - if ((r = ssh_packet_read_poll_seqnr(active_state, &type, seqnr))) - sshpkt_fatal(active_state, r, "%s", __func__); - return type; -} - -void -packet_close(void) -{ - ssh_packet_close(active_state); - active_state = NULL; -} - -void -packet_process_incoming(const char *buf, u_int len) -{ - int r; - - if ((r = ssh_packet_process_incoming(active_state, buf, len)) != 0) - sshpkt_fatal(active_state, r, "%s", __func__); -} - -void -packet_write_wait(void) -{ - int r; - - if ((r = ssh_packet_write_wait(active_state)) != 0) - sshpkt_fatal(active_state, r, "%s", __func__); -} - -void -packet_write_poll(void) -{ - int r; - - if ((r = ssh_packet_write_poll(active_state)) != 0) - sshpkt_fatal(active_state, r, "%s", __func__); -} - -void -packet_read_expect(int expected_type) -{ - int r; - - if ((r = ssh_packet_read_expect(active_state, expected_type)) != 0) - sshpkt_fatal(active_state, r, "%s", __func__); -} - -void -packet_disconnect(const char *fmt, ...) -{ - char buf[1024]; - va_list args; - - va_start(args, fmt); - vsnprintf(buf, sizeof(buf), fmt, args); - va_end(args); - ssh_packet_disconnect(active_state, "%s", buf); -} - -void -packet_send_debug(const char *fmt, ...) -{ - char buf[1024]; - va_list args; - - va_start(args, fmt); - vsnprintf(buf, sizeof(buf), fmt, args); - va_end(args); - ssh_packet_send_debug(active_state, "%s", buf); -} diff --git a/opacket.h b/opacket.h deleted file mode 100644 index f92fe586e..000000000 --- a/opacket.h +++ /dev/null @@ -1,154 +0,0 @@ -/* $OpenBSD: opacket.h,v 1.13 2018/07/06 09:03:02 sf Exp $ */ -#ifndef _OPACKET_H -/* Written by Markus Friedl. Placed in the public domain. */ - -/* Map old to new API */ -void ssh_packet_start(struct ssh *, u_char); -void ssh_packet_put_char(struct ssh *, int ch); -void ssh_packet_put_int(struct ssh *, u_int value); -void ssh_packet_put_int64(struct ssh *, u_int64_t value); -void ssh_packet_put_bignum2(struct ssh *, BIGNUM * value); -void ssh_packet_put_ecpoint(struct ssh *, const EC_GROUP *, const EC_POINT *); -void ssh_packet_put_string(struct ssh *, const void *buf, u_int len); -void ssh_packet_put_cstring(struct ssh *, const char *str); -void ssh_packet_put_raw(struct ssh *, const void *buf, u_int len); -void ssh_packet_send(struct ssh *); - -u_int ssh_packet_get_char(struct ssh *); -u_int ssh_packet_get_int(struct ssh *); -u_int64_t ssh_packet_get_int64(struct ssh *); -void ssh_packet_get_bignum2(struct ssh *, BIGNUM * value); -void ssh_packet_get_ecpoint(struct ssh *, const EC_GROUP *, EC_POINT *); -void *ssh_packet_get_string(struct ssh *, u_int *length_ptr); -char *ssh_packet_get_cstring(struct ssh *, u_int *length_ptr); - -/* don't allow remaining bytes after the end of the message */ -#define ssh_packet_check_eom(ssh) \ -do { \ - int _len = ssh_packet_remaining(ssh); \ - if (_len > 0) { \ - logit("Packet integrity error (%d bytes remaining) at %s:%d", \ - _len ,__FILE__, __LINE__); \ - ssh_packet_disconnect(ssh, \ - "Packet integrity error."); \ - } \ -} while (0) - -/* old API */ -void packet_close(void); -u_int packet_get_char(void); -u_int packet_get_int(void); -void packet_set_connection(int, int); -int packet_read_seqnr(u_int32_t *); -int packet_read_poll_seqnr(u_int32_t *); -void packet_process_incoming(const char *buf, u_int len); -void packet_write_wait(void); -void packet_write_poll(void); -void packet_read_expect(int expected_type); -#define packet_set_timeout(timeout, count) \ - ssh_packet_set_timeout(active_state, (timeout), (count)) -#define packet_connection_is_on_socket() \ - ssh_packet_connection_is_on_socket(active_state) -#define packet_set_nonblocking() \ - ssh_packet_set_nonblocking(active_state) -#define packet_get_connection_in() \ - ssh_packet_get_connection_in(active_state) -#define packet_get_connection_out() \ - ssh_packet_get_connection_out(active_state) -#define packet_set_protocol_flags(protocol_flags) \ - ssh_packet_set_protocol_flags(active_state, (protocol_flags)) -#define packet_get_protocol_flags() \ - ssh_packet_get_protocol_flags(active_state) -#define packet_start(type) \ - ssh_packet_start(active_state, (type)) -#define packet_put_char(value) \ - ssh_packet_put_char(active_state, (value)) -#define packet_put_int(value) \ - ssh_packet_put_int(active_state, (value)) -#define packet_put_int64(value) \ - ssh_packet_put_int64(active_state, (value)) -#define packet_put_string( buf, len) \ - ssh_packet_put_string(active_state, (buf), (len)) -#define packet_put_cstring(str) \ - ssh_packet_put_cstring(active_state, (str)) -#define packet_put_raw(buf, len) \ - ssh_packet_put_raw(active_state, (buf), (len)) -#define packet_put_bignum2(value) \ - ssh_packet_put_bignum2(active_state, (value)) -#define packet_send() \ - ssh_packet_send(active_state) -#define packet_read() \ - ssh_packet_read(active_state) -#define packet_get_int64() \ - ssh_packet_get_int64(active_state) -#define packet_get_bignum2(value) \ - ssh_packet_get_bignum2(active_state, (value)) -#define packet_remaining() \ - ssh_packet_remaining(active_state) -#define packet_get_string(length_ptr) \ - ssh_packet_get_string(active_state, (length_ptr)) -#define packet_get_string_ptr(length_ptr) \ - ssh_packet_get_string_ptr(active_state, (length_ptr)) -#define packet_get_cstring(length_ptr) \ - ssh_packet_get_cstring(active_state, (length_ptr)) -void packet_send_debug(const char *, ...) - __attribute__((format(printf, 1, 2))); -void packet_disconnect(const char *, ...) - __attribute__((format(printf, 1, 2))) - __attribute__((noreturn)); -#define packet_have_data_to_write() \ - ssh_packet_have_data_to_write(active_state) -#define packet_not_very_much_data_to_write() \ - ssh_packet_not_very_much_data_to_write(active_state) -#define packet_set_interactive(interactive, qos_interactive, qos_bulk) \ - ssh_packet_set_interactive(active_state, (interactive), (qos_interactive), (qos_bulk)) -#define packet_is_interactive() \ - ssh_packet_is_interactive(active_state) -#define packet_set_maxsize(s) \ - ssh_packet_set_maxsize(active_state, (s)) -#define packet_inc_alive_timeouts() \ - ssh_packet_inc_alive_timeouts(active_state) -#define packet_set_alive_timeouts(ka) \ - ssh_packet_set_alive_timeouts(active_state, (ka)) -#define packet_get_maxsize() \ - ssh_packet_get_maxsize(active_state) -#define packet_add_padding(pad) \ - sshpkt_add_padding(active_state, (pad)) -#define packet_send_ignore(nbytes) \ - ssh_packet_send_ignore(active_state, (nbytes)) -#define packet_set_server() \ - ssh_packet_set_server(active_state) -#define packet_set_authenticated() \ - ssh_packet_set_authenticated(active_state) -#define packet_get_input() \ - ssh_packet_get_input(active_state) -#define packet_get_output() \ - ssh_packet_get_output(active_state) -#define packet_check_eom() \ - ssh_packet_check_eom(active_state) -#define set_newkeys(mode) \ - ssh_set_newkeys(active_state, (mode)) -#define packet_get_state(m) \ - ssh_packet_get_state(active_state, m) -#define packet_set_state(m) \ - ssh_packet_set_state(active_state, m) -#define packet_get_raw(lenp) \ - sshpkt_ptr(active_state, lenp) -#define packet_get_ecpoint(c,p) \ - ssh_packet_get_ecpoint(active_state, c, p) -#define packet_put_ecpoint(c,p) \ - ssh_packet_put_ecpoint(active_state, c, p) -#define packet_get_rekey_timeout() \ - ssh_packet_get_rekey_timeout(active_state) -#define packet_set_rekey_limits(x,y) \ - ssh_packet_set_rekey_limits(active_state, x, y) -#define packet_get_bytes(x,y) \ - ssh_packet_get_bytes(active_state, x, y) -#define packet_set_mux() \ - ssh_packet_set_mux(active_state) -#define packet_get_mux() \ - ssh_packet_get_mux(active_state) -#define packet_clear_keys() \ - ssh_packet_clear_keys(active_state) - -#endif /* _OPACKET_H */ -- cgit v1.2.3