RAND_load_file 3 2001-04-12 0.9.9-dev OpenSSL

NAME

RAND_load_file, RAND_write_file, RAND_file_name - PRNG seed file

LIBRARY

libcrypto, -lcrypto

SYNOPSIS


 #include 


 const char *RAND_file_name(char *buf, size_t num);


 int RAND_load_file(const char *filename, long max_bytes);


 int RAND_write_file(const char *filename);

DESCRIPTION

_R_A_N_D___f_i_l_e___n_a_m_e_(_) generates a default path for the random seed file. bbuuff points to a buffer of size nnuumm in which to store the filename. The seed file is $RANDFILE if that environment variable is set, $HOME/.rnd otherwise. If $HOME is not set either, or nnuumm is too small for the path name, an error occurs.

_R_A_N_D___l_o_a_d___f_i_l_e_(_) reads a number of bytes from file ffiilleennaammee and adds them to the PRNG. If mmaaxx__bbyytteess is non-negative, up to to mmaaxx__bbyytteess are read; starting with OpenSSL 0.9.5, if mmaaxx__bbyytteess is -1, the complete file is read.

_R_A_N_D___w_r_i_t_e___f_i_l_e_(_) writes a number of random bytes (currently 1024) to file ffiilleennaammee which can be used to initialize the PRNG by calling _R_A_N_D___l_o_a_d___f_i_l_e_(_) in a later session.

RETURN VALUES

_R_A_N_D___l_o_a_d___f_i_l_e_(_) returns the number of bytes read.

_R_A_N_D___w_r_i_t_e___f_i_l_e_(_) returns the number of bytes written, and -1 if the bytes written were generated without appropriate seed.

_R_A_N_D___f_i_l_e___n_a_m_e_(_) returns a pointer to bbuuff on success, and NULL on error.

SEE ALSO

_o_p_e_n_s_s_l___r_a_n_d(3), _R_A_N_D___a_d_d(3), _R_A_N_D___c_l_e_a_n_u_p(3)

HISTORY

_R_A_N_D___l_o_a_d___f_i_l_e_(_), _R_A_N_D___w_r_i_t_e___f_i_l_e_(_) and _R_A_N_D___f_i_l_e___n_a_m_e_(_) are available in all versions of SSLeay and OpenSSL.