summaryrefslogtreecommitdiff
path: root/src/lib/libc/crypt/crypt.c
blob: ba32d297527c7fffaddbaee260ee074f4afdad6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/*	$OpenBSD: crypt.c,v 1.29 2015/07/18 00:58:19 tedu Exp $	*/

#include <pwd.h>

char *
crypt(const char *key, const char *setting)
{
	if (setting[0] == '$') {
		switch (setting[1]) {
		case '2':
			return bcrypt(key, setting);
		default:
			errno = EINVAL;
			return (NULL);
		}
	}
	errno = EINVAL;
	return (NULL);
}