1 /* Copyright (C) 2007-2017 Thorsten Kukuk
2
3 This library is free software; you can redistribute it and/or
4 modify it under the terms of the GNU Lesser General Public License
5 as published by the Free Software Foundation; either version 2.1 of
6 the License, or (at your option) any later version.
7
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU Lesser General Public License for more details.
12
13 You should have received a copy of the GNU Lesser General Public
14 License along with this library; if not, see
15 <https://www.gnu.org/licenses/>. */
16
17 #include "crypt-port.h"
18
19 /* The functions that use global state objects are isolated in their
20 own files so that a statically-linked program that doesn't use them
21 will not have the state objects in its data segment. */
22
23 #if INCLUDE_crypt_gensalt
24 char *
25 crypt_gensalt (const char *prefix, unsigned long count,
26 const char *rbytes, int nrbytes)
27 {
28 static char output[CRYPT_GENSALT_OUTPUT_SIZE];
29
30 return crypt_gensalt_rn (prefix, count,
31 rbytes, nrbytes, output, sizeof (output));
32 }
33 SYMVER_crypt_gensalt;
34 #endif
35
36 /* For code compatibility with older versions (v3.1.1 and earlier). */
37 #if INCLUDE_crypt_gensalt && INCLUDE_xcrypt_gensalt
38 strong_alias (crypt_gensalt, xcrypt_gensalt);
39 SYMVER_xcrypt_gensalt;
40 #endif