Fix error handling in RAND_DRBG_uninstantiate
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Fri, 2 Nov 2018 10:46:38 +0000 (11:46 +0100)
committerBernd Edlinger <bernd.edlinger@hotmail.de>
Mon, 5 Nov 2018 21:35:11 +0000 (22:35 +0100)
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/7517)

crypto/rand/drbg_lib.c

index cd298a7..2cfa4f5 100644 (file)
@@ -437,6 +437,7 @@ int RAND_DRBG_uninstantiate(RAND_DRBG *drbg)
 {
     int index = -1, type, flags;
     if (drbg->meth == NULL) {
+        drbg->state = DRBG_ERROR;
         RANDerr(RAND_F_RAND_DRBG_UNINSTANTIATE,
                 RAND_R_NO_DRBG_IMPLEMENTATION_SELECTED);
         return 0;