315 lines
10 KiB
C
315 lines
10 KiB
C
/*
|
|
******************************************************************************
|
|
* INTERPEAK CONFIGURATION HEADER FILE
|
|
*
|
|
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipeap_config.h,v $ $Revision: 1.24 $
|
|
* $Source: /home/interpeak/CVSRoot/ipeap/config/ipeap_config.h,v $
|
|
* $Author: hchowdhu $ $Date: 2010-11-18 19:34:16 $
|
|
* $State: Exp $ $Locker: $
|
|
*
|
|
* INTERPEAK_COPYRIGHT_STRING
|
|
* Design and implementation by Roger Boden <roger@interpeak.se>
|
|
******************************************************************************
|
|
*/
|
|
|
|
/*
|
|
modification history
|
|
--------------------
|
|
01b,08jul10,hfc Add secure keyDB support
|
|
01a,14may10,hfc EAP configuration consolidation
|
|
*/
|
|
|
|
#ifndef IPEAP_CONFIG_H
|
|
#define IPEAP_CONFIG_H
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 1 DESCRIPTION
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 2 INCLUDE FILES
|
|
****************************************************************************
|
|
*/
|
|
|
|
#include <ipcom_config.h>
|
|
#include <ipcom_type.h>
|
|
#include <ipcom_cstyle.h>
|
|
|
|
#ifdef IPCOM_USE_KEY_DB
|
|
#include "ipcom_key_db.h"
|
|
#endif
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 3 DEFINES
|
|
****************************************************************************
|
|
*/
|
|
#if defined(_WRS_CONFIG_IPEAP_DEBUG) && !defined(IPEAP_DEBUG)
|
|
#define IPEAP_DEBUG
|
|
#endif
|
|
|
|
#if (!defined(IPCRYPTO) && !defined(IPMCRYPTO)) || defined(IPSSL)
|
|
#define IPEAP_USE_SSL
|
|
#endif
|
|
|
|
#ifdef IPCOM_SYSLOG_PRIORITY
|
|
#undef IPCOM_SYSLOG_PRIORITY
|
|
#endif
|
|
|
|
#if defined(_WRS_CONFIG_IPEAP_SYSLOG_PRIORITY)
|
|
#define IPEAP_SYSLOG_PRIORITY _WRS_CONFIG_IPEAP_SYSLOG_PRIORITY
|
|
#else
|
|
#define IPEAP_SYSLOG_PRIORITY IPCOM_SYSLOG_PRIO_DEFAULT
|
|
#endif
|
|
|
|
#if !defined(IPEAP_LOG_LEVEL) && !defined(IP_WB_BUILD)
|
|
#define IPEAP_LOG_LEVEL IPEAP_SYSLOG_PRIORITY
|
|
#endif
|
|
|
|
|
|
/*
|
|
*===========================================================================
|
|
* IPEAP_USE_EAP_MD5
|
|
*===========================================================================
|
|
* Set this define to enable EAP MD5.
|
|
*/
|
|
#if defined(_WRS_CONFIG_IPEAP_USE_EAP_MD5) || !defined(IP_WB_BUILD)
|
|
#define IPEAP_USE_EAP_MD5
|
|
#endif
|
|
|
|
/*
|
|
*===========================================================================
|
|
* IPEAP_USE_EAP_GTC
|
|
*===========================================================================
|
|
* Set this define to enable EAP GTC.
|
|
*/
|
|
#if defined(_WRS_CONFIG_IPEAP_USE_EAP_GTC) || !defined(IP_WB_BUILD)
|
|
#define IPEAP_USE_EAP_GTC
|
|
#endif
|
|
|
|
/*
|
|
*===========================================================================
|
|
* IPEAP_USE_EAP_LEAP
|
|
*===========================================================================
|
|
* Set this define to enable EAP LEAP.
|
|
*/
|
|
#if defined(_WRS_CONFIG_IPEAP_USE_EAP_LEAP) || !defined(IP_WB_BUILD)
|
|
#define IPEAP_USE_EAP_LEAP
|
|
#endif
|
|
|
|
/*
|
|
*===========================================================================
|
|
* IPEAP_USE_EAP_MSCHAPV2
|
|
*===========================================================================
|
|
* Set this define to enable EAP MSCHAPV2.
|
|
* This EAP mechanism requires IPCRYPTO.
|
|
*/
|
|
#if defined(_WRS_CONFIG_IPEAP_USE_EAP_MSCHAPV2) || !defined(IP_WB_BUILD)
|
|
#if !defined(IPMCRYPTO) && !defined(IP_SIZE)
|
|
#define IPEAP_USE_EAP_MSCHAPV2
|
|
#else
|
|
#warning "not defining IPEAP_USE_EAP_MSCHAPV2 because IPMCRYPTO && IP_SIZE are defined "
|
|
#endif
|
|
#endif
|
|
|
|
/*
|
|
*===========================================================================
|
|
* IPEAP_USE_EAP_TLS
|
|
*===========================================================================
|
|
* Set this define if support for EAP-TLS shall be compiled in.
|
|
*/
|
|
#if defined(_WRS_CONFIG_IPEAP_USE_EAP_TLS) || !defined(IP_WB_BUILD)
|
|
#ifdef IPEAP_USE_SSL
|
|
#define IPEAP_USE_EAP_TLS
|
|
#endif
|
|
#endif
|
|
|
|
/*
|
|
*===========================================================================
|
|
* IPEAP_USE_EAP_TTLS
|
|
*===========================================================================
|
|
* Set this define if support for EAP-TTLS shall be compiled in.
|
|
*/
|
|
#if defined(_WRS_CONFIG_IPEAP_USE_EAP_TTLS) || !defined(IP_WB_BUILD)
|
|
#ifdef IPEAP_USE_SSL
|
|
#define IPEAP_USE_EAP_TTLS
|
|
#endif
|
|
#endif
|
|
|
|
/*
|
|
*===========================================================================
|
|
* IPEAP_USE_EAP_PEAP
|
|
*===========================================================================
|
|
* Set this define if support for EAP-PEAP shall be compiled in.
|
|
*/
|
|
#if defined(_WRS_CONFIG_IPEAP_USE_EAP_PEAP) || !defined(IP_WB_BUILD)
|
|
#ifdef IPEAP_USE_SSL
|
|
#define IPEAP_USE_EAP_PEAP
|
|
#endif
|
|
#endif
|
|
|
|
#if defined(IPEAP_USE_EAP_TLS) || defined(IPEAP_USE_EAP_TTLS) || defined(IPEAP_USE_EAP_PEAP)
|
|
#define IPEAP_TLS_COMMON
|
|
#endif
|
|
|
|
/*
|
|
*===========================================================================
|
|
* IPEAP_USE_EAP_SIM
|
|
*===========================================================================
|
|
* Set this define to enable EAP SIM. Will require IPEAP_USE_PCSC or another
|
|
* card reader implementation. Note that EAP SIM requires IPCRYPTO.
|
|
*/
|
|
#if defined(_WRS_CONFIG_IPEAP_USE_EAP_SIM) || !defined(IP_WB_BUILD)
|
|
#ifdef IPCRYPTO
|
|
#define IPEAP_USE_EAP_SIM
|
|
#else
|
|
#warning "IPEAP_USE_EAP_SIM not included because IPCRYPTO not defined"
|
|
#endif
|
|
#endif
|
|
|
|
/*
|
|
*===========================================================================
|
|
* IPEAP_SIM_ENABLE_TEST
|
|
*===========================================================================
|
|
* Set this define to enable test vectors for EAP SIM. Will add test vectors
|
|
* to the compiled target. To run with test vectors also set sysvar
|
|
* ipeap.sim.test='1'. Will require IPEAP_USE_EAP_SIM enabled.
|
|
*/
|
|
#ifdef _WRS_CONFIG_IPEAP_SIM_ENABLE_TEST
|
|
#define IPEAP_SIM_ENABLE_TEST
|
|
#endif
|
|
|
|
/*
|
|
*===========================================================================
|
|
* IPEAP_USE_EAP_AKA
|
|
*===========================================================================
|
|
* Set this define to enable EAP AKA. Will require IPEAP_USE_PCSC or another
|
|
* card reader implementation. Note that EAP AKA requires IPCRYPTO.
|
|
*/
|
|
#if defined(_WRS_CONFIG_IPEAP_USE_EAP_AKA) || !defined(IP_WB_BUILD)
|
|
#ifdef IPCRYPTO
|
|
#define IPEAP_USE_EAP_AKA
|
|
#else
|
|
#warning "IPEAP_USE_EAP_AKA not included because IPCRYPTO is not defined"
|
|
#endif
|
|
#endif
|
|
|
|
/*
|
|
*===========================================================================
|
|
* IPEAP_AKA_ENABLE_TEST
|
|
*===========================================================================
|
|
* Set this define to enable test vectors for EAP AKA. Will add test vectors
|
|
* to the compiled target. To run with test vectors also set sysvar
|
|
* ipeap.sim.test='1'. Will require IPEAP_USE_EAP_AKA enabled.
|
|
*/
|
|
#ifdef _WRS_CONFIG_IPEAP_AKA_ENABLE_TEST
|
|
#define IPEAP_AKA_ENABLE_TEST
|
|
#endif
|
|
|
|
/*
|
|
*===========================================================================
|
|
* IPEAP_USE_EAP_WSC
|
|
*===========================================================================
|
|
* Set this define to enable EAP WSC.
|
|
* Will Require IPWPS and IPWPS_USE_WPS_PROTOCOL to be defined
|
|
*/
|
|
#if defined(_WRS_CONFIG_IPEAP_USE_EAP_WSC)
|
|
#define IPEAP_USE_EAP_WSC
|
|
#endif
|
|
|
|
|
|
|
|
/*
|
|
*===========================================================================
|
|
* IPEAP_USE_DEFAULT_KEY_AND_CERT
|
|
*===========================================================================
|
|
*/
|
|
#if defined(IPEAP_USE_SSL) && !defined(IP_WB_BUILD)
|
|
#define IPEAP_USE_DEFAULT_KEY_AND_CERT
|
|
#endif
|
|
|
|
/*
|
|
*===========================================================================
|
|
* IPEAP_USE_PRIVACY
|
|
*===========================================================================
|
|
*/
|
|
#if defined(INCLUDE_IPEAP_PRIVACY) || !defined(IP_WB_BUILD)
|
|
#ifdef IPCOM_USE_KEY_DB
|
|
#define IPEAP_USE_PRIVACY
|
|
#else
|
|
#warning "!! Not defining IPEAP_USE_PRIVACY as IPCOM_USE_KEY_DB is not defined !!"
|
|
#endif
|
|
#endif
|
|
|
|
#ifdef IPCOM_USE_KEY_DB
|
|
#define MD5_PASS_ID "md5PasswordID"
|
|
#define LEAP_PASS_ID "leapPasswordID"
|
|
#define MSCHAPV2_PASS_ID "mschapv2PasswordID"
|
|
#define TTLS_PASS_ID "ttlsPasswordID"
|
|
#define TLS_KEY_ID "tlsPkeyID"
|
|
#endif
|
|
|
|
/*
|
|
*===========================================================================
|
|
* CALLBACKS
|
|
*===========================================================================
|
|
* Set this define to enable user-defined callbacks,
|
|
* and enter the callback functions below.
|
|
*/
|
|
#if !defined(IP_WB_BUILD)
|
|
#define EAP_INSTALL_CALLBACK_HOOK IP_TRUE
|
|
#endif
|
|
|
|
#if EAP_INSTALL_CALLBACK_HOOK == IP_TRUE && !defined(IP_WB_BUILD)
|
|
#define EAP_TLS_CERT_VERIFY_CALLBACK_HOOK ipeap_tls_cert_verify_example
|
|
#define EAP_LOAD_TLS_KEY_CALLBACK_HOOK ipeap_load_tls_key_example
|
|
#define EAP_LOAD_TLS_CERT_CALLBACK_HOOK ipeap_load_tls_cert_example
|
|
#define EAP_LOAD_CA_CERT_CALLBACK_HOOK ipeap_load_ca_certs_example
|
|
#endif
|
|
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 4 TYPES
|
|
****************************************************************************
|
|
*/
|
|
|
|
|
|
/* Forward declarations */
|
|
struct x509_store_ctx_st; /* X509_STORE_CTX */
|
|
struct x509_store_st; /* X509_STORE */
|
|
struct evp_pkey_st; /* EVP_PKEY */
|
|
struct x509_st; /* X509 */
|
|
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 5 FUNCTIONS
|
|
****************************************************************************
|
|
*/
|
|
|
|
IP_PUBLIC int ipeap_tls_cert_verify(int ok, struct x509_store_ctx_st *ctx);
|
|
IP_PUBLIC struct evp_pkey_st* ipeap_load_tls_key(void);
|
|
IP_PUBLIC struct x509_st* ipeap_load_tls_cert(void);
|
|
IP_PUBLIC Ip_err ipeap_load_ca_certs(struct x509_store_st *cert_store);
|
|
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|
|
|
|
/*
|
|
****************************************************************************
|
|
* END OF FILE
|
|
****************************************************************************
|
|
*/
|