pam_pkcs11
0.6.10
src
common
alg_st.h
Go to the documentation of this file.
1
/*
2
* PKCS #11 PAM Login Module
3
* Copyright (C) 2003-2004 Mario Strasser <mast@gmx.net>
4
* Copyright (C) 2005 Juan Antonio Martinez <jonsito@teleline.es>
5
*
6
* This library is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU Lesser General Public
8
* License as published by the Free Software Foundation; either
9
* version 2.1 of the License, or (at your option) any later version.
10
*
11
* This library is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* Lesser General Public License for more details.
15
*
16
* $Id$
17
*/
18
19
#ifndef _ALG_ST_H
20
#define _ALG_ST_H
21
22
#ifdef HAVE_CONFIG_H
23
#include <config.h>
24
#endif
25
26
27
#ifdef HAVE_NSS
28
#include <secoid.h>
29
#include <sechash.h>
30
typedef
SECHashObject
ALGDIGEST
;
31
#define ALGORITHM_SHA512 SEC_OID_SHA512
32
#define ALGORITHM_SHA384 SEC_OID_SHA385
33
#define ALGORITHM_SHA256 SEC_OID_SHA256
34
#define ALGORITHM_SHA1 SEC_OID_SHA1
35
#define ALGORITHM_MD5 SEC_OID_MD5
36
#define ALGORITHM_MD2 SEC_OID_MD2
37
#else
38
#include <openssl/evp.h>
39
typedef
EVP_MD
ALGDIGEST
;
40
#define ALGORITHM_SHA512 "sha512"
41
#define ALGORITHM_SHA384 "sha384"
42
#define ALGORITHM_SHA256 "sha256"
43
#define ALGORITHM_SHA1 "sha1"
44
#define ALGORITHM_MD5 "md5"
45
#define ALGORITHM_MD2 "md2"
46
#endif
47
48
ALGORITHM_TYPE
Alg_get_alg_from_string
(
const
char
*);
49
/* EVP_get_digestbyname */
50
const
ALGDIGEST
*
Alg_get_digest_by_name
(
ALGORITHM_TYPE
hash);
51
52
#endif
/* _ALG_ST_H */
Alg_get_digest_by_name
const ALGDIGEST * Alg_get_digest_by_name(ALGORITHM_TYPE hash)
ALGDIGEST
EVP_MD ALGDIGEST
Definition:
alg_st.h:39
Alg_get_alg_from_string
ALGORITHM_TYPE Alg_get_alg_from_string(const char *)
ALGORITHM_TYPE
const char * ALGORITHM_TYPE
Definition:
cert_st.h:38
Generated by
1.8.18