1.\" $OpenBSD: OPENSSL_init_crypto.3,v 1.4 2019/06/14 13:41:31 schwarze Exp $ 2.\" Copyright (c) 2018 Ingo Schwarze <schwarze@openbsd.org> 3.\" 4.\" Permission to use, copy, modify, and distribute this software for any 5.\" purpose with or without fee is hereby granted, provided that the above 6.\" copyright notice and this permission notice appear in all copies. 7.\" 8.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15.\" 16.Dd $Mdocdate: June 14 2019 $ 17.Dt OPENSSL_INIT_CRYPTO 3 18.Os 19.Sh NAME 20.Nm OPENSSL_init_crypto 21.Nd initialise the crypto library 22.Sh SYNOPSIS 23.In openssl/crypto.h 24.Ft int 25.Fo OPENSSL_init_crypto 26.Fa "uint64_t options" 27.Fa "const void *dummy" 28.Fc 29.Sh DESCRIPTION 30This function is deprecated. 31It is never useful for any application program to call it explicitly. 32The library automatically calls it internally with an 33.Fa options 34argument of 0 whenever needed. 35It is safest to assume that any function may do so. 36.Pp 37To enable or disable the standard configuration file, instead use 38.Xr OPENSSL_config 3 39or 40.Xr OPENSSL_no_config 3 , 41respectively. 42To load a non-standard configuration file, refer to 43.Xr CONF_modules_load_file 3 . 44.Pp 45If 46.Fn OPENSSL_init_crypto 47is called before any other crypto or ssl functions, the crypto 48library is initialised by allocating various internal resources, 49in particular calling 50.Xr ERR_load_crypto_strings 3 , 51.Xr OpenSSL_add_all_ciphers 3 , 52and 53.Xr OpenSSL_add_all_digests 3 . 54.Pp 55The following 56.Fa options 57are supported: 58.Bl -tag -width Ds 59.It Dv OPENSSL_INIT_LOAD_CONFIG 60At the end of the initialization, call 61.Xr OPENSSL_config 3 62with a 63.Dv NULL 64argument, loading the default configuration file. 65.It Dv OPENSSL_INIT_NO_LOAD_CONFIG 66Ignore any later calls to 67.Xr OPENSSL_config 3 . 68.El 69.Pp 70The other 71.Fa options 72flags defined by OpenSSL are all ignored by LibreSSL. 73The 74.Fa dummy 75argument has no effect. 76.Pp 77If this function is called more than once, none of the calls except 78the first one have any effect. 79.Sh RETURN VALUES 80.Fn OPENSSL_init_crypto 81is intended to return 1 on success or 0 on error. 82.Sh SEE ALSO 83.Xr CONF_modules_load_file 3 , 84.Xr OPENSSL_config 3 , 85.Xr OPENSSL_load_builtin_modules 3 , 86.Xr openssl.cnf 5 87.Sh HISTORY 88.Fn OPENSSL_init_crypto 89first appeared in OpenSSL 1.1.0 and has been available since 90.Ox 6.3 . 91.Sh BUGS 92.Fn OPENSSL_init_crypto 93silently ignores almost all kinds of errors. 94In particular, if memory allocation fails, initialisation is likely 95to remain incomplete, the library may be in an inconsistent internal 96state, but the return value will usually indicate success anyway. 97There is no way for the application program to find out whether 98library initialisation is actually complete, nor to get back to a 99consistent state if it isn't. 100