summaryrefslogtreecommitdiff
path: root/libgcrypt-1.4.6/random/random-fips.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgcrypt-1.4.6/random/random-fips.c')
-rw-r--r--libgcrypt-1.4.6/random/random-fips.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/libgcrypt-1.4.6/random/random-fips.c b/libgcrypt-1.4.6/random/random-fips.c
index a960a3e..2667e71 100644
--- a/libgcrypt-1.4.6/random/random-fips.c
+++ b/libgcrypt-1.4.6/random/random-fips.c
@@ -67,7 +67,6 @@
#include "random.h"
#include "rand-internal.h"
#include "ath.h"
-#include <process.h>
/* This is the lock we use to serialize access to this RNG. The extra
integer variable is only used to check the locking state; that is,
@@ -669,14 +668,14 @@ x931_reseed (rng_context_t rng_ctx)
standard random generator. */
get_random (rng_ctx->seed_V, 16, std_rng_context);
rng_ctx->is_seeded = 1;
- rng_ctx->seed_init_pid = _getpid();
+ rng_ctx->seed_init_pid = getpid ();
}
else
{
/* The other two generators are seeded from /dev/random. */
x931_generate_seed (rng_ctx->seed_V, 16);
rng_ctx->is_seeded = 1;
- rng_ctx->seed_init_pid = _getpid();
+ rng_ctx->seed_init_pid = getpid ();
}
}
@@ -702,15 +701,15 @@ get_random (void *buffer, size_t length, rng_context_t rng_ctx)
rng_ctx->cipher_hd = x931_generate_key (0);
if (!rng_ctx->cipher_hd)
goto bailout;
- rng_ctx->key_init_pid = _getpid();
+ rng_ctx->key_init_pid = getpid ();
}
/* Initialize the seed value if needed. */
if (!rng_ctx->is_seeded)
x931_reseed (rng_ctx);
- if (rng_ctx->key_init_pid != _getpid()
- || rng_ctx->seed_init_pid != _getpid())
+ if (rng_ctx->key_init_pid != getpid ()
+ || rng_ctx->seed_init_pid != getpid ())
{
/* We are in a child of us. Because we have no way yet to do
proper re-initialization (including self-checks etc), the
@@ -927,12 +926,12 @@ selftest_kat (selftest_report_func_t report)
errtxt = "error setting key for RNG";
goto leave;
}
- test_ctx->key_init_pid = _getpid();
+ test_ctx->key_init_pid = getpid ();
/* Setup the seed. */
memcpy (test_ctx->seed_V, tv[tvidx].v, 16);
test_ctx->is_seeded = 1;
- test_ctx->seed_init_pid = _getpid();
+ test_ctx->seed_init_pid = getpid ();
/* Setup a DT value. */
test_ctx->test_dt_ptr = tv[tvidx].dt;
@@ -963,8 +962,8 @@ selftest_kat (selftest_report_func_t report)
/* This test is actual pretty pointless because we use a local test
context. */
- if (test_ctx->key_init_pid != _getpid()
- || test_ctx->seed_init_pid != _getpid())
+ if (test_ctx->key_init_pid != getpid ()
+ || test_ctx->seed_init_pid != getpid ())
{
errtxt = "fork detection failed";
goto leave;
@@ -1050,12 +1049,12 @@ _gcry_rngfips_init_external_test (void **r_context, unsigned int flags,
if (err)
goto leave;
- test_ctx->key_init_pid = _getpid();
+ test_ctx->key_init_pid = getpid ();
/* Setup the seed. */
memcpy (test_ctx->seed_V, seed, seedlen);
test_ctx->is_seeded = 1;
- test_ctx->seed_init_pid = _getpid();
+ test_ctx->seed_init_pid = getpid ();
/* Setup a DT value. Because our context structure only stores a
pointer we copy the DT value to the extra space we allocated in