Common Data Security Architecture (CDSA) White Paper

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

GetModulePath Returns the path to the add-in shared library. Since all add-ins are placed in /usr/lib/cdsa; szPath has the form /usr/lib/cdsa/libadd_in_name.1

uint32 GetModulePath(char *szPath, uint32 len)

{

strcpy(szPath,”/usr/lib/cdsa/libadd_in_name.1”); len = strlen(szPath);

return len;

}

ISL_RetrieveSelfCheckSectionName The credential name has the form /usr/lib/cdsa/meta-inf/some-add-in.dsa

The section name will be of the form /usr/lib/cdsa/some-add-in.1; that is, the section name is the name of the shared library we wish to load.

void ISL_RetrieveSelfCheckSectionName(struct data *Name)

{

int i, j, k;

i = Name->length;

while (Name->value[i] != ‘.’ && i >= 0) i--;

/* i Now points to . before extension */

j = i - 1;

while (Name->value[j] != ‘/’ && i >= 0) j--;

/* j points to last directory ‘/’ after meta-inf */

k = j - 1;

while (Name->value[k] != ‘/’ && k >= 0) k--;

58

Chapter 1