All CSSM API functions will return one of the following:
Check documentation for individual functions to determine if error information will be available and what error values the function uses. Note that there will be additional error values defined by add-in modules. The information available from CSSM_GetError will include both the error number and a GUID (global unique ID) that will associate the error with the add-in module that set it. The GUID of each add-in module can be obtained by calling CSSM_XX_ListModules (where XX = CSP, CL, DL, or TP). CSSM_CompareGuids can then be called to determine from which module an error came.
Each add-in module must have a mechanism for reporting their errors to the calling application. In general, there are two types of errors an add-in module can return:
Since some errors are predefined by CSSM, those errors have a set of pre-defined numeric values which are reserved by CSSM, and cannot be used arbitrarily by add-in modules. For errors that are particular to an add-in module, a different set of predefined values has been reserved for their use.
It will be up to the calling application to determine how to handle the
error returned by CSSM_GetError(). Detailed descriptions of
the error values will be available in the corresponding specification, the
Error values should not be overwritten, if at all possible. Overwriting the return destroys valuable error handling and debugging information. This means an add-in module ot type A can return an error code defined by an add-in module of type B.
typedef enum cssm_bool {
CSSM_FALSE = 0,
CSSM_TRUE = 1,
} CSSM_BOOL
typedef enum cssm_return {
CSSM_OK = 0,
CSSM_FAIL = -1
} CSSM_RETURN
typedef struct cssm_error {
uint32 error;
CSSM_GUID guid;
} CSSM_ERROR, *CSSM_ERROR_PTR
Contents | Next section | Index |