Changeset View
Changeset View
Standalone View
Standalone View
lib/libcrypt/crypt.3
Show First 20 Lines • Show All 215 Lines • ▼ Show 20 Lines | |||||
Unless a global default has been specified or | Unless a global default has been specified or | ||||
.Fn crypt_set_format | .Fn crypt_set_format | ||||
has set the format to something else, the built-in default format is | has set the format to something else, the built-in default format is | ||||
used. | used. | ||||
This is currently | This is currently | ||||
.\" | .\" | ||||
.\" NOTICE: Also make sure to update this | .\" NOTICE: Also make sure to update this | ||||
.\" | .\" | ||||
DES | DES if it is available, or SHA-512 if not. | ||||
delphij: This is "traditional" crypt and caller might be expecting DES (see bug 192277). | |||||
Not Done Inline ActionsFair point do we need to default to MD5, because that isn't what the code was doing? ali_mashtizadeh.com: Fair point do we need to default to MD5, because that isn't what the code was doing? | |||||
Done Inline ActionsI think it's fine to change the fallback (when DES is not available) default to anything. We only need the default be DES for legacy applications. POSIX says "The algorithm is implementation-defined." ( https://pubs.opengroup.org/onlinepubs/9699919799/functions/crypt.html ). delphij: I think it's fine to change the fallback (when DES is not available) default to anything.
We… | |||||
if it is available, or MD5 if not. | |||||
.Pp | .Pp | ||||
How the salt is used will depend upon the algorithm for the hash. | How the salt is used will depend upon the algorithm for the hash. | ||||
For | For | ||||
best results, specify at least eight characters of salt. | best results, specify at least eight characters of salt. | ||||
.Pp | .Pp | ||||
The | The | ||||
.Fn crypt_get_format | .Fn crypt_get_format | ||||
function returns a constant string that represents the name of the | function returns a constant string that represents the name of the | ||||
Show All 24 Lines | |||||
making it thread-safe. | making it thread-safe. | ||||
.Sh RETURN VALUES | .Sh RETURN VALUES | ||||
The | The | ||||
.Fn crypt | .Fn crypt | ||||
and | and | ||||
.Fn crypt_r | .Fn crypt_r | ||||
functions return a pointer to the encrypted value on success, and NULL on | functions return a pointer to the encrypted value on success, and NULL on | ||||
failure. | failure. | ||||
Note: this is not a standard behaviour, AT&T | Note: this is not a standard behaviour, AT&T | ||||
ali_mashtizadeh.comAuthorUnsubmitted Done Inline ActionsThis section of the man page should also reflect that this is compatible with posix semantics? ali_mashtizadeh.com: This section of the man page should also reflect that this is compatible with posix semantics? | |||||
delphijUnsubmitted Not Done Inline ActionsGood question (note that we do not set errno as POSIX suggested, and the crypt_* should probably be modified to support these). By the way I think the current lib/libcrypt/crypt.3 can land independently because it matches the current behavior. delphij: Good question (note that we do not set errno as POSIX suggested, and the crypt_* should… | |||||
.Fn crypt | .Fn crypt | ||||
will always return a pointer to a string. | will always return a pointer to a string. | ||||
.Pp | .Pp | ||||
The | The | ||||
.Fn crypt_set_format | .Fn crypt_set_format | ||||
function will return 1 if the supplied encoding format was valid. | function will return 1 if the supplied encoding format was valid. | ||||
Otherwise, a value of 0 is returned. | Otherwise, a value of 0 is returned. | ||||
.Sh SEE ALSO | .Sh SEE ALSO | ||||
▲ Show 20 Lines • Show All 53 Lines • Show Last 20 Lines |
This is "traditional" crypt and caller might be expecting DES (see bug 192277).