aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
Commit message (Collapse)AuthorAge
* Fix up clang-formatting a bitHEADmasterGravatar Benjamin Barenblat2023-08-07
| | | | Move some characters around to optimize clang-format output.
* clang-format MoshGravatar Benjamin Barenblat2023-08-07
| | | | | | | | Run clang-format over the Mosh source tree. This is a large change and has been factored into its own commit for auditability. Reproduce it with find . -name \*.cc -or -name \*.h | while read f; do clang-format -i --style=file $f; done
* Add a clang-format file and prepare for clang-formattingGravatar Benjamin Barenblat2023-08-07
| | | | | | | | | Create .clang-format to describe the current C++ style used in Mosh. Mark one carefully-formatted array with `// clang-format off`. Also turn off clang-format in src/crypto/ocb_internal.cc, since it was imported almost wholesale from another project and is written in a style different from the rest of Mosh.
* Add missing fatal_assert.h includeGravatar Alex Chernyakhovsky2023-08-07
|
* Use pipe to communicate between client and server at startupGravatar Ashley Hedberg2023-08-07
| | | | Fixes empty line on login
* Switch to C++ versions of standard C headersGravatar Alex Chernyakhovsky2023-07-30
|
* Remove using-declarations for std:: typesGravatar Alex Chernyakhovsky2023-07-30
|
* Modernize all typedefs with using statementsGravatar Alex Chernyakhovsky2023-07-30
|
* Removed shared_ptr shimGravatar Alex Chernyakhovsky2023-07-30
| | | | | Since C++17 is now the default mosh version, remove the shared_ptr shim in favor of std::shared_ptr.
* Switch to fully-qualified #includeGravatar Alex Chernyakhovsky2023-07-30
| | | | | | | Previously, mosh used extensive -I flags and all of the mosh-local makes it really hard to tell what the proper dependency graph is, so instead remove the -I arguments in favvor of $(top_srcdir) and qualify the paths wherever they are used.
* Rename VERSION to VERSION.stampGravatar Alex Chernyakhovsky2023-07-30
| | | | | -I$(top_srcdir) is not usable on macOS due to a conflicting C++ header `version`.
* Disable emulation-attributes-bce on tmux 3.3aGravatar Alex Chernyakhovsky2022-10-26
| | | | | | tmux 3.3a has a behavior change, since reverted, that is incompatible with this test. Unfortunately, tmux 3.3a has already made it into some distributions, so the test has to be disabled when tmux 3.3a is encountered.
* Audit and fix up format stringsGravatar Benjamin Barenblat2022-08-03
|
* Fixes for distcheckGravatar Alex Chernyakhovsky2022-07-05
|
* Correct memory leak in ocb-aes testGravatar Alex Chernyakhovsky2022-07-05
|
* OCB: Use OpenSSL EVP instead of deprecated AESGravatar Benjamin Barenblat2022-06-27
| | | | | | | Replace calls to AES_* APIs, which were deprecated in OpenSSL 3, with calls to EVP_* APIs. Closes: https://github.com/mobile-shell/mosh/issues/1174
* Stop using deprecated Nettle functionsGravatar Alex Chernyakhovsky2022-06-27
| | | | | | | | | Previously, ocb_internal.cc supported different key sizes, by way of the deprecated aes_* function family. However, in practice, mosh always uses AES-128. In Nettle, the explicit key-size APIs are not deprecated, so switch to AES-128 directly. Fixes: 1202
* OCB: Heap-allocate keysGravatar Benjamin Barenblat2022-06-27
| | | | | | | The OpenSSL EVP API requires that keys be heap-allocated, so switch _ae_ctx to use pointers to keys and opaque allocation functions. Bug: https://github.com/mobile-shell/mosh/issues/1174
* OCB: Make primitive AES API explicitGravatar Benjamin Barenblat2022-06-27
| | | | | | | | | | | | Explicitly define the primitive AES API used by the internal OCB implementation, and move it into its own namespace (ocb_aes). This will ease future implementation changes. Also make some style fixes to affected lines: Replace C-style casts with C++-style casts, add some missing spaces in argument lists, and remove some `inline` that the compiler will ignore. Bug: https://github.com/mobile-shell/mosh/issues/1174
* Delete unused ROUNDS macroGravatar Benjamin Barenblat2022-06-27
| | | | | This macro was used in the reference and AES-NI AES implementations, both of which were deleted in a563093f16be3fca2127224d5c6db36db60c79ca.
* Add nettle to the CI matrixGravatar Alex Chernyakhovsky2022-06-27
|
* Go back to internal OCB implementationGravatar Benjamin Barenblat2022-06-22
| | | | | | | | | | | | | | | | | | | | After further discussion, the Mosh maintainers have decided to stick with the internal OCB implementation for this release. Restore support for using OpenSSL’s AES but internal OCB. To make this commit easy to audit, restore the code exactly, including calls to AES functions that are deprecated in OpenSSL 3; a future commit will update ocb_internal.cc to use EVP instead of directly calling the AES primitives. In anticipation of future changes, preserve support for OpenSSL’s AES-OCB, but don’t compile it in. Add --with-crypto-library=openssl-with-openssl-ocb and --with-crypto-library=openssl-with-internal-ocb options to configure so that developers can easily test Mosh using OpenSSL’s AES-OCB. These options are intended only for testing, are undocumented, and are not subject to any API stability guarantees. Rework configure to look for all possible cryptography libraries first and then dispatch on --with-crypto-library as appropriate.
* Use OpenSSL native OCB-AES implementationGravatar Alex Chernyakhovsky2022-06-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | OpenSSL 3.0 deprecated many of the functions that ocb.cc used to implement OCB-AES, causing a build failure when -Wdeprecated collided with -Werror. Debian temporarily fixed this by suppressing the error in #1191. Since mosh 1.4 will be the next stable release of mosh, it should not depend on deprecated functions in OpenSSL. Since version 1.1.0, OpenSSL natively supports OCB-AES through the EVP_CIPHER API. @cgull started early support for this in #924. This change extends upon the previous work by @cgull in a few ways * EVP_CipherInit_ex is called in ae_init to set up the EVP_CIPHER_CTX. It is later called in ae_encrypt and ae_decrypt just to load nonce (IV in OpenSSL EVP parlance), which reduces the amount of initialization done per-packet. However, due to OpenSSL API limitations, two copies of the EVP_CIPHER_CTX are kept: one for encryption, and one for decryption. * Adds missing support for an external tag, rather than just one appended to the ciphertext * Support for non-default-sized tags as well as some improved error handling. Note that this change raises the minimum OpenSSL version for Mosh to 1.1.0. OpenSSL does not provide security support for versions prior to 1.1 at this time, so this is in principle reasonable dependency. If we want to continue to support distributions (such as RHEL7) which continue to be supported by their vendor but use an unsupported OpenSSL, then some future work will have to restore the ocb.cc implementation that uses the deprecated functions. Bugs: #1174
* Separate OpenSSL-based OCB implementation from othersGravatar Benjamin Barenblat2022-06-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Split src/crypto/ocb.cc into two files – one containing the AES-OCB implementation backed by OpenSSL, and the other containing implementations backed by Apple Common Crypto and Nettle. This paves the way for a new OpenSSL implementation that uses OpenSSL 1.1’s OCB support directly, rather than one that merely uses OpenSSL to provide the underlying block cipher. Remove support for rijndael-alg-fst.c and compiler-provided AES intrinsics, since they’re not in use anymore. (Mosh can still use hardware-accelerated AES if it’s available; it just now relies exclusively on the underlying cryptography library to accelerate AES if possible.) Update the build system to conditionally compile in either ocb_openssl.cc or ocb_internal.cc, depending on which cryptography library you pass to ./configure. To make this commit easy to audit, ocb_openssl.cc and ocb_internal.cc are trivially diffable against ocb.cc (now deleted). Expected diffs consist of a copyright notice update, a preprocessor check to ensure the appropriate cryptography implementation has been selected, and deletions to remove code that’s no longer in use. This does mean a substantial amount of code is duplicated between ocb_openssl.cc and ocb_internal.cc; however, ocb_openssl.cc should be completely replaced soon, so it won’t be an issue in the long term. Bug: https://github.com/mobile-shell/mosh/issues/1174
* Revert "Remove redundant malloc/free"Gravatar Alex Chernyakhovsky2022-05-30
| | | | | | | | | | | | | | | | | | | This reverts commit 6321b1d9c50b202e1823ba62ea8e47f6b08bdb2e. The original commit 6321b1d9c50b202e1823ba62ea8e47f6b08bdb2e switched from a malloc call of a 22400 byte buffer to a stack-allocated 22400 byte buffer, in addition to the fairly large buffers already allocated in the functions. Some systems have fairly small stack frames, making this 22K allocation potentially dangerous. On my stock Debian bullseye system, I have 200809 bytes (from `getconf _POSIX_THREAD_ATTR_STACKSIZE`); a 22400 byte buffer already represents about 10% of the available stacksize. Other systems, such as those with musl libc, may have either 80KiB or 128KiB [1], making this allocation represent between 18% to 28% of the available stack space. [1] https://wiki.musl-libc.org/functional-differences-from-glibc.html#Thread-stack-size
* Add fuzzer for the terminalGravatar Alex Chernyakhovsky2022-05-30
| | | | | | This commit adds a fuzzer for more of the terminal pipeline, adding coverage for the input and output portions of the terminal framebuffer.
* Add fuzzing infrastructureGravatar Alex Chernyakhovsky2022-05-30
| | | | | | | | This commit adds the --enable-fuzzing (and --enable-asan, to make fuzzing more useful) options and a sample fuzzer for the terminal parser. At this time only libfuzzer is supported. Future changes to add AFL to get more fuzzing capability should be possible with the addition of the afl_driver.cc from Chromium.
* Add support for generating coverage reportsGravatar Alex Chernyakhovsky2022-05-30
| | | | | | | | This change adds autoconf/automake support for building all of mosh with gcov, and generates an lcov html report. This allows seeing which parts ofthe source tree have good test coverage, and which can be shored up. Eventually, it would be good to hook this up to Github Actions to be generated automatically.
* Merge pull request #1150 from ncfavier/patch-1Gravatar Andrew Chin2021-12-10
|\ | | | | Add tmux and alacritty to title_term_types
* | Only use CLOCK_MONOTONIC_RAW with __APPLE__ systems.Gravatar Harry Sintonen2021-10-21
| |
| * Add tmux and alacritty to title_term_typesGravatar Naïm Favier2021-08-26
| | | | | | Resolves #1130
* | Use CLOCK_MONOTONIC_RAW when availableGravatar Harry Sintonen2020-12-05
|/
* If exec()ing the remote command fails, pause brieflyGravatar John Hood2020-05-18
| | | | This makes the resulting error from mosh-server visible in ordinary usage.
* Move generated includes to their own directory to avoid conflicts.Gravatar John Hood2020-05-17
| | | | | | | Fixes #1051, mosh fails to build on case-insensitive filesystems. XXX This isn't perfect because autoconf/automake drop several extra files in the directory anyway.
* Apply latest consecutive resize, not earliest.Gravatar Peter Edwards2019-01-04
| | | | | | | | | | If there are consecutive resize events in the userstream to be applied in "serve", we should apply the last/latest one in the sequence, not the first/earliest one. This fixes a problem where a flurry of resize events (eg, generated by a window manager resizing the client), can cause mosh to have an out-of-date idea as to what the physical geometry of the window is.
* unicode-later-combining.test: Document slightly.Gravatar John Hood2018-08-29
|
* Some more namespace hygiene for "using decl;".Gravatar John Hood2018-08-15
|
* Remove "using namespace std;".Gravatar John Hood2018-08-15
|
* Always use std::min, std::max.Gravatar John Hood2018-08-15
|
* Fix bind(2) being misinterpreted as std::bind() with libc++7 on FreeBSD.Gravatar John Hood2018-08-15
| | | | https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230624
* Fix more inappropriate const_iterator usage.Gravatar John Hood2018-08-03
|
* src/statesync/completeterminal.cc: fix bad iterator typeGravatar John Hood2018-08-03
|
* C++03 bound functions are not available in C++17; removeGravatar John Hood2018-08-03
| | | | This makes me a little sad, it's time to move to C++11 or greater.
* Ignore select() errors on Travis/MacOS.Gravatar John Hood2018-08-03
|
* mosh-server: improve error loggingGravatar John Hood2018-08-03
| | | | | Also stop using _exit(), believed unnecessary now with proper stdio flushing.
* Fix gcc8 snprintf truncation warning.Gravatar John Hood2018-04-11
|
* Type Select::got_signal as volatile sig_atomic_tGravatar Anders Kaseorg2018-01-18
| | | | | | Fixes #634. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
* Use HAVE_UTEMPTER instead of HAVE_UPTEMPTERGravatar Michael Jarvis2017-11-21
| | | | | Fix typo for issue #942: - mosh-server incorrectly reports detached session in utmp/wtmp
* Construct socket name correctly for tmux_check()Gravatar John Hood2017-11-08
| | | | | In moving this function from e2e-test, I forgot that it depends on a variable set there.
* Add a separate test for BCEGravatar John Hood2017-11-08
| | | | This test is properly gated on tmux 2.4.