8498 ficl: variable 'count' might be clobbered by 'longjmp' or 'vfork'
[unleashed.git] / share / man / man3c / crypt_gensalt_impl.3c
blobc40338aa8757eff3b6f4f2ebd36c350f352bf4b5
1 '\" te
2 .\" Copyright (c) 2002, Sun Microsystems, Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH CRYPT_GENSALT_IMPL 3C "Jun 10, 2002"
7 .SH NAME
8 crypt_gensalt_impl \- generate salt for password encryption
9 .SH SYNOPSIS
10 .LP
11 .nf
12 #include <crypt.h>
14 \fBchar *\fR\fBcrypt_gensalt_impl\fR(\fBchar *\fR\fIgsbuffer\fR, \fBsize_t\fR \fIgsbufflen\fR,
15      \fBconst char *\fR\fIoldsalt\fR, \fBconst struct passwd *\fR\fIuserinfo\fR,
16      \fBconst char **\fR\fIparams\fR);
17 .fi
19 .SH DESCRIPTION
20 .sp
21 .LP
22 The \fBcrypt_gensalt_impl()\fR function is called by \fBcrypt_gensalt\fR(3C) to
23 generate the salt for password encryption.
24 .sp
25 .LP
26 The \fIgsbuffer\fR argument is a pointer to an MT-safe buffer of size
27 \fIgsbufflen\fR.
28 .sp
29 .LP
30 The \fIoldsalt\fR and \fIuserinfo\fR arguments are passed unchanged from
31 \fBcrypt_gensalt\fR(3C).
32 .sp
33 .LP
34 The \fIparams\fR argument is an \fIargv\fR-like null terminated vector of type
35 \fBchar *\fR. The first element of \fIparams\fR represents the mechanism token
36 name from \fBcrypt.conf\fR(4). The remaining elements of \fIparams\fR represent
37 strings of the form <\fBparameter\fR>[=<\fBvalue\fR>] to allow passing in
38 additional information from the \fBcrypt.conf\fR entry, such as specifying
39 rounds information "\fBrounds=4096\fR".
40 .sp
41 .LP
42 The value returned by \fBcrypt_gensalt_impl()\fR points to a thread-specific
43 buffer to be freed by the caller of \fBcrypt_gensalt\fR(3C) after calling
44 \fBcrypt\fR(3C).
45 .SH RETURN VALUES
46 .sp
47 .LP
48 Upon successful completion, \fBcrypt_gensalt_impl()\fR returns a pointer to the
49 new salt. Otherwise a null pointer is returned and \fBerrno\fR is set to
50 indicate the error.
51 .SH ERRORS
52 .sp
53 .LP
54 The \fBcrypt_gensalt_impl()\fR function will fail if:
55 .sp
56 .ne 2
57 .na
58 \fB\fBEINVAL\fR\fR
59 .ad
60 .RS 11n
61 The configuration file \fBcrypt.conf\fR contains an invalid entry.
62 .RE
64 .sp
65 .ne 2
66 .na
67 \fB\fBELIBACC\fR\fR
68 .ad
69 .RS 11n
70 The required crypt shared library was not found.
71 .RE
73 .sp
74 .ne 2
75 .na
76 \fB\fBENOMEM\fR\fR
77 .ad
78 .RS 11n
79 There is insufficient memory to perform hashing.
80 .RE
82 .SH ATTRIBUTES
83 .sp
84 .LP
85 See \fBattributes\fR(5) for descriptions of the following attributes:
86 .sp
88 .sp
89 .TS
90 box;
91 c | c
92 l | l .
93 ATTRIBUTE TYPE  ATTRIBUTE VALUE
95 Interface Stability     Evolving
97 MT-Level        MT-Safe
98 .TE
100 .SH SEE ALSO
103 \fBpasswd\fR(1), \fBcrypt\fR(3C), \fBcrypt_genhash_impl\fR(3C),
104 \fBcrypt_gensalt\fR(3C), \fBgetpassphrase\fR(3C), \fBcrypt.conf\fR(4),
105 \fBpasswd\fR(4), \fBattributes\fR(5)