enable ltm, add key blinding, add remove tfm

This commit is contained in:
Love Hornquist Astrand
2010-08-15 15:06:58 -07:00
parent 44dfbeb596
commit 763a72b73a
143 changed files with 482 additions and 21199 deletions

View File

@@ -81,6 +81,7 @@ static void
check_rsa(const unsigned char *in, size_t len, RSA *rsa, int padding)
{
unsigned char *res, *res2;
unsigned int len2;
int keylen;
res = malloc(RSA_size(rsa));
@@ -129,6 +130,14 @@ check_rsa(const unsigned char *in, size_t len, RSA *rsa, int padding)
if (memcmp(res2, in, len) != 0)
errx(1, "string not the same after decryption");
len2 = keylen;
if (RSA_sign(NID_sha1, in, len, res, &len2, rsa) != 1)
errx(1, "RSA_sign failed");
if (RSA_verify(NID_sha1, in, len, res, len2, rsa) != 1)
errx(1, "RSA_verify failed");
free(res);
free(res2);
}