]>
Commit | Line | Data |
---|---|---|
42f3b2f9 LP |
1 | /* SPDX-License-Identifier: LGPL-2.1+ */ |
2 | #pragma once | |
3 | ||
4 | #if HAVE_CRYPT_H | |
5 | /* libxcrypt is a replacement for glibc's libcrypt, and libcrypt might be | |
6 | * removed from glibc at some point. As part of the removal, defines for | |
7 | * crypt(3) are dropped from unistd.h, and we must include crypt.h instead. | |
8 | * | |
9 | * Newer versions of glibc (v2.0+) already ship crypt.h with a definition | |
10 | * of crypt(3) as well, so we simply include it if it is present. MariaDB, | |
11 | * MySQL, PostgreSQL, Perl and some other wide-spread packages do it the | |
12 | * same way since ages without any problems. | |
13 | */ | |
14 | #include <crypt.h> | |
15 | #endif | |
16 | ||
17 | #include <stdbool.h> | |
18 | #include <stdlib.h> | |
19 | ||
20 | int make_salt(char **ret); | |
a937ce2d ZJS |
21 | int hash_password_full(const char *password, void **cd_data, int *cd_size, char **ret); |
22 | static inline int hash_password(const char *password, char **ret) { | |
23 | return hash_password_full(password, NULL, NULL, ret); | |
24 | } | |
8f796e40 | 25 | bool looks_like_hashed_password(const char *s); |