autoconf: Add configure option --enable-valgrind

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
autoconf: Fix up --enable-debug handling

Respect $enableval, add [default=no] to help text, and add -fno-inline.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
travis: Run "make check" under valgrind on each new commit

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Start moving crypto wrappers into a separate module

Since we want to be able to use nettle/tomcrypt/... interchangeably,
we will want to call generic wrapper functions instead of directly
invoking the crypto library.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
stc: Move AES wrappers into stc-tomcrypt.c

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
securid: Make securid_rand() crypto-library-agnostic

rng_get_bytes() typically just reads /dev/urandom anyway.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
stc: Move sha1 and sha256 wrappers into stc-tomcrypt.c

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
stc: Add base64 wrappers to stc-tomcrypt.c

securid.c is now <tomcrypt.h>-free.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
stc: Move RSA signature wrapper into stc-tomcrypt.c

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
autoconf: Probe libtomcrypt for RSA support

As seen in Bug #13, not all tomcrypt packages link against libtommath.
Catch this at ./configure time so that we can substitute another crypto
library if available.  Or maybe link with TomsFastMath if that is
available instead.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
autoconf: Use generic CRYPTO_* names in Makefile.am

This will make it easier to substitute a different crypto library.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Initial commit of nettle support

Add stc-nettle.c wrappers and autoconf magic.  This passes "make check".
Tested on nettle/hogweed 2.4 (Ubuntu 12.04) and 2.7 (Ubuntu 14.04).

Fixes #12.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
travis: Add test build using nettle

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
README: mention nettle as dependency
buildsys: Add ACLOCAL_AMFLAGS to specify the m4 directory

This fixes an autoreconf warning, and is documented under
AC_CONFIG_MACRO_DIR (section 4.4) in the autoconf manual.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
buildsys: Move some autoconf files to build-aux/ directory

This eliminates a bit of clutter at the top level.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
tests: Convert to the new parallel test harness

automake 1.11+ allows us to define a custom test runner, so the test
cases can be defined as trivial "*.pipe" and "*.ref" files; a common
runner script "pipe-wrapper.sh" executes each one and checks the output
against a known-good result.

The most immediate need for this change is to fix bug #14
("make -j4 check" fails due to hardcoded temp filenames), but it should
also make it easier to add new tests in the future.

Reported-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
Signed-off-by: Kevin Cernekee <cernekee@gmail.com>