1.\" $OpenBSD: OPENSSL_init_crypto.3,v 1.3 2018/03/23 23:18:17 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: March 23 2018 $ 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 30If 31.Fn OPENSSL_init_crypto 32is called before any other crypto or ssl functions, the crypto 33library is initialised by allocating various internal resources. 34.Pp 35The following 36.Fa options 37are supported: 38.Bl -tag -width Ds 39.It Dv OPENSSL_INIT_LOAD_CONFIG 40At the end of the initialization, call 41.Xr OPENSSL_config 3 42with a 43.Dv NULL 44argument, loading the default configuration file. 45.It Dv OPENSSL_INIT_NO_LOAD_CONFIG 46Ignore any later calls to 47.Xr OPENSSL_config 3 . 48.El 49.Pp 50The other 51.Fa options 52flags defined by OpenSSL are all ignored by LibreSSL. 53The 54.Fa dummy 55argument has no effect. 56.Pp 57Calling this function is almost never useful because it is internally 58called with an 59.Fa options 60argument of 0 by those functions in the crypto and ssl libraries 61that require it. 62It is safest to assume that any function may do so. 63.Pp 64If this function is called more than once, none of the calls except 65the first one have any effect. 66.Sh RETURN VALUES 67.Fn OPENSSL_init_crypto 68is intended to return 1 on success or 0 on error. 69.Sh SEE ALSO 70.Xr CONF_modules_load_file 3 , 71.Xr OPENSSL_config 3 , 72.Xr OPENSSL_init_ssl 3 , 73.Xr OPENSSL_load_builtin_modules 3 , 74.Xr openssl.cnf 5 75.Sh HISTORY 76.Fn OPENSSL_init_crypto 77first appeared in OpenSSL 1.1.0 and has been available since 78.Ox 6.3 . 79.Sh BUGS 80.Fn OPENSSL_init_crypto 81silently ignores almost all kinds of errors. 82In particular, if memory allocation fails, initialisation is likely 83to remain incomplete, the library may be in an inconsistent internal 84state, but the return value will usually indicate success anyway. 85There is no way for the application program to find out whether 86library initialisation is actually complete, nor to get back to a 87consistent state if it isn't. 88