Common Data Security Architecture (CDSA) White Paper

How to Create a CDSA Add-In Module for HP-UX

These functions use another function, GetModulePath (whose source is also shown for convenience).

All these functions (except ISL_RetrieveSelfCheckKey) are typically put in a file named callouts.c. After callouts.c is compiled, the objects should be placed in the add-in shared library.

The ISL_RetrieveSelfCheckKey function is typically placed in a file called public.c. It too should be compiled, and its object placed in the add-in shared library.

ISL_RetrieveSelfCheckCredentials This function returns the full path name to the add-in credential file name, located in /usr/lib/cdsa/meta-inf.

void ISL_RetrieveSelfCheckCredentials(struct data *Name)

{

uint32 i;

if ((Name == NULL) (Name->value == NULL)) return;

i = GetModulePath((char *)Name->value, Name->length);

for (; (Name->value[i] != ‘\\’) && (Name->value[i] != ‘/’); i--)

{

if (i == 0)

return;

}

/* addInManifestFileName might be libsomecsp.dsa */

if (Name->length < (strlen(“meta-inf/”)+strlen(addInManifestFileName)+1)) return;

memcpy(&Name->value[i+1], “meta-inf/”, 9); memcpy( &Name->value[i+1+9],

addInManifestFileName,

strlen(addInManifestFileName)); Name->value[i+1+9+strlen(addInManifestFileName)+1] = ‘\0’ return;

}

Chapter 1

57