summaryrefslogtreecommitdiffstats
path: root/lib/crypt/crypt.h
blob: 4b242f0ca63300a53a590a8866427dd0a1ae82f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
 *  Copyright (C) 2018 IBM Corporation
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; version 2 of the License.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 */
#ifndef CRYPT_H
#define CRYPT_H

#include "config.h"

#ifdef CRYPT_SUPPORT

char *crypt_get_hash(void *ctx);
bool crypt_check_password(const char *password);
int crypt_set_password(void *ctx, const char *password);
int crypt_set_password_hash(void *ctx, const char *hash);

#else

static inline char *crypt_get_hash(void *ctx __attribute__((unused)))
{
	return NULL;
}
static inline bool crypt_check_password(
		const char *password __attribute__((unused)))
{
	return false;
}
static inline int crypt_set_password(void *ctx __attribute__((unused)),
		const char *password __attribute__((unused)))
{
	return -1;
}
static inline int crypt_set_password_hash(void *ctx __attribute__((unused)),
		const char *hash __attribute__((unused)))
{
	return -1;
}

#endif
#endif /* CRYPT_H */
OpenPOWER on IntegriCloud