summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/packet.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* pass values used in KEX hash computation as sshbuf rather thandjm2019-01-211-1/+2
| | | | | | pointer+len suggested by me; implemented by markus@ ok me
* Make sshpkt_get_bignum2() allocate the bignum it is parsing ratherdjm2019-01-211-2/+2
| | | | | | than make the caller do it. Saves a lot of boilerplate code. from markus@ ok djm@
* allow sshpkt_fatal() to take a varargs format; we'll use this to givedjm2019-01-191-2/+3
| | | | | packet-related fatal error messages more context (esp. the remote endpoint) ok markus@
* begin landing remaining refactoring of packet parsing API, starteddjm2019-01-191-5/+1
| | | | | | | | | | | 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@
* ttymodes: switch to sshbuf API; ok djm@markus2018-07-091-3/+3
|
* Remove unused ssh_packet_start_compression()sf2018-07-061-2/+1
| | | | ok markus@
* Put remote client info back into the ClientAlive connection terminationdtucker2017-12-101-1/+2
| | | | message. Based in part on diff from lars.nooden at gmail, ok djm
* add sshd_config RDomain keyword to place sshd and the subsequentdjm2017-10-251-1/+3
| | | | | | | user session (including the shell and any TCP/IP forwardings) into the specified rdomain(4) ok markus@
* refactor channels.cdjm2017-09-121-2/+6
| | | | | | | | | | | | | | | | | | Move static state to a "struct ssh_channels" that is allocated at runtime and tracked as a member of struct ssh. Explicitly pass "struct ssh" to all channels functions. Replace use of the legacy packet APIs in channels.c. Rework sshd_config PermitOpen handling: previously the configuration parser would call directly into the channels layer. After the refactor this is not possible, as the channels structures are allocated at connection time and aren't available when the configuration is parsed. The server config parser now tracks PermitOpen itself and explicitly configures the channels code later. ok markus@
* clear session keys from memory; ok djm@markus2017-05-311-1/+3
|
* sshd: pass struct ssh to auth functions; ok djm@markus2017-05-301-1/+4
|
* remove miscellaneous SSH1 leftovers; ok markus@naddy2017-05-031-2/+1
|
* remove SSHv1 support from packet and buffer APIsdjm2017-04-301-4/+1
| | | | ok markus@
* remove compat20/compat13/compat15 variablesdjm2017-04-301-2/+1
| | | | ok markus@
* add ssh_packet_set_log_preamble() to allow inclusion of a preambledjm2017-02-031-1/+6
| | | | string in disconnect messages; ok markus@
* Make ssh_packet_set_rekey_limits take u32 for the number of secondsdtucker2017-02-031-2/+2
| | | | | | | | | | | | | until rekeying (negative values are rejected at config parse time). This allows the removal of some casts and a signed vs unsigned comparison warning. rekey_time is cast to int64 for the comparison which is a no-op on OpenBSD, but should also do the right thing in -portable on anything still using 32bit time_t (until the system time actually wraps, anyway). some early guidance deraadt@, ok djm@
* Add a per-packet input hook that is called with the decrypted packetdjm2016-10-111-1/+6
| | | | contents. This will be used for fuzzing; ok markus@
* ssh proxy mux mode (-O proxy; idea from Simon Tatham):markus2016-09-301-1/+5
| | | | | | | | | - mux client speaks the ssh-packet protocol directly over unix-domain socket. - mux server acts as a proxy, translates channel IDs and relays to the server. - no filedescriptor passing necessary. - combined with unix-domain forwarding it's even possible to run mux client and server on different machines. feedback & ok djm@
* Remove support for pre-authentication compression. Doing compressiondjm2016-09-281-6/+1
| | | | | | | | | | | | | | | | | early in the protocol probably seemed reasonable in the 1990s, but today it's clearly a bad idea in terms of both cryptography (cf. multiple compression oracle attacks in TLS) and attack surface. Moreover, to support it across privilege-separation zlib needed the assistance of a complex shared-memory manager that made the required attack surface considerably larger. Prompted by Guido Vranken pointing out a compiler-elided security check in the shared memory manager found by Stack (http://css.csail.mit.edu/stack/); ok deraadt@ markus@ NB. pre-auth authentication has been disabled by default in sshd for >10 years.
* refactor canohost.c: move functions that cache results closer to thedjm2016-03-071-2/+6
| | | | | | | places that use them (authn and session code). After this, no state is cached in canohost.c feedback and ok markus@
* refactor activation of rekeyingdjm2016-02-081-2/+2
| | | | | | | | | | | This makes automatic rekeying internal to the packet code (previously the server and client loops needed to assist). In doing to it makes application of rekey limits more accurate by accounting for packets about to be sent as well as packets queued during rekeying events themselves. Based on a patch from dtucker@ which was in turn based on a patch Aleksander Adamowski in bz#2521; ok markus@
* Allow RekeyLimits in excess of 4G up to 2**63 bits (limited by the returndtucker2016-01-291-2/+2
| | | | type of scan_scaled). Part of bz#2521, ok djm.
* remove roaming support; ok djm@markus2016-01-141-5/+1
|
* include remote port number in a few more messages; makes tying logdjm2015-12-111-1/+2
| | | | messages together into a session a bit easier; bz#2503 ok dtucker@
* avoid more fatal/exit in the packet.c paths that ssh-keyscandjm2015-01-301-5/+7
| | | | uses; feedback and "looks good" markus@
* avoid fatal() calls in packet codedjm2015-01-281-2/+2
| | | | | makes ssh-keyscan more reliable against server failures ok dtucker@ markus@
* add experimental api for packet layer; ok djm@markus2015-01-191-1/+13
|
* move dispatch to struct ssh; ok djm@markus2015-01-191-1/+8
|
* update packet.c & isolate, introduce struct sshmarkus2015-01-191-95/+133
| | | | | | | | a) switch packet.c to buffer api and isolate per-connection info into struct ssh b) (de)serialization of the state is moved from monitor to packet.c c) the old packet.c API is implemented in opacket.[ch] d) compress.c/h is removed and integrated into packet.c with and ok djm@
* unbreak compression, by re-init-ing the compression code in themarkus2014-05-031-1/+2
| | | | | | post-auth child. the new buffer code is more strict, and requires buffer_init() while the old code was happy after a bzero(); originally from djm@
* buffer_get_string_ptr's return should be const to reminddjm2014-04-281-2/+2
| | | | | callers that futzing with it will futz with the actual buffer contents
* fix pointer-signedness warnings from clang/llvm-3.3; "seems nice" deraadt@djm2013-07-121-2/+2
|
* Add an optional second argument to RekeyLimit in the client to allowdtucker2013-05-161-2/+3
| | | | | rekeying based on elapsed time in addition to amount of traffic. with djm@ jmc@, ok djm
* packet_read_poll() is not used anymore.markus2012-01-251-2/+1
|
* set traffic class for IPv6 traffic as we do for IPv4 TOS;djm2011-05-061-2/+1
| | | | | patch from lionel AT mamane.lu via Colin Watson in bz#1855; ok markus@
* allow ssh and sshd to set arbitrary TOS/DSCP/QoS values instead ofdjm2010-11-131-2/+2
| | | | | | hardcoding lowdelay/throughput. bz#1733 patch from philipp AT redfish-solutions.com; ok markus@ deraadt@
* Implement Elliptic Curve Cryptography modes for key exchange (ECDH) anddjm2010-08-311-1/+4
| | | | | | | | | | | | | | | | | host/user keys (ECDSA) as specified by RFC5656. ECDH and ECDSA offer better performance than plain DH and DSA at the same equivalent symmetric key length, as well as much shorter keys. Only the mandatory sections of RFC5656 are implemented, specifically the three REQUIRED curves nistp256, nistp384 and nistp521 and only ECDH and ECDSA. Point compression (optional in RFC5656 is NOT implemented). Certificate host and user keys using the new ECDSA key types are supported. Note that this code has not been tested for interoperability and may be subject to change. feedback and ok markus@
* Add buffer_get_cstring() and related functions that verify that thedjm2010-08-311-1/+2
| | | | | | | | | | | | | string extracted from the buffer contains no embedded \0 characters* This prevents random (possibly malicious) crap from being appended to strings where it would not be noticed if the string is used with a string(3) function. Use the new API in a few sensitive places. * actually, we allow a single one at the end of the string for now because we don't know how many deployed implementations get this wrong, but don't count on this to remain indefinitely.
* packet_bacup_state() and packet_restore_state() will be used toandreas2009-06-271-1/+4
| | | | | temporarily save the current state ren resuming a suspended connection. ok markus@
* Add packet_put_int64() and packet_get_int64(), part of a larger changeandreas2009-05-271-1/+3
| | | | | from Martin Forssen. ok markus@
* Put the globals in packet.c into a struct and don't access it directlyandreas2009-05-251-4/+8
| | | | | from other files. No functional changes. ok markus@ djm@
* sync v1 and v2 traffic accounting; add it to sshd, too; ok djm@, dtucker@markus2008-07-101-3/+3
|
* Make keepalive timeouts apply while waiting for a packet, particularly duringdtucker2008-06-121-1/+2
| | | | key renegotiation (bz #1363). With djm and Matt Day, ok djm@
* avoid extra malloc/copy/free when receiving data over the net;markus2008-05-081-1/+2
| | | | ~10% speedup for localhost-scp; ok djm@
* Allow all SSH2 packet types, including UNIMPLEMENTED to reset thedtucker2008-02-221-1/+2
| | | | keepalive timer (bz #1307). ok markus@
* standardise spacing in $OpenBSD$ tags; requested by deraadt@djm2006-03-251-1/+1
|
* move #include <termios.h> out of includes.h; ok markus@stevesk2006-02-071-1/+3
|
* add a new compression method that delays compression until the usermarkus2005-07-251-1/+3
| | | | | | | | | has been authenticated successfully and set compression to 'delayed' for sshd. this breaks older openssh clients (< 3.5) if they insist on compression, so you have to re-enable compression in sshd_config. ok djm@
* make this -Wsign-compare clean; ok avsm@ markus@djm2005-06-171-2/+2
|
* improve some code lint did not like; djm millert okderaadt2004-05-111-2/+2
|