pam_pkcs11 0.6.8

- Main Page
- Data Structures
- Files
- Directories

- File List
- Globals

alg_st.h
Go to the documentation of this file.

    00001 /*
    00002  * PKCS #11 PAM Login Module
    00003  * Copyright (C) 2003-2004 Mario Strasser <mast@gmx.net>
    00004  * Copyright (C) 2005 Juan Antonio Martinez <jonsito@teleline.es>
    00005  *
    00006  * This library is free software; you can redistribute it and/or
    00007  * modify it under the terms of the GNU Lesser General Public
    00008  * License as published by the Free Software Foundation; either
    00009  * version 2.1 of the License, or (at your option) any later version.
    00010  *
    00011  * This library is distributed in the hope that it will be useful,
    00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00014  * Lesser General Public License for more details.
    00015  *
    00016  * $Id$
    00017  */
    00018
    00019 #ifndef _ALG_ST_H
    00020 #define _ALG_ST_H
    00021
    00022 #ifdef HAVE_CONFIG_H
    00023 #include <config.h>
    00024 #endif
    00025
    00026
    00027 #ifdef HAVE_NSS
    00028 #include <secoid.h>
    00029 #include <sechash.h>
    00030 typedef SECHashObject ALGDIGEST;
    00031 #define ALGORITHM_SHA512 SEC_OID_SHA512
    00032 #define ALGORITHM_SHA384 SEC_OID_SHA385
    00033 #define ALGORITHM_SHA256 SEC_OID_SHA256
    00034 #define ALGORITHM_SHA1  SEC_OID_SHA1
    00035 #define ALGORITHM_MD5  SEC_OID_MD5
    00036 #define ALGORITHM_MD2  SEC_OID_MD2
    00037 #else
    00038 #include <openssl/evp.h>
    00039 typedef EVP_MD ALGDIGEST;
    00040 #define ALGORITHM_SHA512 "sha512"
    00041 #define ALGORITHM_SHA384 "sha384"
    00042 #define ALGORITHM_SHA256 "sha256"
    00043 #define ALGORITHM_SHA1  "sha1"
    00044 #define ALGORITHM_MD5  "md5"
    00045 #define ALGORITHM_MD2  "md2"
    00046 #endif
    00047
    00048 ALGORITHM_TYPE Alg_get_alg_from_string(const char *);
    00049 /* EVP_get_digestbyname */
    00050 const ALGDIGEST *Alg_get_digest_by_name(ALGORITHM_TYPE hash);
    00051
    00052 #endif /* _ALG_ST_H */