summaryrefslogtreecommitdiffstats
path: root/crypto/rand/rand_lib.c
diff options
context:
space:
mode:
authorGeoff Thorpe <geoff@openssl.org>2001-04-30 15:24:41 +0000
committerGeoff Thorpe <geoff@openssl.org>2001-04-30 15:24:41 +0000
commit7ae551fd03b447e41d3a74e803a711350383ebc4 (patch)
treef0052965089d923ade8bb8bd45fe8afd28d5b466 /crypto/rand/rand_lib.c
parentc2e45f6ddf9219735e85d9b658a94e42c37ec0a2 (diff)
In RSA, DSA, DH, and RAND - if the "***_new()" function fails because the
ENGINE code does not return a default, set an error.
Diffstat (limited to 'crypto/rand/rand_lib.c')
-rw-r--r--crypto/rand/rand_lib.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/crypto/rand/rand_lib.c b/crypto/rand/rand_lib.c
index 597c098d3e..38cea79938 100644
--- a/crypto/rand/rand_lib.c
+++ b/crypto/rand/rand_lib.c
@@ -58,6 +58,7 @@
#include <stdio.h>
#include <time.h>
+#include "cryptlib.h"
#include <openssl/rand.h>
#include <openssl/engine.h>
@@ -86,7 +87,10 @@ const RAND_METHOD *RAND_get_rand_method(void)
{
if (rand_engine == NULL
&& (rand_engine = ENGINE_get_default_RAND()) == NULL)
+ {
+ RANDerr(RAND_F_RAND_GET_RAND_METHOD,ERR_LIB_ENGINE);
return NULL;
+ }
return ENGINE_get_RAND(rand_engine);
}