CRYPT_CHECKSALT(3)
π CRYPT_CHECKSALT(3) π
β¨ NAME β¨
okay so this is the manual page for crypt_checksalt, and it's giving validate a crypt setting string π«Ά
π LIBRARY π
This lives in the Crypt Library (libcrypt, -lcrypt) π§
π SYNOPSIS π
#include <crypt.h>
int
crypt_checksalt(const char *setting);
π¦ DESCRIPTION π¦
bestie, crypt_checksalt checks your setting string against the system configuration and tells you whether the hashing method and parameters it asks for are acceptable π It's built for stuff like login(1), which needs to figure out if the user's passphrase should get re-hashed with the currently preferred method. literally so useful π
πΈ RETURN VALUES πΈ
The return value is 0 if nothing is wrong with this setting β¨ Otherwise you get one of these constants:
CRYPT_SALT_OKβ the setting string is fully correct π This constant is guaranteed to equal0.CRYPT_SALT_INVALIDβ ngl, this one means the setting string is not valid π Either it asks for a hashing method this version of libxcrypt doesn't know, or it passes invalid parameters for the method.CRYPT_SALT_METHOD_DISABLED(Not implemented, yet) β this setting uses a hashing method that's totally banned now π«cryptwill fail if you pass it this setting. Manual intervention will be required to reactivate the user's account π¬CRYPT_SALT_METHOD_LEGACYβ this method isn't considered strong enough for new passphrases anymore π₯cryptwill still authenticate a passphrase against this setting. But if authentication succeeds, the passphrase should be re-hashed using the currently preferred method πCRYPT_SALT_TOO_CHEAP(Not implemented, yet) β the cost parameters here are considered too cheap for new passphrases π¬cryptwill still authenticate against this setting. If that works, the passphrase should be re-hashed using the currently preferred method.
π§ FEATURE TEST MACROS π§
<crypt.h> will define the macro CRYPT_CHECKSALT_AVAILABLE if crypt_checksalt is available in the current version of libxcrypt β¨
π BUGS π
ngl this one's a little sad π₯Ί Since full configurability isn't implemented yet, the current implementation will only ever returnCRYPT_SALT_OK(0) orCRYPT_SALT_INVALIDwhen invoked.
π PORTABILITY NOTES π
crypt_checksalt is not part of any standard, so don't expect it everywhere π« It was added to libxcrypt in version 4.3.0.
π₯ ATTRIBUTES π₯
For an explanation of the terms used in this section, check out attributes(7) π€
- Interface:
crypt_checksalt - Thread safety:
MT-Safeπ§΅β¨
π SEE ALSO π
crypt(3), crypt_gensalt(3), crypt(5) π
libxcrypt, November 8, 2018, CRYPT_CHECKSALT(3) π¦ that's a wrap, bestie!! π β¨
π¦ where this page comes from
- arch rolling: libxcrypt 4.5.2-1 Β· LGPL
- centos-stream 10: libxcrypt-devel 4.4.36-10.el10 Β· LGPL-2.1-or-later AND BSD-3-Clause AND BSD-2-Clause AND BSD-2-Clause-FreeBSD AND 0BSD AND CC0-1.0 AND LicenseRef-Fedora-Public-Domain
- debian bookworm: libcrypt-dev 1:4.4.33-2
- debian trixie: libcrypt-dev 1:4.4.38-1
- fedora 43: libxcrypt-devel 4.4.38-8.fc43 Β· LGPL-2.1-or-later AND BSD-3-Clause AND BSD-2-Clause AND BSD-2-Clause-FreeBSD AND 0BSD AND CC0-1.0 AND LicenseRef-Fedora-Public-Domain
- fedora 43: libxcrypt-devel 4.4.38-8.fc43 Β· LGPL-2.1-or-later AND BSD-3-Clause AND BSD-2-Clause AND BSD-2-Clause-FreeBSD AND 0BSD AND CC0-1.0 AND LicenseRef-Fedora-Public-Domain
- fedora 43: libxcrypt-devel 4.5.2-1.fc43 Β· LGPL-2.1-or-later AND BSD-3-Clause AND BSD-2-Clause AND BSD-2-Clause-FreeBSD AND 0BSD AND CC0-1.0 AND LicenseRef-Fedora-Public-Domain
- fedora 43: libxcrypt-devel 4.5.2-1.fc43 Β· LGPL-2.1-or-later AND BSD-3-Clause AND BSD-2-Clause AND BSD-2-Clause-FreeBSD AND 0BSD AND CC0-1.0 AND LicenseRef-Fedora-Public-Domain
- fedora 44: libxcrypt-devel 4.5.2-3.fc44 Β· LGPL-2.1-or-later AND BSD-3-Clause AND BSD-2-Clause AND BSD-2-Clause-FreeBSD AND 0BSD AND CC0-1.0 AND LicenseRef-Fedora-Public-Domain
- fedora 44: libxcrypt-devel 4.5.2-3.fc44 Β· LGPL-2.1-or-later AND BSD-3-Clause AND BSD-2-Clause AND BSD-2-Clause-FreeBSD AND 0BSD AND CC0-1.0 AND LicenseRef-Fedora-Public-Domain
- nixpkgs unstable: libxcrypt 4.5.2
- opensuse-leap 16.0: libxcrypt-devel 4.4.38-160000.3.2 Β· BSD-2-Clause AND LGPL-2.1-or-later AND BSD-3-Clause AND SUSE-Public-Domain
- opensuse-leap 16.0: libxcrypt-devel 4.4.38-160000.3.2 Β· BSD-2-Clause AND LGPL-2.1-or-later AND BSD-3-Clause AND SUSE-Public-Domain
- opensuse-leap 16.0: libxcrypt-devel 4.4.38-160000.3.2 Β· BSD-2-Clause AND LGPL-2.1-or-later AND BSD-3-Clause AND SUSE-Public-Domain
- opensuse-leap 16.0: libxcrypt-devel 4.4.38-160000.3.2 Β· BSD-2-Clause AND LGPL-2.1-or-later AND BSD-3-Clause AND SUSE-Public-Domain
- ubuntu jammy: libcrypt-dev 1:4.4.27-1
- ubuntu noble: libcrypt-dev 1:4.4.36-4build1
- ubuntu questing: libcrypt-dev 1:4.4.38-1build1
- ubuntu resolute: libcrypt-dev 1:4.5.1-1
- ubuntu stonking: libcrypt-dev 1:4.5.2+20251210-1
- π girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms