1 CRYPT_GENHASH_IMPL(3C) Standard C Library Functions CRYPT_GENHASH_IMPL(3C) 2 3 4 5 NAME 6 crypt_genhash_impl - generate encrypted password 7 8 SYNOPSIS 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 15 DESCRIPTION 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 31 information from the crypt.conf entry, such as specifying rounds 32 information "rounds=4096". 33 34 35 The crypt_genhash_impl() function must not free(3C) ctbufflen on error. 36 37 RETURN VALUES 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 42 ERRORS 43 The crypt_genhash_impl() function will fail if: 44 45 EINVAL 46 The configuration file crypt.conf contains an invalid entry. 47 48 49 ELIBACC 50 The required shared library was not found. 51 52 53 ENOMEM 54 There is insufficient memory to perform hashing. 55 56 57 ATTRIBUTES 58 See attributes(5) for descriptions of the following attributes: 59 60 61 62 63 +--------------------+-----------------+ 64 | ATTRIBUTE TYPE | ATTRIBUTE VALUE | 65 +--------------------+-----------------+ 66 |Interface Stability | Evolving | 67 +--------------------+-----------------+ 68 |MT-Level | MT-Safe | 69 +--------------------+-----------------+ 70 71 SEE ALSO 72 passwd(1), crypt(3C), crypt_gensalt_impl(3C), free(3C), 73 getpassphrase(3C), crypt.conf(4), passwd(4), attributes(5) 74 75 76 77 June 10, 2002 CRYPT_GENHASH_IMPL(3C)