diff options
| author | Konstantin Shemyak <konstantin@shemyak.com> | 2017-09-04 21:53:52 +0300 |
|---|---|---|
| committer | Michael Kerrisk <mtk.manpages@gmail.com> | 2017-09-05 19:48:35 +0200 |
| commit | d32b36982dc108a345babbd7490131729cb0c60c (patch) | |
| tree | 80011c0ffe8f59a4a20146f0dd77f00136dee4ab /man3 | |
| parent | 893c609dcd041af8ac4262cdaaea1625a998702e (diff) | |
| download | man-pages-d32b36982dc108a345babbd7490131729cb0c60c.tar.gz | |
crypt.3: Clarify that ending of the salt string with '$' is optional
In crypt/sha512-crypt.c::__sha512_crypt_r() and the similar
sha256 function, the length of the actually used salt is
calculated as:
salt_len = MIN (strcspn (salt, "$"), SALT_LEN_MAX);
Thus the trailing '$' is optional in the salt string. One can
check that
crypt("key", "$5$salt")
yields the same result as
crypt("key", "$5$salt$").
Signed-off-by: Konstantin Shemyak <konstantin@shemyak.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Diffstat (limited to 'man3')
| -rw-r--r-- | man3/crypt.3 | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/man3/crypt.3 b/man3/crypt.3 index 1bd85093b4..375ef9384f 100644 --- a/man3/crypt.3 +++ b/man3/crypt.3 @@ -195,15 +195,15 @@ encryption algorithms. If .I salt is a character string starting with the characters "$\fIid\fP$" -followed by a string terminated by "$": +followed by a string optionally terminated by "$", +then the result has the form: .RS .PP $\fIid\fP$\fIsalt\fP$\fIencrypted\fP .PP .RE -then instead of using the DES machine, .I id -identifies the encryption method used and this then determines how the rest +identifies the encryption method used instead of DES and this then determines how the rest of the password string is interpreted. The following values of .I id |
