[FIX] Windows and Mac OS X compatibility.

This commit is contained in:
ben
2019-05-28 17:08:37 +02:00
parent c814f3c1c2
commit e0f4163c7e
3 changed files with 15 additions and 19 deletions

View File

@@ -483,11 +483,7 @@ static int drng_chacha20_rng_selftest(struct chacha20_drng *drng)
static void drng_chacha20_dealloc(struct chacha20_drng *drng)
{
memset_secure(drng, 0, sizeof(*drng));
#ifdef _WIN32
_aligned_free(drng);
#else
free(drng);
#endif
}
/**
@@ -595,7 +591,7 @@ int drng_chacha20_reseed(struct chacha20_drng *drng, const uint8_t *inbuf,
DSO_PUBLIC
void drng_chacha20_destroy(struct chacha20_drng *drng)
{
drng_chacha20_dealloc(drng);
drng_chacha20_dealloc(drng);
}
DSO_PUBLIC