diff --git a/crypto/rand/rand.c b/crypto/rand/rand.c index 0d146a89..39695203 100644 --- a/crypto/rand/rand.c +++ b/crypto/rand/rand.c @@ -171,8 +171,14 @@ int RAND_status(void) { return 1; } -static const struct rand_meth_st kSSLeayMethod = {NULL, NULL, NULL, - NULL, NULL, NULL}; +static const struct rand_meth_st kSSLeayMethod = { + RAND_seed, + RAND_bytes, + RAND_cleanup, + RAND_add, + RAND_pseudo_bytes, + RAND_status, +}; RAND_METHOD *RAND_SSLeay(void) { return (RAND_METHOD*) &kSSLeayMethod; diff --git a/include/openssl/rand.h b/include/openssl/rand.h index 2918c7e8..335c76ed 100644 --- a/include/openssl/rand.h +++ b/include/openssl/rand.h @@ -76,10 +76,10 @@ OPENSSL_EXPORT int RAND_status(void); * external so that variables of this type can be initialized. */ struct rand_meth_st { void (*seed) (const void *buf, int num); - int (*bytes) (unsigned char *buf, int num); + int (*bytes) (uint8_t *buf, size_t num); void (*cleanup) (void); void (*add) (const void *buf, int num, double entropy); - int (*pseudorand) (unsigned char *buf, int num); + int (*pseudorand) (uint8_t *buf, size_t num); int (*status) (void); };