Fix CPRNG test for Hash DRBG.
[openssl.git] / fips / fips_test_suite.c
index 5aee06ca34a7f7ae575b4862786c91c8f0d29c1d..5290cb258747306203c1f45b8757191f49a2b0ef 100644 (file)
@@ -811,6 +811,9 @@ static int post_cb(int op, int id, int subid, void *ex)
                {
                case FIPS_POST_BEGIN:
 #ifdef FIPS_POST_TIME
+               clock_getres(CLOCK_REALTIME, &tstart);
+               printf("\tTimer resolution %ld s, %ld ns\n",
+                               (long)tstart.tv_sec, (long)tstart.tv_nsec);
                clock_gettime(CLOCK_REALTIME, &tstart);
 #endif
                printf("\tPOST started\n");
@@ -840,7 +843,6 @@ static int post_cb(int op, int id, int subid, void *ex)
                printf("\t\t\tTook %f seconds\n",
                        (double)((end.tv_sec+end.tv_nsec*1e-9)
                         - (start.tv_sec+start.tv_nsec*1e-9)));
-               start = end;
 #endif
                break;
 
@@ -943,7 +945,7 @@ int main(int argc,char **argv)
         }
        if (!no_exit) {
                fips_algtest_init_nofips();
-               if (!FIPS_mode_set(1)) {
+               if (!FIPS_module_mode_set(1)) {
                    printf("Power-up self test failed\n");
                    exit(1);
                }
@@ -962,8 +964,8 @@ int main(int argc,char **argv)
     /* Power-up self test
     */
     ERR_clear_error();
-    test_msg("2. Automatic power-up self test", FIPS_mode_set(1));
-    if (!FIPS_mode())
+    test_msg("2. Automatic power-up self test", FIPS_module_mode_set(1));
+    if (!FIPS_module_mode())
        exit(1);
     if (do_drbg_stick)
             FIPS_drbg_stick();