summaryrefslogtreecommitdiff
path: root/keypair.c
diff options
context:
space:
mode:
authorDaniel Borkmann <dborkman@redhat.com>2013-06-11 00:23:16 +0200
committerDaniel Borkmann <dborkman@redhat.com>2013-06-11 00:23:16 +0200
commitf1e8419d9f5cf87570938fe5f4aafeb0e646478a (patch)
tree6091e2407e0a2c243e21c0fe855d6e6cb9afcb76 /keypair.c
parent22aeecb491b346fe944f38e083cd26d4d235c632 (diff)
keypair: do selftest before generating and verifying keypair
Be paraniod and make a selftest. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Diffstat (limited to 'keypair.c')
-rw-r--r--keypair.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/keypair.c b/keypair.c
index e61482c..724bf05 100644
--- a/keypair.c
+++ b/keypair.c
@@ -22,6 +22,8 @@ void generate_keypair(void)
xmemset(publickey, 0, sizeof(publickey));
xmemset(secretkey, 0, sizeof(secretkey));
+ curve25519_selftest();
+
printf("Reading from %s (this may take a while) ...\n",
HIG_ENTROPY_SOURCE);
@@ -49,6 +51,8 @@ void verify_keypair(void)
unsigned char secretkey[crypto_box_sec_key_size];
char file[128];
+ curve25519_selftest();
+
xmemset(publickey, 0, sizeof(publickey));
xmemset(publicres, 0, sizeof(publicres));
xmemset(secretkey, 0, sizeof(secretkey));