Debian Codegraph @

upstream/debian-unstable/man3/crypt_preferred_method.3

raw
1 .\" Written by Björn Esser <besser82 at fedoraproject.org> in 2018.
2 .\"
3 .\" To the extent possible under law, the authors have waived
4 .\" all copyright and related or neighboring rights to this work.
5 .\" See https://creativecommons.org/publicdomain/zero/1.0/ for further
6 .\" details.
7 .\"
8 .Dd November 16, 2018
9 .Dt CRYPT_PREFERRED_METHOD 3
10 .Os libxcrypt
11 .Sh NAME
12 .Nm crypt_preferred_method
13 .Nd get the prefix of the preferred hash method
14 .Sh LIBRARY
15 .Lb libcrypt
16 .Sh SYNOPSIS
17 .In crypt.h
18 .Ft const char*
19 .Fo crypt_preferred_method
20 .Fa void
21 .Fc
22 .Sh DESCRIPTION
23 .Nm
24 is a convenience function to get the prefix of the preferred hash
25 method. If a preferred method is available,
26 it is the same as the one also used by the
27 .Nm crypt_gensalt functions ,
28 if their given
29 .Ar prefix
30 parameter is NULL.
31 .Sh RETURN VALUES
32 The string returned equals the prefix of the preferred hash method.
33 If no preferred hash method is available it is NULL.
34 It
35 .Em is
36 safe to pass the string returned by
37 .Nm crypt_preferred_method
38 directly to
39 .Nm crypt_gensalt
40 without prior string-sanitizing nor NULL-pointer checks.
41 .Sh FEATURE TEST MACROS
42 .In crypt.h
43 will define the macro
44 .Dv CRYPT_PREFERRED_METHOD_AVAILABLE
45 if
46 .Nm
47 is available in the current version of libxcrypt.
48 .Sh PORTABILITY NOTES
49 The function
50 .Nm
51 is not part of any standard.
52 It was added to libxcrypt in version 4.4.0.
53 .Sh ATTRIBUTES
54 For an explanation of the terms used in this section,
55 see
56 .Xr attributes 7 .
57 .TS
58 allbox;
59 lb lb lb
60 lw(22n) l l.
61 Interface Attribute Value
62 T{
63 .Nm
64 T} Thread safety MT-Safe
65 .TE
66 .sp
67 .Sh SEE ALSO
68 .Xr crypt_gensalt 3