1. Jun 23, 2022
    • Benjamin Barenblat's avatar
      Go back to internal OCB implementation · bacc0240
      Benjamin Barenblat authored
      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.
      bacc0240
  2. Jun 14, 2022
    • Alex Chernyakhovsky's avatar
      Use OpenSSL native OCB-AES implementation · 135a11a2
      Alex Chernyakhovsky authored
      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
      135a11a2
  3. Jun 07, 2022
    • Benjamin Barenblat's avatar
      Separate OpenSSL-based OCB implementation from others · a563093f
      Benjamin Barenblat authored
      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
      a563093f
  4. May 31, 2022
  5. Feb 05, 2022
  6. Dec 11, 2021
  7. Dec 09, 2021
  8. Nov 05, 2021
  9. Oct 29, 2021
  10. Oct 21, 2021
  11. Aug 27, 2021
  12. Jul 21, 2021
  13. Jul 14, 2021
  14. Dec 06, 2020
  15. May 18, 2020
  16. May 17, 2020
  17. Oct 03, 2019
  18. Jul 11, 2019
    • John Hood's avatar
      Fix Appveyor build. · b1da7005
      John Hood authored
      Change the openssl-devel package to libssl-devel.  Cygwin still has an
      "obsolete" (essentially virtual) package for openssl-devel, but it
      doesn't seem to work properly on Appveyor's Cygwin install.
      
      Protobuf >= 3.6.0 requires C++11, which I added support for last year.
      But when I did that, I requested strict ANSI C++ compatibility, which
      causes Cygwin/newlib's libc feature test macros to be set to disable
      (at least) POSIX.1 extensions.  Let the Autoconf macro use its default
      instead (prefer GNU/extended C++, accept anything).
      b1da7005
  19. Jun 13, 2019
  20. Feb 11, 2019
    • Anders Kaseorg's avatar
      configure: Add --enable-static-LIBRARY options for selective static linking · f7a054c3
      Anders Kaseorg authored
      
      
      Statically linking mosh-server with glibc isn’t a great idea for
      various reasons (nsswitch modules, locale format incompatibilities).
      But we can provide most of the benefits of static linking by allowing
      specific library dependencies to be linked statically using -Bstatic
      and -Bdynamic.  The full set is enabled by
      
          ./configure --enable-static-libraries
      
      which is equivalent to
      
          ./configure --enable-static-libstdc++ --enable-static-libgcc \
            --enable-static-utempter --enable-static-zlib --enable-static-curses \
            --enable-static-crypto --enable-static-protobuf
      
      and results in binaries whose only runtime library dependencies are
      provided with libc:
      
          $ ldd src/frontend/mosh-server
                  linux-vdso.so.1 (0x00007ffe0b377000)
                  libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007fa0d9970000)
                  libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fa0d97e3000)
                  libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fa0d97c2000)
                  libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fa0d95d8000)
                  /lib64/ld-linux-x86-64.so.2 (0x00007fa0d9f6a000)
      
      Signed-off-by: default avatarAnders Kaseorg <andersk@mit.edu>
      f7a054c3
    • Anders Kaseorg's avatar
      6d30b18c
  21. Jan 04, 2019
    • Peter Edwards's avatar
      Apply latest consecutive resize, not earliest. · c3a27560
      Peter Edwards authored
      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.
      c3a27560
  22. Aug 30, 2018