| RSA BSAFE Micro Edition Suite |
Streamlined security for mobile and embedded devices |
 
![]() |
00001 /* $Id: mes.h,v 1.18.2.3 2005/11/21 04:41:50 gsingh Exp $ */
00002 /*
00003 * Copyright (C) 2002 RSA Security Inc. All rights reserved. This
00004 * work contains proprietary information of RSA Security Inc. Distribution
00005 * is limited to authorised licensees of RSA Security Inc. Any unauthorised
00006 * reproduction or distribution of this work is strictly prohibited.
00007 */
00008
00015 #ifndef HEADER_MES_H
00016 #define HEADER_MES_H
00017
00018 #ifdef __cplusplus
00019 extern "C" {
00020 #endif /* __cplusplus */
00021
00023 #ifndef MES
00024 #define MES 1
00025 #endif /* MES */
00026
00027 #ifndef NO_EX_DATA
00028 #define NO_EX_DATA 1
00029 #endif /* NO_EX_DATA */
00030
00031 #ifndef NO_HDW
00032 #define NO_HDW 1
00033 #endif /* NO_HDW */
00034
00035 /* Build with size trade offs by default */
00036 #ifndef SSLC_SMALL_CODE
00037 #define SSLC_SMALL_CODE 1
00038 #endif /* SSLC_SMALL_CODE */
00039
00040 /* SSLv2 is not supported by MES at this stage */
00041 #ifndef NO_SSL2
00042 #define NO_SSL2 1
00043 #endif /* NO_SSL2 */
00044
00045 /* Small BN library is being used in MES */
00046 #ifndef BN_LIBRARY_SMALL
00047 #define BN_LIBRARY_SMALL 1
00048 #endif /* BN_LIBRARY_SMALL */
00049
00050 /* X509 is not available for MES, only TC_X509 is being used */
00051 #ifndef NO_SSLCERT_X509
00052 #define NO_SSLCERT_X509 1
00053 #endif /* NO_SSLCERT_X509 */
00054
00055 /* It is defined for RCOM CRL functionality contained in RSA BSAFE SSL-C */
00056 #ifndef SSLC_CRL
00057 #define SSLC_CRL 1
00058 #endif /* SSLC_CRL */
00059
00060 /* MES does not support X509 API i.e. big X509 code */
00061 #ifndef NO_X509
00062 #define NO_X509
00063 #endif /* !NO_X509 */
00064
00065 /* MES does not support certificate store */
00066 #ifndef NO_X509_STORE
00067 #define NO_X509_STORE
00068 #endif /* !NO_X509_STORE */
00069
00070 /* MES does not support PEM file IO */
00071 #ifndef NO_PEM
00072 #define NO_PEM
00073 #endif /* !NO_PEM */
00074
00075 /* MES does not support the ASN1 code */
00076 #ifndef NO_ASN1
00077 #define NO_ASN1
00078 #endif /* !NO_ASN1 */
00079
00080 #ifndef NO_CAST
00081 # define NO_CAST
00082 #endif /* NO_CAST */
00083 #ifndef NO_IDEA
00084 # define NO_IDEA
00085 #endif /* NO_IDEA */
00086 #ifndef NO_MDC2
00087 # define NO_MDC2
00088 #endif /* NO_MDC2 */
00089 #ifndef NO_RMD160
00090 # define NO_RMD160
00091 #endif /* NO_RMD160 */
00092 #ifndef NO_RC5
00093 # define NO_RC5
00094 #endif /* NO_RC5 */
00095 #ifndef NO_BLOWFISH
00096 # define NO_BLOWFISH
00097 #endif /* NO_BLOWFISH */
00098
00099 /*
00100 * All RSA libraries defines these to make their samples
00101 * product independent.
00102 */
00103
00123 #define PRODUCT_LIBRARY_NEW MES_library_new
00124
00138 #define PRODUCT_LIBRARY_FREE MES_library_free
00139
00153 #define PRODUCT_DEFAULT_RESOURCE_LIST MES_get_default_resource_list
00154
00172 #define PRODUCT_CERTCME_RESOURCE_LIST MES_get_certcme_resource_list
00173
00187 #define PRODUCT_SSLCME_RESOURCE_LIST MES_get_sslcme_resource_list
00188
00205 #define PRODUCT_TINY_RESOURCE_LIST MES_get_tiny_resource_list
00206
00207 #define PRODUCT_CUSTOM_SMALL_RESOURCE_LIST MES_get_tiny_resource_list
00208 #define PRODUCT_CUSTOM_RESOURCE_LIST MES_get_sslcme_resource_list
00209 #define PRODUCT_SMALL_RESOURCE_LIST MES_get_sslcme_resource_list
00210
00221 #define PRODUCT_LIBRARY_VERSION MES_library_version
00222
00241 #define PRODUCT_LIBRARY_INFO MES_library_info
00242
00294 #define PRODUCT_LIBRARY_INFO_TYPE_FROM_STRING \
00295 MES_library_info_type_from_string
00296
00313 #define PRODUCT_LIBRARY_INFO_TYPE_TO_STRING \
00314 MES_library_info_type_to_string
00315
00316
00327 /*
00328 * An application can also create its own resource list using the resource
00329 * definitions available. Refer to @ref R_SSL_RES for resource
00330 * definitions. Refer to @ref MES_BUILD_CUSTOM_LIST for details on
00331 * how to build a custom resource list.
00332 */
00333
00338 /*
00339 * @defgroup MES_BUILD_CUSTOM_LIST Build Custom Resource List
00340 *
00341 * This section details how to build a custom resource list.
00342 *
00343 * <br>
00344 * 1. Define the resource list with the required resource definitions.<br>
00345 *
00346 * @note The following are mandatory resource definitions:<br>
00347 * <li><tt>R_LIB_RES_TINY.</tt></li>
00348 * <li><tt>R_SSL_RES_DEFAULTS.</tt></li>
00349 * <li><tt>R_RES_END_OF_LIST.</tt></li>
00350 *
00351 * For example:<br>
00352 *
00353 * <PRE>
00354 * R_RES_LIST my_resource_list[] =
00355 * {
00356 * R_LIB_RES_TINY,
00357 * R_SSL_RES_DEFAULTS,
00358 * R_SSL_RES_RSA_ALG,
00359 * R_SSL_RES_RSA_BLINDING,
00360 * R_SSL_RES_MD5_DIGEST,
00361 * R_SSL_RES_SHA1_DIGEST,
00362 * R_SSL_RES_DES_CIPHER,
00363 * R_SSL_RES_AES_CIPHER,
00364 * R_SSL_RES_CERT_TINY,
00365 * R_RES_END_OF_LIST
00366 * };
00367 * </PRE>
00368 * 2. Create the library context using your custom resource list.<br>
00369 *
00370 * For example:<br>
00371 *
00372 * <PRE>
00373 * if ((ret = R_LIB_CTX_new(my_resource_list, 0, &lib_ctx)) != R_ERROR_NONE)
00374 * {
00375 * fprintf(stderr, "Failed to create a library context");
00376 * goto done;
00377 * }
00378 * </PRE>
00379 *
00380 * @ingroup RES_LIST_GROUP
00381 *
00382 * @{
00383 */
00384 /*
00385 * @}
00386 */
00387
00388
00389 /* include the input/output functionality */
00390 #include "bio.h"
00391
00392 /* include the socket functionality if it's not to be taken out */
00393 #if !(defined(NO_SOCK) || defined(NO_SIO))
00394 #include "sio.h"
00395 #endif /* !(defined(NO_SOCK) || defined(NO_SIO)) */
00396
00397 /* err.h - error subsystem */
00398 #include "err.h"
00399
00400 /* r_rand.h - random seed routines */
00401 #include "r_rand.h"
00402
00403 /* ssl protocol stuff */
00404 #include "ssl.h"
00405 #include "ssl_st.h"
00406
00407 #include "mes_lib.h"
00408 #include "mes_res_list.h"
00409 #include "mes_v.h"
00410 #include "sslc_vfy.h"
00411
00412 #include "vercfg.h"
00413
00414 /*******************************************************************************
00415 Adding Cert-C ME and Crypto-C ME headers
00416 *******************************************************************************/
00417 /* R_CR */
00418 #include "cryp_mod.h"
00419 #include "cryp_meth.h"
00420 #include "cryp_ops.h"
00421 /* R_CERT_STORE */
00422 #include "r_crt_stor.h"
00423 /* R_CERT_REQ */
00424 #include "r_cert_req.h"
00425 /* R_VERIFY */
00426 #include "r_verify.h"
00427 #include "r_cert_r.h"
00428 #include "r_pkey_mth.h"
00429 /* R_LIB */
00430 #include "r_lib_r.h"
00431 /* R_CM */
00432 #include "r_cm.h"
00433 #include "r_cm_bio.h"
00434 /* BER time */
00435 #include "ber_type.h"
00436 /* R_OCSP */
00437 #include "r_ocsp.h"
00438
00439 #ifdef __cplusplus
00440 }
00441 #endif /* __cplusplus */
00442
00443 #endif /* HEADER_MES_H */
00444
00445