---
name: "libressl-RAND_set_rand_method"
section: "3"
platform: "linux"
package: "libressl"
version: "4.4.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/libressl-RAND_set_rand_method"
---

# libressl-RAND\_set\_rand\_method(3)

select RAND method

## NAME

**RAND\_set\_rand\_method**, **RAND\_get\_rand\_method**, **RAND\_SSLeay** – select RAND method

## SYNOPSIS

Crypto Library (libcrypto, -lcrypto)

**#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

These functions used to allow for the random number generator functions to be replaced by arbitrary code.

They are kept for ABI compatibility but are no longer functional, and should not be used in new programs.

## RETURN VALUES

**RAND\_set\_rand\_method**() always returns 1. **RAND\_get\_rand\_method**() and **RAND\_SSLeay**() always return 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.
