X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=gcrypt.c;h=ff4dab37ea4f5323e7545f5a755c38c105fdc6c0;hp=705d0d87a86e0608e9856d9fa197cedb01b439dc;hb=0ad0518b47e4637ad3a4ce12adecffb3b557bc40;hpb=3e16770594ee8267db0523ec733d0af794f277ff diff --git a/gcrypt.c b/gcrypt.c index 705d0d87..ff4dab37 100644 --- a/gcrypt.c +++ b/gcrypt.c @@ -66,6 +66,16 @@ void crypt_init(void) req_ver, gcry_check_version(NULL)); exit(EXIT_FAILURE); } + + /* + * Allocate a pool of secure memory. This also drops privileges where + * needed. + */ + gcry_control(GCRYCTL_INIT_SECMEM, 65536, 0); + + /* Tell Libgcrypt that initialization has completed. */ + gcry_control(GCRYCTL_INITIALIZATION_FINISHED, 0); + get_random_bytes_or_die((unsigned char *)&seed, sizeof(seed)); srandom(seed); }