[libratbox] Remove an unused random function
Nothing in the Charybdis or libratbox code calls rb_get_pseudo_random and under OpenSSL it uses RAND_pseudo_bytes() which is both dangerous and removed in OpenSSL version 1.1.0.
This commit is contained in:
parent
25f7ee7dd6
commit
0b05d1aad5
5 changed files with 0 additions and 30 deletions
|
@ -166,7 +166,6 @@ typedef enum
|
|||
|
||||
int rb_init_prng(const char *path, prng_seed_t seed_type);
|
||||
int rb_get_random(void *buf, size_t len);
|
||||
int rb_get_pseudo_random(void *buf, size_t len);
|
||||
void rb_ssl_start_accepted(rb_fde_t *new_F, ACCB * cb, void *data, int timeout);
|
||||
void rb_ssl_start_connected(rb_fde_t *F, CNCB * callback, void *data, int timeout);
|
||||
int rb_supports_ssl(void);
|
||||
|
|
|
@ -146,7 +146,6 @@ rb_spawn_process
|
|||
rb_supports_ssl
|
||||
rb_ssl_handshake_count
|
||||
rb_ssl_clear_handshake_count
|
||||
rb_get_pseudo_random
|
||||
rb_strerror
|
||||
rb_kill
|
||||
rb_setenv
|
||||
|
|
|
@ -552,17 +552,6 @@ rb_get_random(void *buf, size_t length)
|
|||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
rb_get_pseudo_random(void *buf, size_t length)
|
||||
{
|
||||
#if GNUTLS_VERSION_MAJOR < 3
|
||||
gcry_randomize(buf, length, GCRY_WEAK_RANDOM);
|
||||
#else
|
||||
gnutls_rnd(GNUTLS_RND_RANDOM, buf, length);
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
const char *
|
||||
rb_get_ssl_strerror(rb_fde_t *F)
|
||||
{
|
||||
|
|
|
@ -86,13 +86,6 @@ rb_get_random(void *buf, size_t length)
|
|||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
rb_get_pseudo_random(void *buf, size_t length)
|
||||
{
|
||||
return rb_get_random(buf, length);
|
||||
}
|
||||
|
||||
|
||||
const char *
|
||||
rb_get_ssl_strerror(rb_fde_t *F)
|
||||
{
|
||||
|
|
|
@ -674,16 +674,6 @@ rb_get_random(void *buf, size_t length)
|
|||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
rb_get_pseudo_random(void *buf, size_t length)
|
||||
{
|
||||
int ret;
|
||||
ret = RAND_pseudo_bytes(buf, length);
|
||||
if(ret < 0)
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
const char *
|
||||
rb_get_ssl_strerror(rb_fde_t *F)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue