RAND_CLEANUP(3ossl)

πŸ’– RAND_CLEANUP(3ossl) πŸ’–

okay bestie, so this is a page from the OpenSSL manual, and honestly? It's giving "ghost of functions past" πŸ’€ because this lil guy has been retired for actual years. Let me put you on. 🫢


✨ NAME ✨

RAND_cleanup β€” erase the PRNG state 🌸


πŸŽ€ SYNOPSIS πŸŽ€

First thing's first, you gotta pull in the header:

#include <openssl/rand.h>

Now the tea: this next function has been deprecated since OpenSSL 1.1.0 😭 and you can hide it entirely by defining OPENSSL_API_COMPAT with a version value that makes sense for you β€” go read openssl_user_macros(7) for the deets, iykyk.

void RAND_cleanup(void);

πŸ¦‹ DESCRIPTION πŸ¦‹

So back in the day β€” like, prior to OpenSSL 1.1.0 β€” RAND_cleanup() was the girl who released all the resources used by the PRNG. Doing the most. Cleaning up after everybody. πŸ’…

But as of version 1.1.0, she does nothing. Literally nothing. And she should not be called, because there's no explicit initialisation or de-initialisation necessary anymore. The vibes are handled internally now. Go see OPENSSL_init_crypto(3) for how that actually works. ✨

not me calling a function that's been a no-op since 1.1.0 πŸ™ˆ please don't be that person.

🌈 RETURN VALUES 🌈

RAND_cleanup() returns no value. That's it. That's the whole section. Empty-handed queen. πŸ‘‘


πŸ”₯ SEE ALSO πŸ”₯


⭐ HISTORY ⭐

RAND_cleanup() was deprecated in OpenSSL 1.1.0 β€” do not use it, fr fr. Go look at OPENSSL_init_crypto(3) instead. πŸ’œ


Copyright 2000-2020 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.


and that's the whole page, bestie β€” this was OpenSSL version 3.5.9, dated 2026-09-29, and yes the function is still deprecated, still a no-op, still not yours to call. stay random out there πŸ§šπŸ’–βœ¨

πŸ“¦ where this page comes from