summaryrefslogtreecommitdiff
path: root/tests/basic.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2011-06-09 14:44:18 +0200
committerWerner Koch <wk@gnupg.org>2011-06-09 14:44:18 +0200
commit870b764bb551b726d4a88877533041a4680423db (patch)
tree87db469a0d1cc97fff102d0dad3801c5b641f0c0 /tests/basic.c
parentce235fc29562666277ab72e2745636ffbe987fba (diff)
downloadlibgcrypt-870b764bb551b726d4a88877533041a4680423db.tar.gz
Add random-override parameter to the PK functions to allow better regression testing.
Diffstat (limited to 'tests/basic.c')
-rw-r--r--tests/basic.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/basic.c b/tests/basic.c
index 0c669386..95cc7494 100644
--- a/tests/basic.c
+++ b/tests/basic.c
@@ -2340,6 +2340,11 @@ check_pubkey_sign (int n, gcry_sexp_t skey, gcry_sexp_t pkey, int algo)
" (hash sha1 #11223344556677889900AABBCCDDEEFF10203040#))\n",
GCRY_PK_RSA,
0 },
+ { "(data\n (flags pss)\n"
+ " (hash sha1 #11223344556677889900AABBCCDDEEFF10203040#)\n"
+ " (random-override #4253647587980912233445566778899019283747#))\n",
+ GCRY_PK_RSA,
+ 0 },
{ NULL }
};
@@ -2423,6 +2428,13 @@ check_pubkey_crypt (int n, gcry_sexp_t skey, gcry_sexp_t pkey, int algo)
1,
0,
0 },
+ { "(data\n (flags oaep)\n (hash-algo sha1)\n (label \"test\")\n"
+ " (value #11223344556677889900AA#)\n"
+ " (random-override #4253647587980912233445566778899019283747#))\n",
+ "(flags oaep)(hash-algo sha1)(label \"test\")",
+ 1,
+ 0,
+ 0 },
{ "(data\n (flags )\n" " (value #11223344556677889900AA#))\n",
NULL,
1,
@@ -2475,7 +2487,8 @@ check_pubkey_crypt (int n, gcry_sexp_t skey, gcry_sexp_t pkey, int algo)
for (dataidx = 0; datas[dataidx].data; dataidx++)
{
if (verbose)
- fprintf (stderr, " encryption/decryption test %d\n", dataidx);
+ fprintf (stderr, " encryption/decryption test %d (algo %d)\n",
+ dataidx, algo);
rc = gcry_sexp_sscan (&data, NULL, datas[dataidx].data,
strlen (datas[dataidx].data));
@@ -2563,6 +2576,8 @@ check_pubkey_grip (int n, const unsigned char *grip,
{
unsigned char sgrip[20], pgrip[20];
+ (void)algo;
+
if (!gcry_pk_get_keygrip (skey, sgrip))
die ("get keygrip for private RSA key failed\n");
if (!gcry_pk_get_keygrip (pkey, pgrip))