Fix missing headers
[platform/upstream/cryptsetup.git] / lib / random.c
index 5aa95e0..25c8a2c 100644 (file)
@@ -5,7 +5,8 @@
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
- * version 2 as published by the Free Software Foundation.
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -22,6 +23,7 @@
 #include <fcntl.h>
 #include <errno.h>
 #include <assert.h>
+#include <sys/select.h>
 
 #include "libcryptsetup.h"
 #include "internal.h"
@@ -178,13 +180,13 @@ int crypt_random_get(struct crypt_device *ctx, char *buf, size_t len, int qualit
                break;
        case CRYPT_RND_SALT:
                if (crypt_fips_mode())
-                       status = crypt_backend_fips_rng(buf, len, quality);
+                       status = crypt_backend_rng(buf, len, quality, 1);
                else
                        status = _get_urandom(ctx, buf, len);
                break;
        case CRYPT_RND_KEY:
                if (crypt_fips_mode()) {
-                       status = crypt_backend_fips_rng(buf, len, quality);
+                       status = crypt_backend_rng(buf, len, quality, 1);
                        break;
                }
                rng_type = ctx ? crypt_get_rng_type(ctx) :