autoconf: Move feature test macros into config.h

For now we'll use AC_GNU_SOURCE.  To be revisited later.

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

This makes it much easier to notice warnings.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
autoconf: Use AS_COMPILER_FLAGS to set -W flags

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
sdtid: Allow --new-devid parameter on stoken issue / stoken export --xml

This can also be specified via <DeviceSerialNumber> in the template file.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
library: Fix const correctness warning on fopen() mode

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
securid: Avoid pointer arithmetic on void *

This is a GNU extension; the behavior is undefined in standard C.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
sdtid: Add "interactive" flag

For CLI/GUI users, it is good to dump more explicit error messages to
the terminal, for e.g. missing fields or bad XML input.  For library users
we probably don't want to do this.  So add an "interactive" flag so the
functionality can be enabled/disabled as needed.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
sdtid: Trivial comment and spacing fixes

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
sdtid: Make error handling more helpful

In interactive (CLI) mode, sdtid.c will now print information about
missing nodes, MAC mismatches, and other common problems.

This also changes the MAC checking logic so that it does a better job
detecting missing passwords vs. bad passwords vs. malformed input.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
man: Update docs with info on sdtid files and "stoken issue"

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
sdtid: Rename securid_* functions to sdtid_*

This makes for a cleaner separation between securid.[ch] and sdtid.[ch].

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Reshuffle headers to get common.h out of the library

common.[ch] should be used for the CLI/GUI programs only.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
examples: Add sdtid example

Importing the sdtid file from argv[1] is hacky, but it's enough to
illustrate the concept.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
sdtid: First attempt at supporting encoded chars

This still fails on a lot of inputs but it is a starting point.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
sdtid-test: Initial commit of stress test script

This also fails after a few rounds.  Known trouble spots include:

 - Non-ASCII characters
 - Nodes that have no string (not even a space): <Foo></Foo>
 - Cases where Origin, Dest, or Name (and probably others) have >=32 chars

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Bump version to 0.5 and update changelog

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
sdtid: Fix memory leak and use consistent encoding APIs

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
autoconf: Add java/ and examples/ to the dist bundle

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