cli: Fix FTBFS on kfreebsd

Update terminal handling borrowed from busybox. Do not modify any input
mode bits. Do not clear the TOSTOP mode flag.

Do the same for the example program.

Signed-off-by: Mike Miller <mtmiller@ieee.org>
Merge pull request #2 from mtmiller/fix-termios

cli: Fix FTBFS on kfreebsd
autoconf: Don't strip binaries by default

Some distributions like to be able to ship unstripped (but optimized)
binaries.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Add support for 6-digit tokencodes

Honor the digit bitfield in the ctf string.  All this really means is
that if the digit field asks for <8 digits, we truncate the most
significant digits: 12345678 -> 345678 (for 6).  This matches the behavior
of the RSA Android app.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
securid: Fix handling of PIN-less tokens

FLD_PINMODE_MASK is already shifted.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Update changelog

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
autoconf: Check for presence of mlockall()

This is present on most systems, but missing on Android.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Update changelog

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
autoconf: Update C&Ped text to say "stoken.pc"

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
buildsys: Fix out-of-tree builds

It is necessary to use the full path to libstoken.map.  Also, use the
new AC_CONFIG_FILES syntax, as AC_OUTPUT(args) is deprecated.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
library: Add new stoken_check_devid() API

stoken_decrypt_seed() just returns pass/fail for both the password and
device ID.  But it is possible for stoken to tell whether the device ID
matches the 15-bit hash stored in the token.  So provide a way to report
that feedback to the caller.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
library: Add new stoken_encrypt_seed() API

This will primarily be used for re-encoding a user-supplied token string
that is encrypted with a device ID or password.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
gitignore: Make "stoken" more specific

It is not good for "stoken" to match subdirectory names.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
JNI: Add stub to the build

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
JNI: Initial commit of the native interface C code

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
JNI: Initial commit of Java wrapper library and test program

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>