common: Initialize tomcrypt RSA/SHA1/PKCS#1 support on startup

These are global libtomcrypt settings so they shouldn't be done from
the library (sdtid.c).

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
sdtid: Generate valid TKNTrailer sections

The BatchSignature uses v1.5 PKCS#1 signatures, SHA1+RSA, no salt
(RFC 3447).

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
sdtid: Fix valgrind errors in replace_b64()

We actually need to allocate one more byte than BASE64_INPUT_LEN()
specifies, because of the '=' hack on <Seed>.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
sdtid: Fix memory leak on "stoken issue --template"

We can't use pairs->value and a __lookup_common() result interchangeably
because the latter item is caller-freed.  Restructure the function to
make sure this is handled properly.

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