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