1crypt_genhash_impl(3C) Standard C Library Functions crypt_genhash_impl(3C)
2
3
4
6 crypt_genhash_impl - generate encrypted password
7
9 #include <crypt.h>
10
11 char *crypt_genhash_impl(char *ctbuffer, size_t ctbufflen,
12 const char *plaintext, const char *salt, const char **params);
13
14
16 The crypt_genhash_impl() function is called by crypt(3C) to generate
17 the encrypted password plaintext.
18
19
20 The ctbuffer argument is a pointer to an MT-safe buffer of ctbufflen
21 size that is used to return the result.
22
23
24 The salt argument is the salt used in encoding.
25
26
27 The params argument is an argv-like null-terminated vector of type char
28 *. The first element of params represents the mechanism token name from
29 crypt.conf(4). The remaining elements of params represent strings of
30 the form <parameter>[=<value>] to allow passing in additional informa‐
31 tion from the crypt.conf entry, such as specifing rounds information
32 "rounds=4096".
33
34
35 The crypt_genhash_impl() function must not free(3C) ctbufflen on error.
36
38 Upon successful completion, crypt_genhash_impl() returns a pointer to
39 the encoded version of plaintext. Otherwise a null pointer is returned
40 and errno is set to indicate the error.
41
43 The crypt_genhash_impl() function will fail if:
44
45 EINVAL The configuration file crypt.conf contains an invalid entry.
46
47
48 ELIBACC The required shared library was not found.
49
50
51 ENOMEM There is insufficient memory to perform hashing.
52
53
55 See attributes(5) for descriptions of the following attributes:
56
57
58
59
60 ┌─────────────────────────────┬─────────────────────────────┐
61 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
62 ├─────────────────────────────┼─────────────────────────────┤
63 │Interface Stability │Evolving │
64 ├─────────────────────────────┼─────────────────────────────┤
65 │MT-Level │MT-Safe │
66 └─────────────────────────────┴─────────────────────────────┘
67
69 passwd(1), crypt(3C), crypt_gensalt_impl(3C), free(3C), get‐
70 passphrase(3C), crypt.conf(4), passwd(4), attributes(5)
71
72
73
74SunOS 5.11 10 Jun 2002 crypt_genhash_impl(3C)