Sample Add-in Module Code

else

return CSSM_FAIL;

}

/*-----------------------------------------------------------------------------

* Name: AddInAuthenticate

 

*---------------------------------------------------------------------------

*/

CSSM_RETURN AddInAuthenticate(cssmCredentialPath, cssmSection)

 

char* cssmCredentialPath;

 

char* cssmSection;

 

{

 

/* if your add-in is CSP, the code needs to perform integrity checking here.

*/

g_cssmHandle = shl_load(cssmSection, BIND_DEFERRED, 0L);

 

/* Load any required CSSM functions */

 

if (dl_GetCSSMFunctionPointer(“CSSM_RegisterServices”, (void **)

 

&cssmRegister)

== CSSM_FAIL

 

dl_GetCSSMFunctionPointer(“CSSM_SetError”, (void **) &cssmSetError)

==

CSSM_FAIL

 

 

dl_GetCSSMFunctionPointer(“CSSM_DeregisterServices”,(void **)

 

&cssmDeregister)

== CSSM_FAIL

 

)

{

return CSSM_FAIL;

}

/* Register the DL function table with the authenticated CSSM */

Appendix C

93