Title: [PATCH] Crash generating DSS requests, uninitialized RNG

Baseline: 0.9.5a

DSA signing requires that random number initialization be done. 
Unfortunately, req.c _conditionally_ does the signing under inappropriate
circumstances.

*** apps/req.c.saf Thu Apr 20 14:20:49 2000
--- apps/req.c  Thu Apr 20 14:33:08 2000
***************
*** 540,549 ****
     }
    }
 
   if (newreq && (pkey == NULL))
    {
    char *randfile = CONF_get_string(req_conf,SECTION,"RANDFILE");
-   app_RAND_load_file(randfile, bio_err, 0);
  
    if (newkey <= 0)
     {
--- 540,556 ----
     }
    }
 
+ {
+   char *randfile = CONF_get_string(req_conf,SECTION,"RANDFILE");
+   app_RAND_load_file(randfile, bio_err, 0);
+   if (randfile != NULL)
+     BIO_printf(bio_err,"%ld semi-random bytes loaded\n",
+    app_RAND_load_files(randfile));
+ }
+
   if (newreq && (pkey == NULL))
    {
    char *randfile = CONF_get_string(req_conf,SECTION,"RANDFILE");
  
    if (newkey <= 0)
     {

Reply via email to