]> git.meshlink.io Git - meshlink/blobdiff - src/openssl/crypto.c
Remove everything GPL that is not copyright Guus Sliepen, update copyright statements.
[meshlink] / src / openssl / crypto.c
index ece7f059eb9c1a4ea6fdf5ad82f34d56a62eeb82..8fc63e3c8f7d141bbfe2e57f7ac4124383edafbc 100644 (file)
@@ -1,6 +1,6 @@
 /*
     crypto.c -- Cryptographic miscellaneous functions and initialisation
-    Copyright (C) 2007-2013 Guus Sliepen <guus@tinc-vpn.org>
+    Copyright (C) 2014 Guus Sliepen <guus@meshlink.io>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -31,7 +31,13 @@ void crypto_init(void) {
        ENGINE_load_builtin_engines();
        ENGINE_register_all_complete();
 
+       ERR_load_crypto_strings();
        OpenSSL_add_all_algorithms();
+
+       if(!RAND_status()) {
+               fprintf(stderr, "Not enough entropy for the PRNG!\n");
+               abort();
+       }
 }
 
 void crypto_exit(void) {