RAND_SET_RAND_METHOD(3)

πŸ“¦ version 4.4.0, in alpine 3.24, arch rolling

πŸ’… RAND_SET_RAND_METHOD(3) β€” like, the Library Functions Manual bestie ✨

okay so real talk: this page is about RAND_set_rand_method, RAND_get_rand_method, and RAND_SSLeay, and their whole personality is "select RAND method." iconic name, zero function, we'll get there 🫢


🌸 NAME 🌸

RAND_set_rand_method, RAND_get_rand_method, RAND_SSLeay β€” select RAND method. bestie that is literally the whole vibe check ✨


πŸŽ€ SYNOPSIS πŸŽ€

pull these in from the libcrypto library, no cap:

#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 let you swap out the random number generator functions for, like, arbitrary code. wild. main character energy fr fr.

but now? they're kept for ABI compatibility only β€” they are no longer functional, and you should not use them in new programs. ngl that's giving "still invited to the party but doesn't do anything" πŸ’€

⚠️ seriously bestie, don't build anything new on these. they're keeping the lights on for old code and that's it πŸ™ˆ

⭐ RETURN VALUES ⭐

  • RAND_set_rand_method() β€” always returns 1. every single time. no drama πŸ’–
  • RAND_get_rand_method() β€” always returns NULL.
  • RAND_SSLeay() β€” also always returns NULL. consistency queen πŸ‘‘

🌈 HISTORY 🌈

RAND_set_rand_method(), RAND_get_rand_method(), and RAND_SSLeay() first appeared in SSLeay 0.9.1, and they've been available since OpenBSD 2.6. vintage πŸ§šπŸ’œ


kay so that's the whole page, short and sweet β€” this one's from Debian, dated June 8, 2025, and that's the tea πŸ“πŸ’…

πŸ“¦ where this page comes from