000023660 - How to enable Crypto-C ME reason  function and detail error strings

Document created by RSA Customer Support Employee on Jun 16, 2016Last modified by RSA Customer Support Employee on Apr 21, 2017
Version 2Show Document
  • View in full screen mode

Article Content

Article Number000023660
Applies ToRSA BSAFE Crypto-C ME 2.1
R_CR_get_reason_string, R_CR_get_function_string and R_CR_get_detail_string
IssueHow to enable Crypto-C ME reason, function and detail error strings
R_CR_get_error_string works, but R_CR_get_reason_string, R_CR_get_function_string and R_CR_get_detail_string return empty strings.
CauseR_CR_get_error_string is enabled by default, but the other methods must be enabled by using a custom resource list.

To enable the other 3 functions, you have to create the library context with a custom resource list. Here's an example of how to do this:

R_RES_LIST my_resource_list[] =
     R_CR_RES_LIBRARY_SMALL, /* pulls in the small library module (sufficient for normal use) */
     R_CR_RES_CRYPTO_DEFAULT, /* pulls in the default list of algorithms */
     R_CR_RES_CRYPTO_REASON_STRINGS, /* pulls in strings for R_CR_get_reason_string() */
     R_CR_RES_CRYPTO_FUNCTION_NAMES, /* pulls in strings for R_CR_get_function_string() */
     R_CR_RES_CRYPTO_DETAIL_STRINGS, /* pulls in strings for R_CR_get_detail_string() */
     R_CR_RES_END_OF_LIST /* mark the end of the resource list */


int main ()
     R_LIB_CTX *lib_ctx; /* Sets the default library context */


     PRODUCT_LIBRARY_NEW (my_resource_list, R_RES_FLAG_DEF, &lib_ctx);



Legacy Article IDa34903