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"
8 crypt_gensalt_impl \- generate salt for password encryption
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);
22 The \fBcrypt_gensalt_impl()\fR function is called by \fBcrypt_gensalt\fR(3C) to
23 generate the salt for password encryption.
26 The \fIgsbuffer\fR argument is a pointer to an MT-safe buffer of size
30 The \fIoldsalt\fR and \fIuserinfo\fR arguments are passed unchanged from
31 \fBcrypt_gensalt\fR(3C).
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".
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
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
54 The \fBcrypt_gensalt_impl()\fR function will fail if:
61 The configuration file \fBcrypt.conf\fR contains an invalid entry.
70 The required crypt shared library was not found.
79 There is insufficient memory to perform hashing.
85 See \fBattributes\fR(5) for descriptions of the following attributes:
93 ATTRIBUTE TYPE ATTRIBUTE VALUE
95 Interface Stability Evolving
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)