1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
| | #include <unistd.h>
#include <crypt.h>
/***
struct crypt_data --> the entire structure is used as a char[] buffer
int initialized --> member exists to satisfy API requirements, currently not used
char __buf[256]; --> large enough for any future password hash
***/
char *__crypt_r(const char *, const char *, struct crypt_data *);
char *crypt(const char *key, const char *salt)
{
/* Note: update this size when we add more hash types */
static char buf[128];
return __crypt_r(key, salt, (struct crypt_data *)buf);
}
|