X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fopenssl%2Fcrypto.c;fp=src%2Fopenssl%2Fcrypto.c;h=0000000000000000000000000000000000000000;hb=22f930e7c6352a1b43b1605799925e10fced254a;hp=8fc63e3c8f7d141bbfe2e57f7ac4124383edafbc;hpb=82bbb6f1947bfb98a52422d7202aef331d36b1d7;p=meshlink diff --git a/src/openssl/crypto.c b/src/openssl/crypto.c deleted file mode 100644 index 8fc63e3c..00000000 --- a/src/openssl/crypto.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - crypto.c -- Cryptographic miscellaneous functions and initialisation - Copyright (C) 2014 Guus Sliepen - - 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 - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ - -#include "../system.h" - -#include -#include -#include - -#include "../crypto.h" - -void crypto_init(void) { - RAND_load_file("/dev/urandom", 1024); - - 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) { - EVP_cleanup(); -} - -void randomize(void *out, size_t outlen) { - RAND_pseudo_bytes(out, outlen); -}