diff options
author | Daniel Borkmann <dborkman@redhat.com> | 2013-06-11 00:23:16 +0200 |
---|---|---|
committer | Daniel Borkmann <dborkman@redhat.com> | 2013-06-11 00:23:16 +0200 |
commit | f1e8419d9f5cf87570938fe5f4aafeb0e646478a (patch) | |
tree | 6091e2407e0a2c243e21c0fe855d6e6cb9afcb76 /keypair.c | |
parent | 22aeecb491b346fe944f38e083cd26d4d235c632 (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.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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)); |