1.\" $OpenBSD: OPENSSL_init_crypto.3,v 1.5 2020/05/24 12:21:31 schwarze Exp $ 2.\" Copyright (c) 2018, 2020 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: May 24 2020 $ 17.Dt OPENSSL_INIT_CRYPTO 3 18.Os 19.Sh NAME 20.Nm OPENSSL_init_crypto , 21.Nm OPENSSL_init 22.Nd initialise the crypto library 23.Sh SYNOPSIS 24.In openssl/crypto.h 25.Ft int 26.Fo OPENSSL_init_crypto 27.Fa "uint64_t options" 28.Fa "const void *dummy" 29.Fc 30.Ft void 31.Fn OPENSSL_init void 32.Sh DESCRIPTION 33These functions are deprecated. 34It is never useful for an application program 35to call either of them explicitly. 36.Pp 37The library automatically calls 38.Fn OPENSSL_init_crypto 39internally with an 40.Fa options 41argument of 0 whenever needed. 42It is safest to assume that any function may do so. 43.Pp 44To enable or disable the standard configuration file, instead use 45.Xr OPENSSL_config 3 46or 47.Xr OPENSSL_no_config 3 , 48respectively. 49To load a non-standard configuration file, refer to 50.Xr CONF_modules_load_file 3 . 51.Pp 52If 53.Fn OPENSSL_init_crypto 54is called before any other crypto or ssl functions, the crypto 55library is initialised by allocating various internal resources, 56in particular calling 57.Xr ERR_load_crypto_strings 3 , 58.Xr OpenSSL_add_all_ciphers 3 , 59and 60.Xr OpenSSL_add_all_digests 3 . 61.Pp 62The following 63.Fa options 64are supported: 65.Bl -tag -width Ds 66.It Dv OPENSSL_INIT_LOAD_CONFIG 67At the end of the initialization, call 68.Xr OPENSSL_config 3 69with a 70.Dv NULL 71argument, loading the default configuration file. 72.It Dv OPENSSL_INIT_NO_LOAD_CONFIG 73Ignore any later calls to 74.Xr OPENSSL_config 3 . 75.El 76.Pp 77The other 78.Fa options 79flags defined by OpenSSL are all ignored by LibreSSL. 80The 81.Fa dummy 82argument has no effect. 83.Pp 84If this function is called more than once, none of the calls except 85the first one have any effect. 86.Pp 87.Fn OPENSSL_init 88has no effect at all. 89.Sh RETURN VALUES 90.Fn OPENSSL_init_crypto 91is intended to return 1 on success or 0 on error. 92.Sh SEE ALSO 93.Xr CONF_modules_load_file 3 , 94.Xr OPENSSL_config 3 , 95.Xr OPENSSL_load_builtin_modules 3 , 96.Xr openssl.cnf 5 97.Sh HISTORY 98.Fn OPENSSL_init 99first appeared in OpenSSL 1.0.0e and has been available since 100.Ox 5.3 . 101It stopped having any effect in OpenSSL 1.1.1 and in 102.Ox 5.6 . 103.Pp 104.Fn OPENSSL_init_crypto 105first appeared in OpenSSL 1.1.0 and has been available since 106.Ox 6.3 . 107.Sh BUGS 108.Fn OPENSSL_init_crypto 109silently ignores almost all kinds of errors. 110In particular, if memory allocation fails, initialisation is likely 111to remain incomplete, the library may be in an inconsistent internal 112state, but the return value will usually indicate success anyway. 113There is no way for the application program to find out whether 114library initialisation is actually complete, nor to get back to a 115consistent state if it isn't. 116