RAND_SET_RAND_METHOD(3)

πŸ“¦ version 4.1.0, in opensuse-leap 16.0

✨ NAME ✨

okay so bestie, welcome to the RAND_SET_RAND_METHOD(3) page from the Library Functions Manual πŸ’… the whole squad here is RAND_set_rand_method, RAND_get_rand_method, and RAND_SSLeay β€” and their whole thing is to select RAND method. that’s the vibe πŸŽ€

🌸 SYNOPSIS 🌸

#include <openssl/rand.h>

int
RAND_set_rand_method(const RAND_METHOD *meth);

const RAND_METHOD *
RAND_get_rand_method(void);

RAND_METHOD *
RAND_SSLeay(void);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so back in the day, these functions used to allow for the random number generator functions to be replaced by arbitrary code. like, plug in your own RNG? iconic concept, but that’s the lore ✨

now? they are kept for ABI compatibility but are no longer functional, and should not be used in new programs. not me warning you: do not build new stuff on these. they’re giving legacy placeholder energy fr fr πŸ˜­πŸ’€

⭐ RETURN VALUES ⭐

  • RAND_set_rand_method() β€” always returns 1. slay for predictability, I guess πŸ’–
  • RAND_get_rand_method() β€” always returns NULL.
  • RAND_SSLeay() β€” always returns NULL.

πŸ‘‘ HISTORY πŸ‘‘

RAND_set_rand_method(), RAND_get_rand_method(), and RAND_SSLeay() first appeared in SSLeay 0.9.1 and have been available since OpenBSD 2.6. vintage behavior, honestly πŸŽ€πŸŒ·


cute sign-off bestie: this page’s source/version is Debian, dated March 21, 2018, and the manual is RAND_SET_RAND_METHOD(3) 🫢✨

πŸ“¦ where this page comes from