Commit Graph

1220 Commits

Author SHA1 Message Date
Keegan McAllister 93325d3ef0 Include -fPIE when we check for $LD -pie
configure's linker flag check also compiles a C++ program.  g++ -pie informs
both the compiler and linker, but clang++ -Wl,-pie is only a linker flag, and
the linker will complain that the code hasn't been compiled as
position-independent.
2012-04-13 12:27:27 -04:00
Keegan McAllister 8c16ca8123 Try $LD -Wl,-pie if $LD -pie fails
clang on OS X wants the former.

c.f. http://bugs.ruby-lang.org/issues/5697
2012-04-13 12:27:27 -04:00
Keegan McAllister d2434d1a79 Check compiler support for -fno-default-inline and -pipe
clang was spewing warnings about the unrecognized -fno-default-inline.  (Oddly,
it warns only with -c, not when compiling directly to an executable.)  For
completeness we also check -pipe, even though clang is OK with that one.

It should be fine to omit either flag.  gcc -fno-default-inline drops the
implicit 'inline' annotation on functions defined inside a class scope, but
'inline' is only a hint anyway.  -fno-default-inline does not change linkage.
-pipe is merely a compile speed optimization.
2012-04-13 12:27:27 -04:00
Keegan McAllister 62b6137ff5 Grep for clang warnings when testing compiler flag support
There is no way to make clang's "argument unused" warning fatal.

Ideally the search string would also include 'clang: ' but this output might
depend on clang's argv[0].
2012-04-13 12:27:27 -04:00
Keegan McAllister b5ab0d0736 Document the binary hardening measures 2012-04-13 12:27:25 -04:00
Keegan McAllister 349e2d20c8 Use the hardening flags
Closes #79.
2012-04-13 12:25:09 -04:00
Keegan McAllister ffd7332f8d Detect binary hardening flags supported by the compiler and linker 2012-04-13 12:25:09 -04:00
Keegan McAllister f7fc34e0c7 Add ax_check_{compile,link}_flag.m4 2012-04-13 12:25:09 -04:00
Daniel O'Connor 3d76ec8208 Skip 'new' otherwise BSD getopt will think there are no options.
IMO 'new' should be dropped entirely since it's not optional and 'new' is the only choice.

If it were to change in future then it should go after all the options.

