1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 23:48:12 +00:00

Merge pull request #15 from dllaurence/finalize_rand

Finalize all open file descriptors
This commit is contained in:
Pavol Rusnak 2015-01-23 19:11:19 +01:00
commit d57d030362
2 changed files with 9 additions and 0 deletions

8
rand.c
View File

@ -33,6 +33,14 @@ void init_rand(void)
f = fopen("/dev/urandom", "r");
}
int finalize_rand(void)
{
int err = fclose(f);
f = NULL;
return err;
}
uint32_t random32(void)
{
uint32_t r;

1
rand.h
View File

@ -27,6 +27,7 @@
#include <stdint.h>
void init_rand(void);
int finalize_rand(void);
uint32_t random32(void);
void random_buffer(uint8_t *buf, size_t len);