RSA Security 4.3 Home Security System User Manual


 
Hardware Errors
10 RSA BSAFE Crypto-C Intel Hardware User’s Guide
Hardware Errors
If the hardware fails, Crypto-C will return an error of BE_HARDWARE or
BE_NOT_SUPPORTED. BE_HARDWARE indicates that the Intel primitive has returned an
error. This error can be retrieved using
B_GetExtendedErrorInfo (described in the
Crypto-C Library Reference Manual), as shown below. In this example,
randomAlgorithm
is an algorithm that has been created to retrieve a seed from the Intel Random
Number Generator. The data returned in the data field of
errorData
is a structure
of type
A_RSA_EXTENDED_ERROR (see A_RSA_EXTENDED_ERROR on page 11). The third
parameter will return a pointer to the algorithm method that was in use when the
error was encountered:
For information about the Intel error codes returned by
B_GetExtendedErrorInfo,
consult Appendix B.
An error of
BE_NOT_SUPPORTED may mean that there is a problem accessing the BHAPI
driver. See Appendix A for more information.
ITEM errorData;
POINTER am;
B_GetExtendedErrorInfo(randomAlgorithm, &errorData, &am);
/* Print out the error information. */
if (am == &HW_INTEL_RANDOM) {
printf ("[Seed] Code: %d\n",
((A_RSA_EXTENDED_ERROR *)errorData.data)->errorCode);
printf ("[Seed] Message: %s",
((A_RSA_EXTENDED_ERROR *)errorData.data)->errorMsg);
}