(closes #111)
2012-04-13 12:07:49 -04:00
Anders Kaseorg 1f34a08346 AX_CHECK_LIBRARY: Bump serial to match upstream
The m4_ifnblank patch was accepted upstream as
http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=commitdiff;h=7ea1d1b18e5c1c3300936dd89c3e55b5b370ae72

Signed-off-by: Anders Kaseorg <andersk@mit.edu>

(closes #153)
2012-04-13 12:06:23 -04:00
Keegan McAllister b86cf72ea4 README: Clarify that mosh-{client,server} don't need to be "installed" per se 2012-04-12 22:02:28 -07:00
Keegan McAllister 88de326344 README: Mention IRC channel 2012-04-12 21:53:02 -07:00
Keegan McAllister b803c49fc9 README: Add warning about env var security 2012-04-12 21:53:02 -07:00
Keegan McAllister afa09948fe README: Remove some information duplicated on mosh.mit.edu 2012-04-12 21:53:02 -07:00
Andy Stewart 99842c974f Augment Ubuntu PPA installation instructions.
Ubuntu 10.04 does not recognise `sudo add-apt-repository ppa:blah` out of the box.
2012-04-11 11:29:31 +03:00
Keith Winstein 719e085f3e Bump version number 2012-04-11 03:37:09 -04:00
Keith Winstein a67ae7b0f4 Support 16-color set (per Anders Kaseorg).
Closes #106 github issue.
Closes #133 github issue.
Closes #131 github issue.
2012-04-11 03:09:26 -04:00
termie 774e50dc19 Allow lowercase "utf-8" in charset for OS X iTerm.
Closes #104 github pull request.
2012-04-11 02:49:35 -04:00
Anders Kaseorg 9cec566cd1 Find ncurses from pkg-config if possible, and prefer separate libtinfo
Recent ncurses can be configured --with-termlib, which splits out the
terminfo-level functions from libncurses into a separate libtinfo.
This allows us to avoid an unnecessary dependency on libncurses.  (We
already avoided this on distributions that link with -Wl,--as-needed.)

Signed-off-by: Anders Kaseorg <andersk@mit.edu>

Closes #128 github pull request.
2012-04-11 02:47:55 -04:00
Peter Jeremy fd0ddf0e22 strtol(3) can optionally set errno to EINVAL if no conversion could be
performed and FreeBSD (at least) implements thin behaviour.  Add an
explicit test to detect this situation in Dispatcher::parse_params().
(This behaviour difference is not relevant to other uses of strtol()).

This corrects the mishandling of (eg) "CSI m" on FreeBSD.

Closes #129 github pull request.
[keithw -- also fixes same issue with mosh-server on OS X]
2012-04-11 02:46:26 -04:00
Keegan McAllister c6751cfb92 configure.ac: Fix protoc check
AC_MSG_ERROR inside the variable assignment doesn't work properly.  We get
output like

    checking for protoc... ./configure: line 4524: is: command not found
    no

and then the build continues (and fails) with PROTOC="".

Closes #132 github pull request.
2012-04-11 02:45:15 -04:00
Keith Winstein b4c47b77cf Fix bug involving wraparound copy-and-paste to a blank line.
Identified by Anders Kaseorg.

Test case:

( reset; seq 100; printf 'Hello, world!'; sleep 1;
printf '\t\t\t\t\t\t\t\t\t\t   \r\e[K'; sleep 1; printf '\n' )
> /dev/pts/16 2>&1

(replace /dev/pts/16 with mosh or termemu terminal)
2012-04-11 02:40:18 -04:00
Keith Winstein 4144f2e4f0 Don't clear wrap state on DEC set mode escape (matches xterm) 2012-04-11 01:58:20 -04:00
Keith Winstein d37b1c4387 Tweaks to Mac OS X build script to run 2012-04-09 15:51:26 -04:00
Peter Iannucci 4012348ec7 Packaging script for Mac OS X .pkg. 2012-04-09 15:51:26 -04:00
Keith Winstein 4d9483bc83 Fix build when libutil.h exists but is deprecated 2012-04-07 20:23:59 -04:00
Keegan McAllister c354a69ee6 Test the Mosh crypto layer 2012-04-06 23:43:42 -04:00
Keegan McAllister d1c4b0a5d7 Test the OCB-AES reference implementation
This tests cryptographic primitives implemented by others.  It uses the same
interfaces and indeed the same compiled object code as the Mosh client and
server.  It does not particularly test any code written for the Mosh project.
2012-04-06 23:43:42 -04:00
Keegan McAllister fe34cb3809 Create src/tests 2012-04-06 23:43:42 -04:00
Keegan McAllister 3b61581bcd Make aligned allocation without posix_memalign more robust
Instead of guessing the right function to use, we malloc() 15 bytes more than
we need, and compute the aligned offset within.  The AlignedBuffer class takes
care of passing the original pointer to free().
2012-04-06 23:43:41 -04:00
Keegan McAllister 0734640e14 Add a class for aligned buffers
This simplifies the core crypto routines, especially the error handling.  In
fact there was already one error path where we were failing to call free().
2012-04-06 23:43:41 -04:00
Peter Iannucci c19bce27e6 Added missing flags in src/statesync/Makefile.am
(closes #93)
2012-04-06 23:34:45 -04:00
Benjamin Kaduk 29539516e5 FreeBSD needs libutil.h for forkpty()
The header is not available everywhere, so only include it if it
is present.  (The extra include should be harmless on Linux by
inspection.)
2012-04-05 18:19:37 -04:00
Benjamin Kaduk 424e2b53e1 Allow <sys/endian.h> as well as <endian.h>
On FreeBSD, the header which defines htobe64() is the sys/ variant,
unlike Linux.
2012-04-05 18:19:37 -04:00
Keith Winstein 89971f7524 Update THANKS 2012-04-03 12:49:43 -04:00
Keith Winstein ba7d9479c6 Revert "Distribute ChangeLog to become lintian pedantic-clean"
This reverts commit 78c7c72b3c.
2012-04-03 12:48:24 -04:00
Keith Winstein 78c7c72b3c Distribute ChangeLog to become lintian pedantic-clean 2012-04-03 12:45:13 -04:00
Keith Winstein ef96859498 Bump version to 1.1.3. 2012-04-03 12:41:41 -04:00
Keith Winstein 78bfcd238b Document Ctrl-^ . escape sequence. 2012-04-03 12:41:37 -04:00
Keith Winstein 7e6356e887 Bump version to 1.1.2c 2012-04-02 19:08:59 -04:00
Keith Winstein 8221838f51 Fix bug sometimes causing missing (or spurious) wraparound copy-and-paste 2012-04-02 19:04:26 -04:00
Keith Winstein 7542070b8f Bump version to 1.1.2b 2012-03-31 17:25:43 -04:00
Keegan McAllister b4ef664bc0 Kill the session after encrypting 2^47 blocks
"Both the privacy and the authenticity properties of OCB degrade as
 per s^2 / 2^128, where s is the total number of blocks that the
 adversary acquires.... In order to ensure that s^2 / 2^128 remains
 small, a given key should be used to encrypt at most 2^48 blocks (2^55
 bits or 4 petabytes)"

-- http://tools.ietf.org/html/draft-krovetz-ocb-03

We deem it unlikely that a legitimate user will send 4 PB through a Mosh
session.  If it happens, we simply kill the session.  The server and
client use the same key, so we actually need to die after 2^47 blocks.

Closes #77.
2012-03-31 16:19:33 -04:00
Keegan McAllister ba6387f36c Allow CryptoExceptions to be fatal 2012-03-31 16:19:33 -04:00
Keith Winstein 519d1ee282 Bump version to 1.1.2a 2012-03-31 15:55:07 -04:00
Keegan McAllister ba9b16aafa Fully initialize the argument to TIOCSWINSZ
struct winsize contains fields other than ws_col and ws_row.  To avoid passing
uninitialized data to TIOCSWINSZ, initialize it first using TIOCGWINSZ.

Found by Valgrind.

(closes #85 github issue)
2012-03-31 15:41:34 -04:00
Keith Winstein 9a7f3ad33d Print warnings when IUTF8 missing 2012-03-31 15:20:30 -04:00
Keith Winstein 9119fa1c7d Add warning and check for IUTF8 2012-03-31 15:07:28 -04:00
Keith Winstein 4f79778ca5 Add warning for C libraries that don't commit to Unicode wchar_t 2012-03-31 15:07:12 -04:00
Keith Winstein edf6ec9052 Insert missing "if-then" instruction in OCB ARM assem so works with Thumb-2.
(closes #86 github issue)

(approved by Ted Krovetz, author of OCB reference implementation)
2012-03-31 14:31:22 -04:00