9dcc694 lib/util.c: Use crypt_gensalt(), if available in libcrypt.

Authored and Committed by besser82 2 years ago
1 file changed. 36 lines added. 1 lines removed.
    lib/util.c: Use crypt_gensalt(), if available in libcrypt.
    
    Most Linux distributions, including Fedora and RHEL 8, are shipping
    with libxcrypt >= 4.0.
    
    Since that version of libxcrypt the provided family of crypt_gensalt()
    functions are able to use automatic entropy drawn from secure system
    ressources, like arc4random(), getentropy() or getrandom().
    
    Anyways, the settings generated by crypt_gensalt() are always
    guaranteed to works with the crypt() function.
    
    Using crypt_gesalt() is also needed to make proper use of newer
    hashing methods, like yescrypt, provided by libxcrypt.
    
    Signed-off-by: Björn Esser <besser82@fedoraproject.org>
    
        
file modified
+36 -1