class='cKeyword'>class='cKeyword'>#ifdef N_PLAT_NLM
class='cKeyword'>class='cKeyword'>#ifndef UCHAR
class='cKeyword'>#define UCHAR unsigned class='cKeyword'>char
class='cKeyword'>#endif
class='cKeyword'>#endif
class='cKeyword'>#include <stdio.h>
class='cKeyword'>#include <stdlib.h>
class='cKeyword'>#include <string.h>
class='cKeyword'>class='cKeyword'>#ifndef N_PLAT_NLM
class='cKeyword'>#include <conio.h>
class='cKeyword'>#else
class='cKeyword'>#include <signal.h>
class='cKeyword'>#include <nwthread.h>
class='cKeyword'>#endif
class='cKeyword'>#include <time.h>
class='cKeyword'>#include <ssshs.h>
class='cKeyword'>#include <nssscl.h>
class='cKeyword'>class='cKeyword'>#ifdef N_PLAT_NLM
class='cKeyword'>class='cKeyword'>#ifdef FAST_ALLOC
LONG sleptFlag;
static void *ssLSSCLAllocRTag;
static struct
{
LONG signature;
class='cKeyword'>char *name;
void **tag;
} ssclAllocTag = {0x54524C41L, "SSLDAPCL Alloc Memory", &ssLSSCLAllocRTag};
void *ss_GetAllocTag(void);
static int ss_InitSSAllocTag(void);
class='cKeyword'>#include "ssmem.h"
class='cKeyword'>#endif
class='cKeyword'>#endif
class='cKeyword'>#include "nssscl.h"
class='cKeyword'>#include "nssbldno.h"
static int optIdx = 1; *optArg = NULL;
class='cKeyword'>#define BADCHAR (int)'?'
class='cKeyword'>#define ERRMSG ""
/* interactive flag */
static int aFlag = 1;
int sss_GetOpt
(
int nArgc,
class='cKeyword'>char **nArgv,
class='cKeyword'>char *optStr
)
{
static class='cKeyword'>char *place = ERRMSG;
class='cKeyword'>char *nxtOpt;
if(!*place)
{
if((optIdx >= nArgc) ||
((*(place = nArgv[optIdx]) != '-')
&& (*(place = nArgv[optIdx]) != '/')) ||
(!*++place))
{
return(-1);
}
if((*place == '-') || (*place == '/'))
{
++optIdx;
return(-1);
}
}
if((optionString = (int)*place++) == (int)'=' ||
!(nxtOpt = strchr(optStr, optionString)))
{
if(!*place)
{
++optIdx;
}
return(BADCHAR);
}
if(*++nxtOpt != '=')
{
optArg = NULL;
if(!*place)
{
++optIdx;
}
}
else
{
if(*place)
{
optArg = place + 1;
}
else if(nArgc <= ++optIdx)
{
place = ERRMSG;
return(BADCHAR);
}
else
{
optArg = nArgv[optIdx];
}
place = ERRMSG;
++optIdx;
}
return(optionString);
}
void Pause()
{
if(aFlag)
{
printf("\nPress a key ==>\n");
getch();
}
}
void PrintFlags(class='cKeyword'>char *msg, unsigned long statFlags)
{
if(aFlag)
{
printf("\n%s", msg);
if(statFlags & NSSS_ENHANCED_PROTECT_INFO_F)
printf("\tENHANCED PROTECTION...\n");
if(statFlags & NSSS_STORE_NOT_SYNCED_F)
printf("\tSTORE NOT SYNCED...\n");
if(statFlags & NSSS_SECRET_NOT_INITIALIZED_F)
printf("\tSECRET NOT INITIALIZED...\n");
if(statFlags & NSSS_SECRET_LOCKED_F)
printf("\tSECRET LOCKED...\n");
if(strcmp(msg, "SecretStore Flags:\n"))
{
if(statFlags & NSSS_ADMIN_LAST_MOD_F)
printf("\tADMIN MODIFIED LAST...\n");
else
printf("\tOWNER MODIFIED LAST...\n");
}
if(statFlags & NSSS_EP_PWORD_PRESENT_F)
printf("\tEP PWORD PRESENT...\n");
if(statFlags & NSSS_EP_MASTER_PWORD_PRESENT_F)
printf("\tMASTER PWORD PRESENT...\n");
if(statFlags & NSSS_MP_NOT_ALLOWED_F)
printf("\tMASTER PWORD NOT ALLOWED...\n");
if(statFlags & NSSS_HIDDEN_SECRET_F)
printf("\tHIDDEN SECRET IN SECRETSTORE...\n");
if(statFlags & NSSS_ADMIN_UNLOCKED_F)
printf("\tADMIN LAST UNLOCKED THE SECRETSTORE...\n");
}
}
class='cKeyword'>class='cKeyword'>#ifdef N_PLAT_NLM
extern int
NWCallsInit
(
nptr reserved1,
nptr reserved2
);
extern int
NWCallsTerm
(
nptr reserved
);
void UnloadLDAPSSCLMain(int sigNbr);
static int ssLSSCLThreadGroupID = 0;
unsigned int ssLSSCLModuleHandle = 0;
class='cKeyword'>#endif
int ss_GetLoginInfo
(
class='cKeyword'>char *targetDN,
SSS_CONTEXT_T *ctx
)
{
class='cKeyword'>char portStr[256];
int rc = NSSS_SUCCESS;
SS_LDAPBIND_INFO_T *ldapBindInfo = NULL;
ldapBindInfo = (SS_LDAPBIND_INFO_T *)ctx->bindInfo;
printf("\n Enter the following sequence to login to an LDAP server:");
printf("\n (For default values press ENTER at the prompt)");
printf("\n <LDAP Host Name> <Port No.> <Login DN> <Target DN> <Password> <Root Cert File Name>");
printf("\n Example:\n lshtst nsd19.provo.novell.com 636 cn=janedoe,o=novell password\n\n");
printf("\nc or: ");
printf("\n Example:\n lshtst 151.155.160.85 636 cn=admin,o=novell cn=johndoe,o=novell password myKey.der\n\n");
printf("Enter the LDAP Server DNS Name/IP Address: ");
gets(ldapBindInfo->lHostName);
if(strlen(ldapBindInfo->lHostName) == 0)
{
printf("Server Name required!!\n");
return(NSSS_E_INVALID_PARAM);
}
printf("LDAP Host = [%s]\n", ldapBindInfo->lHostName);
printf( "\n" );
memset(portStr, 0, 256);
printf("Enter LDAP Port Number (636-default): ");
gets(portStr);
if(strlen(portStr))
{
ldapBindInfo->portNum = atoi(portStr);
}
else
{
ldapBindInfo->portNum = 636L;
}
printf("LDAP Port = [%d]\n", ldapBindInfo->portNum);
printf( "\n" );
printf("Enter Login DN in LDAP Format (\"cn=johndoe, o=novell\"): ");
gets(ctx->callerDN.id);
if((ctx->callerDN.len = strlen(ctx->callerDN.id)) == 0)
{
printf("Login DN required!!\n");
return(NSSS_E_INVALID_PARAM);
}
ctx->callerDN.len++;
printf("Login DN = [%s]\n", ctx->callerDN.id);
printf( "\n" );
memset(targetDN, 0, 256);
printf("Enter LDAP Target DN (\"cn=janedoe, o=novell\"): ");
gets(targetDN);
if(strlen(targetDN) == 0)
{
strcpy(targetDN, ctx->callerDN.id);
}
printf("Target DN = [%s]\n", targetDN);
printf( "\n" );
printf("Enter the LDAP Login Password: ");
gets(ldapBindInfo->loginPword);
printf("Enter Root Certificate File Name: (<Enter for Auto-retrieval>)");
gets(ldapBindInfo->trustedRootCert);
printf( "\n" );
if(strlen(ldapBindInfo->trustedRootCert))
{
printf("Trusted Root Certificate = [%s]\n", ldapBindInfo->trustedRootCert);
}
return(NSSS_SUCCESS);
}
void main
(
int argc,
class='cKeyword'>char **argv
)
{
SS_LDAPBIND_INFO_T lbInfo = {0};
SSS_CONTEXT_T ctx = {0};
SSS_GSINFOEXT_T gsInfo = {0};
SSS_READEXT_T rInfo = {0};
SS_SECRET_T secretIDList = {0};
class='cKeyword'>char srchStr[] = "*";
SS_OBJECT_DN_T targetObjDN = {0};
*nameStr;
int bAppTest = 0, bMultiCredTest = 0, bMultiEntryTest = 0, bUTF8Test;
class='cKeyword'>char *pSecret = NULL;
class='cKeyword'>char *tempSecretID;
class='cKeyword'>char multiCredApp[] = "SharedSecret Multiple CredSet Application Test";
class='cKeyword'>char multiEntryCredSet[] = "SharedSecret Multiple Entry CredSet Test";
unsigned class='cKeyword'>char UTF8Key[] = {0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x77, 0x6F, 0x72, 0x64, 00};
unsigned class='cKeyword'>char UTF8Value[] = {0xED, 0x98, 0x9C, 0xED, 0x98, 0xA4, 0xED, 0x95, 0xAB, 0xED, 0x9B, 0xA7, 0xED, 0x9D, 0x8F, 00};
class='cKeyword'>char UTF8TestID[] = "UFT8Test";
class='cKeyword'>char *keyEntries[5] =
{
"username01",
"username02",
"username03",
"username04",
"username05"
};
class='cKeyword'>char *valEntries[5] =
{
class='cKeyword'>class='cKeyword'>#ifdef LONG_VAL_TEST
"passwordpasswordpasswordpasswordpasswordpasswordpasswordpasswordpasswordpasswordpasswordpassword\
1111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000\
1111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000\
1111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000\
1111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000",
"usernameusernameusernameusernameusernameusernameusernameusernameusernameusernameusernameusername\
1111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000\
1111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000\
1111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000\
1111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000",
"usernameusernameusernameusernameusernameusernameusernameusernameusernameusernameusernameusername\
1111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000\
1111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000\
1111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000\
1111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000",
"usernameusernameusernameusernameusernameusernameusernameusernameusernameusernameusernameusername\
1111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000\
1111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000\
1111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000\
1111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000",
"usernameusernameusernameusernameusernameusernameusernameusernameusernameusernameusernameusername\
1111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000\
1111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000\
1111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000\
1111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000"
class='cKeyword'>#else
"password01",
"password02",
"password03",
"password04",
"password05"
class='cKeyword'>#endif
};
class='cKeyword'>char *mKeyEntries[5] =
{
"company",
"description",
"username",
"password",
"pin number"
};
class='cKeyword'>char *mValEntries[5] =
{
"Novell, Inc.",
"SharedSecret Test Utility",
"John Doe",
"novell",
"000000000"
};
class='cKeyword'>char *appNames[5] =
{
"\\SharedLDAPSecret:E:\\Novell\\ssshsTest.01CN=AppTest/O=novell",
"\\SharedLDAPSecret:E:\\Novell\\ssshsTest.02CN=AppTest/O=novell",
"\\SharedLDAPSecret:E:\\Novell\\ssshsTest.03CN=AppTest/O=novell",
"\\SharedLDAPSecret:E:\\Novell\\ssshsTest.04CN=AppTest/O=novell",
"\\SharedLDAPSecret:E:\\Novell\\ssshsTest.05CN=AppTest/O=novell"
};
class='cKeyword'>char *credSetNames[5] =
{
"\\SharedLDAPSecret:E:\\Novell\\ssshsTest.01CN=CredSet/O=novell",
"\\SharedLDAPSecret:E:\\Novell\\ssshsTest.02CN=CredSet/O=novell",
"\\SharedLDAPSecret:E:\\Novell\\ssshsTest.03CN=CredSet/O=novell",
"\\SharedLDAPSecret:E:\\Novell\\ssshsTest.04CN=CredSet/O=novell",
"\\SharedLDAPSecret:E:\\Novell\\ssshsTest.05CN=CredSet/O=novell"
};
int rcode = NSSS_SUCCESS;
int exCount = 1, i, j, remLock = 0, unlock = 0,
master = 0, rCount = 1;
long opCount, bufSize = NSSS_MAX_SECRET_BUF_LEN;
unsigned long startTime, endTime, pFlag = 0L, count = 0;
int c;
SS_SECRET_ID_T secretID = {0};
void *handle;
SS_SH_SECRET_ID_T shSecret;
class='cKeyword'>char *key = NULL;
class='cKeyword'>char *value = NULL;
int kLen = 0;
int vLen = 0;
if(!(key = malloc(NSSS_MAX_SECRET_ID_LEN)))
{
exit(-1);
}
if(!(value = malloc(NSSS_MAX_SECRET_BUF_LEN)))
{
free(key);
exit(-1);
}
if(!(pSecret = malloc(NSSS_MAX_SECRET_BUF_LEN)))
{
free(key);
free(value);
exit(-1);
}
if(!(tempSecretID = malloc(NSSS_MAX_SECRET_BUF_LEN)))
{
free(key);
free(value);
free(pSecret);
exit(-1);
}
memset(key, 0, NSSS_MAX_SECRET_ID_LEN);
memset(value, 0, NSSS_MAX_SECRET_BUF_LEN);
memset(pSecret, 0, NSSS_MAX_SECRET_BUF_LEN);
memset(tempSecretID, 0, NSSS_MAX_SECRET_BUF_LEN);
printf("\nSharedSecret LDAP Test Program version %s ...\n\n", GSS_BLD_STR);
class='cKeyword'>class='cKeyword'>#ifdef N_PLAT_NLM
AtUnload(UnloadLDAPSSCLMain);
atexit(UnloadLDAPSSCLMain);
ssLSSCLModuleHandle = GetNLMHandle();
class='cKeyword'>class='cKeyword'>#ifdef FAST_ALLOC
if(ss_InitSSAllocTag())
{
goto ERROR_1;
}
class='cKeyword'>#endif
ssLSSCLThreadGroupID = GetThreadGroupID();
if((rcode = NWCallsInit(NULL, NULL)))
{
printf("CLIB Initialization Failed [%d]!!\n", rcode);
goto ERROR_1;
}
signal(SIGTERM, UnloadLDAPSSCLMain);
class='cKeyword'>#endif
printf("\nSecretStore NDK SharedSecret Test Program version %s ...\n\n", GSS_BLD_STR);
'b':
class='cKeyword'>case 'B':
/* Big secret buffer */
bufSize = NSSS_MAX_SECRET_BUF_LEN;
class='cKeyword'>break;
class='cKeyword'>case 'm':
class='cKeyword'>case 'M':
bufSize = NSSS_MID_SECRET_BUF_LEN;
class='cKeyword'>break;
class='cKeyword'>case 's':
class='cKeyword'>case 'S':
aFlag = 0;
printf("Silent Running Mode Active...\n");
class='cKeyword'>break;
class='cKeyword'>case 'c':
class='cKeyword'>case 'C':
exCount = atoi(optArg);
class='cKeyword'>break;
default:
'h':
'H':
printf("\nUsage: lshtst [/m]|[/b][/s /c=[count] /r=[rcount] | /? | /h ]\n");
printf("\tOptions: [ /m | /M ] for 4k Secret Buffer Size.\n");
printf("\tOptions: [ /b | /B ] for 59k Secret Buffer Size.\n");
printf("\tOptions: [ /s | /S ] for Silent Running.\n");
printf("\t\tSilent sub-Option [ /c | /C ] for number of times to run.\n");
printf("\tExample: lshtst /s /c=1000\n");
printf("\tOption: [ /h | /H | /? ] for Help.\n");
printf("\tNo command line options will activate interactive running.\n\n");
printf("\tFor options \"/\" and \"-\" are interchangeable.\n\n");
exit(0);
}
}
}
else
{
printf("Full Interactive Running Mode Active...\n");
}
printf("[%d]k secret size buffer chosen...\n", bufSize);
printf("Execution Count Set to: [%d]\n", exCount);
printf("Read Count Set to: [%d]\n", rCount);
ctx.bindInfo = &lbInfo;
targetObjDN.len = strlen(targetObjDN.id)+1;
printf("Initializing...\n");
/* allocate and initialize the enumSecIDBuf for ENUM */
if(!(secretIDList.data = (class='cKeyword'>char *)malloc(NSSS_MAX_IDLIST_BUF_LEN)))
{
printf("Error: secretIDList MALLOC FAILED!\n");
goto ERROR_1;
}
secretIDList.len = NSSS_MAX_IDLIST_BUF_LEN;
startTime = time(NULL);
printf("Done...\n");
Pause();
if(ss_GetLoginInfo(targetObjDN.id, &ctx))
{
printf("Error: Getting LDAP Login Info FAILED!\n");
goto ERROR_1;
}
targetObjDN.len = strlen(targetObjDN.id)+1;
class='cKeyword'>class='cKeyword'>#ifndef LONG_VAL_TEST
do
{
class='cKeyword'>#endif
if(pFlag & NSSS_DESTROY_CONTEXT_F)
{
pFlag &= ~NSSS_DESTROY_CONTEXT_F;
pFlag |= NSSS_GET_CONTEXT_F;
ctx.flags = NSSS_LDAP_CTX_F;
}
else
{
ctx.flags |= (NSSS_LDAP_CTX_F | NSSS_BINDLDAP_F);
}
memset(&gsInfo, 0, sizeof(SSS_GSINFOEXT_T));
if(rcode = NSSSGetServiceInformation(&ctx, &targetObjDN, (pFlag | NSSS_GET_CONTEXT_F), &gsInfo, NULL))
{
ndef LONG_VAL_TEST
if(aFlag)
{
printf("\nDo you want to CREATE a UTF8 Credential Secret(y/n)? ");
c = getch();
putchar(c);
printf("\n\n");
}
else
{
c = 'y';
}
if(c == 'y' || c == 'Y')
{
bUTF8Test = 1;
shSecret.type = SS_CREDENTIAL_TYPE_F;
strcpy(shSecret.pName, UTF8TestID);
shSecret.len = strlen(shSecret.pName)+1;
handle = NSSSCreateSHSHandle();
if(!handle)
{
printf("\n\nFAILED to successfully create a valid handle");
Pause();
goto ERROR_1;
}
printf("\nCalling NSSSReadSharedSecret\n");
rcode = NSSSReadSharedSecret(handle, &shSecret, &ctx, &targetObjDN, pFlag, NULL, &rInfo, NULL);
if(rcode != NSSS_SUCCESS)
{
if((rcode != NSSS_E_STORE_NOT_FOUND) && (rcode != NSSS_E_INVALID_SECRET_ID))
{
printf("\nNSSSReadSharedSecret returned [%d] in [%s]\n\n", rcode, UTF8TestID);
Pause();
goto ERROR_1;
}
}
for(i = 1; i < 2; i++)
{
strcpy(key, UTF8Key);
strcpy(value, UTF8Value);
printf("\nCalling NSSSAddSHSEntry for [%s]\n", UTF8TestID);
if(rcode = NSSSAddSHSEntry(handle, key, value, ctx.flags))
{
printf("\nNSSSAddSHSEntry returned [%d] when adding [%s]/[%s]\nto [%s]\n\n", rcode, key, value, "UTF8 Test");
Pause();
}
else
{
printf("\nAdded [%s]=[%s]\n", key, value);
}
}
printf("\nCalling NSSSWriteSharedSecret\n");
if(rcode = NSSSWriteSharedSecret(handle, &shSecret, &ctx, &targetObjDN, pFlag, NULL, NULL))
{
printf("\n\nNSSSWriteSharedSecret returned [%d] when storing data in\n[%s]\n\n", rcode, UTF8TestID);
Pause();
goto ERROR_1;
}
else
{
printf("\nNSSSWriteSharedSecret SUCCEEDED\n");
}
memset(key, 0, NSSS_MAX_SECRET_ID_LEN);
memset(value, 0, NSSS_MAX_SECRET_BUF_LEN);
NSSSDestroySHSHandle(handle);
}
memset(key, 0, NSSS_MAX_SECRET_ID_LEN);
memset(value, 0, NSSS_MAX_SECRET_BUF_LEN);
if(bUTF8Test)
{
if(aFlag)
{
printf("\nDo you want to READ the UTF8 Credential Secret(y/n)? ");
c = getch();
putchar(c);
printf("\n\n");
}
else
{
c = 'y';
}
if(c == 'y' || c == 'Y')
{
shSecret.type = SS_CREDENTIAL_TYPE_F;
strcpy(shSecret.pName, UTF8TestID);
shSecret.len = strlen(shSecret.pName)+1;
handle = NSSSCreateSHSHandle();
if(!handle)
{
printf("\n\nFAILED to successfully create a valid handle");
Pause();
goto ERROR_1;
}
printf("\nCalling NSSSReadSharedSecret\n");
rcode = NSSSReadSharedSecret(handle, &shSecret, &ctx, &targetObjDN, pFlag, NULL, &rInfo, NULL);
if(rcode != NSSS_SUCCESS)
{
printf("\nNSSSReadSharedSecret returned [%d] in [%s]\n\n", rcode, UTF8TestID);
Pause();
goto ERROR_1;
}
printf("\nCalling NSSSGetNextEntry\n");
if(!(rcode = NSSSGetNextSHSEntry(1, handle, &kLen, key, &vLen, value, ctx.flags)))
{
while(rcode == NSSS_SUCCESS)
{
if(0 == strlen(key))
{
class='cKeyword'>break;
}
strcpy(pSecret, key);
strcat(pSecret, "=");
strcat(pSecret, value);
printf("\nNSSSGetNextSHSEntry returned [%s]:[%s]\n", key, value);
memset(key, 0, NSSS_MAX_SECRET_ID_LEN);
memset(value, 0, NSSS_MAX_SECRET_BUF_LEN);
memset(pSecret, 0, NSSS_MAX_SECRET_BUF_LEN);
rcode = NSSSGetNextSHSEntry(0, handle, &kLen, key, &vLen, value, ctx.flags);
}
}
NSSSDestroySHSHandle(handle);
}
}
class='cKeyword'>#endif
memset(key, 0, NSSS_MAX_SECRET_ID_LEN);
memset(value, 0, NSSS_MAX_SECRET_BUF_LEN);
if(aFlag)
{
printf("\nDo you want to CREATE Application SharedSecrets with\nan associated default Credential Set(y/n)? ");
c = getch();
putchar(c);
printf("\n\n");
}
else
{
c = 'y';
}
if(c == 'y' || c == 'Y')
{
bAppTest = 1;
for(i = 1; i < 6; i++)
{
shSecret.type = SS_APPLICATION_TYPE_F;
strcpy(shSecret.pName, appNames[i-1]);
shSecret.len = strlen(shSecret.pName)+1;
handle = NSSSCreateSHSHandle();
if(!handle)
{
printf("\n\nFAILED to successfully create a valid handle");
Pause();
goto ERROR_1;
}
printf("\nCalling NSSSReadSharedSecret\n");
rcode = NSSSReadSharedSecret(handle, &shSecret, &ctx, &targetObjDN, pFlag, NULL, &rInfo, NULL);
if(rcode != NSSS_SUCCESS)
{
if((rcode != NSSS_E_STORE_NOT_FOUND) && (rcode != NSSS_E_INVALID_SECRET_ID))
{
printf("\nNSSSReadSharedSecret returned [%d] when reading [%s]\n\n", rcode, appNames[i-1]);
Pause();
goto ERROR_1;
}
}
strcpy(key, "SS_CredSet");
strcpy(value, credSetNames[i-1]);
printf("\nCalling NSSSAddSHSEntry\n");
if(rcode = NSSSAddSHSEntry(handle, key, value, ctx.flags))
{
printf("\n\nNSSSAddSHSEntry returned [%d] when adding\n[%s] and [%s]\n\n", rcode, key, value);
Pause();
}
else
{
printf("\nAdded [%s]:[%s]\n", key, value);
}
printf("\nCalling NSSSWriteSharedSecret\n");
if(rcode = NSSSWriteSharedSecret(handle, &shSecret, &ctx, &targetObjDN, pFlag, NULL, NULL))
{
printf("\nNSSSWriteSharedSecret returned [%d] when storing [%s]:[%s]\nto [%s]\n\n", rcode, key, value, appNames[i-1]);
Pause();
goto ERROR_1;
}
else
{
printf("\nNSSSWriteSharedSecret SUCCEEDED\n");
}
NSSSDestroySHSHandle(handle);
memset(key, 0, NSSS_MAX_SECRET_ID_LEN);
memset(value, 0, NSSS_MAX_SECRET_BUF_LEN);
handle = NSSSCreateSHSHandle();
if(!handle)
{
printf("\n\nFAILED to successfully create a valid handle");
Pause();
goto ERROR_1;
}
shSecret.type = SS_CREDENTIAL_TYPE_F;
strcpy(shSecret.pName, credSetNames[i-1]);
shSecret.len = strlen(shSecret.pName)+1;
printf("\nCalling NSSSReadSharedSecret\n");
rcode = NSSSReadSharedSecret(handle, &shSecret, &ctx, &targetObjDN, pFlag, NULL, &rInfo, NULL);
if(rcode != NSSS_SUCCESS)
{
if((rcode != NSSS_E_STORE_NOT_FOUND) && (rcode != NSSS_E_INVALID_SECRET_ID))
{
printf("\nNSSSReadSharedSecret returned [%d] when reading [%s]\n\n", rcode, credSetNames[i-1]);
Pause();
goto ERROR_1;
}
}
strcpy(key, keyEntries[i-1]);
strcpy(value, valEntries[i-1]);
printf("\nCalling NSSSAddSHSEntry\n");
if(rcode = NSSSAddSHSEntry(handle, key, value, ctx.flags))
{
printf("\nNSSSAddSHSEntry returned [%d] when adding \n[%s]:[%s]\nto [%s]\n\n", rcode, key, value, credSetNames[i-1]);
Pause();
}
else
{
printf("\nAdded [%s]=[%s]\n", key, value);
}
printf("\nCalling NSSSWriteSharedSecret\n");
if(rcode = NSSSWriteSharedSecret(handle, &shSecret, &ctx, &targetObjDN, pFlag, NULL, NULL))
{
printf("\n\nNSSSWriteSharedSecret returned [%d] when storing\n[%s]:[%s]\nto [%s]\n\n", rcode, key, value, credSetNames[i-1]);
Pause();
goto ERROR_1;
}
else
{
printf("\nNSSSWriteSharedSecret SUCCEEDED\n");
}
NSSSDestroySHSHandle(handle);
}
}
memset(key, 0, NSSS_MAX_SECRET_ID_LEN);
memset(value, 0, NSSS_MAX_SECRET_BUF_LEN);
if(bAppTest)
{
if(aFlag)
{
printf("\nDo you want to READ the Application SharedSecrets(y/n)? ");
c = getch();
putchar(c);
printf("\n\n");
}
else
{
c = 'y';
}
if(c == 'y' || c == 'Y')
{
shSecret.type = SS_APPLICATION_TYPE_F;
for(i = 1; i < 6; i++)
{
memset(shSecret.pName, 0, NSSS_MAX_SECRET_ID_LEN);
strcpy(shSecret.pName, appNames[i-1]);
shSecret.len = strlen(shSecret.pName)+1;
handle = NSSSCreateSHSHandle();
if(!handle)
{
printf("\n\nFAILED to successfully create a valid handle");
Pause();
goto ERROR_1;
}
printf("\nCalling NSSSReadSharedSecret\n");
rcode = NSSSReadSharedSecret(handle, &shSecret, &ctx, &targetObjDN, pFlag, NULL, &rInfo, NULL);
if(rcode != NSSS_SUCCESS)
{
printf("\nNSSSReadSharedSecret returned [%d] when reading [%s]\n\n", rcode, appNames[i-1]);
Pause();
goto ERROR_1;
}
printf("\nCalling NSSSGetNextSHSEntry\n");
if(!(rcode = NSSSGetNextSHSEntry(1, handle, &kLen, key, &vLen, value, ctx.flags)))
{
while(rcode == NSSS_SUCCESS)
{
if(0 == strlen(key))
{
class='cKeyword'>break;
}
strcpy(pSecret, key);
strcat(pSecret, ":");
strcat(pSecret, value);
printf("\nNSSSGetNextSHSEntry returned [%s]:[%s]\n", key, value);
memset(key, 0, NSSS_MAX_SECRET_ID_LEN);
memset(value, 0, NSSS_MAX_SECRET_BUF_LEN);
memset(pSecret, 0, NSSS_MAX_SECRET_BUF_LEN);
rcode = NSSSGetNextSHSEntry(0, handle, &kLen, key, &vLen, value, ctx.flags);
}
}
NSSSDestroySHSHandle(handle);
memset(key, 0, NSSS_MAX_SECRET_ID_LEN);
memset(value, 0, NSSS_MAX_SECRET_BUF_LEN);
}
}
}
memset(key, 0, NSSS_MAX_SECRET_ID_LEN);
memset(value, 0, NSSS_MAX_SECRET_BUF_LEN);
if(aFlag)
{
printf("\nDo you want to CREATE multiple Credential Secrets\nfor a single Application Secret(y/n)? ");
c = getch();
putchar(c);
printf("\n\n");
}
else
{
c = 'y';
}
if(c == 'y' || c == 'Y')
{
bMultiCredTest = 1;
shSecret.type = SS_APPLICATION_TYPE_F;
strcpy(shSecret.pName, multiCredApp);
shSecret.len = strlen(shSecret.pName)+1;
handle = NSSSCreateSHSHandle();
if(!handle)
{
printf("\n\nFAILED to successfully create a valid handle");
Pause();
goto ERROR_1;
}
printf("\nCalling NSSSReadSharedSecret\n");
rcode = NSSSReadSharedSecret(handle, &shSecret, &ctx, &targetObjDN, pFlag, NULL, &rInfo, NULL);
if(rcode != NSSS_SUCCESS)
{
if((rcode != NSSS_E_STORE_NOT_FOUND) && (rcode != NSSS_E_INVALID_SECRET_ID))
{
printf("\nNSSSReadSharedSecret returned [%d] when reading [%s]\n\n", rcode, multiCredApp);
Pause();
goto ERROR_1;
}
}
for(i = 1; i < 6; i++)
{
strcpy(key, "SS_CredSet");
strcpy(value, credSetNames[i-1]);
printf("\nCalling NSSSAddSHSEntry for [%s]\n", multiCredApp);
if(rcode = NSSSAddSHSEntry(handle, key, value, ctx.flags))
{
printf("\nNSSSAddSHSEntry returned [%d] when adding [%s]/[%s]\nto [%s]\n\n", rcode, key, value, multiCredApp);
Pause();
}
else
{
printf("\nAdded [%s]:[%s]\n", key, value);
}
}
printf("\nCalling NSSSWriteSharedSecret\n");
if(rcode = NSSSWriteSharedSecret(handle, &shSecret, &ctx, &targetObjDN, pFlag, NULL, NULL))
{
printf("\n\nNSSSWriteSharedSecret returned [%d] when storing data in\n[%s]\n\n", rcode, multiCredApp);
Pause();
goto ERROR_1;
}
else
{
printf("\nNSSSWriteSharedSecret SUCCEEDED\n");
}
memset(key, 0, NSSS_MAX_SECRET_ID_LEN);
memset(value, 0, NSSS_MAX_SECRET_BUF_LEN);
NSSSDestroySHSHandle(handle);
}
memset(key, 0, NSSS_MAX_SECRET_ID_LEN);
memset(value, 0, NSSS_MAX_SECRET_BUF_LEN);
if(bMultiCredTest)
{
if(aFlag)
{
printf("\nDo you want to READ the multiple Credential Secrets\nfor a single Application Secret(y/n)? ");
c = getch();
putchar(c);
printf("\n\n");
}
else
{
c = 'y';
}
if(c == 'y' || c == 'Y')
{
shSecret.type = SS_APPLICATION_TYPE_F;
strcpy(shSecret.pName, multiCredApp);
shSecret.len = strlen(shSecret.pName)+1;
handle = NSSSCreateSHSHandle();
if(!handle)
{
printf("\n\nFAILED to successfully create a valid handle");
Pause();
goto ERROR_1;
}
printf("\nCalling NSSSReadSharedSecret\n");
rcode = NSSSReadSharedSecret(handle, &shSecret, &ctx, &targetObjDN, pFlag, NULL, &rInfo, NULL);
if(rcode != NSSS_SUCCESS)
{
printf("\nNSSSReadSharedSecret returned [%d] when reading [%s]\n\n", rcode, multiCredApp);
Pause();
goto ERROR_1;
}
printf("\nCalling NSSSGetNextEntry\n");
if(!(rcode = NSSSGetNextSHSEntry(1, handle, &kLen, key, &vLen, value, ctx.flags)))
{
while(rcode == NSSS_SUCCESS)
{
if(0 == strlen(key))
{
class='cKeyword'>break;
}
strcpy(pSecret, key);
strcat(pSecret, ":");
strcat(pSecret, value);
printf("\nNSSSGetNextSHSEntry returned [%s]:[%s]\n", key, value);
memset(key, 0, NSSS_MAX_SECRET_ID_LEN);
memset(value, 0, NSSS_MAX_SECRET_BUF_LEN);
memset(pSecret, 0, NSSS_MAX_SECRET_BUF_LEN);
rcode = NSSSGetNextSHSEntry(0, handle, &kLen, key, &vLen, value, ctx.flags);
}
}
NSSSDestroySHSHandle(handle);
}
}
memset(key, 0, NSSS_MAX_SECRET_ID_LEN);
memset(value, 0, NSSS_MAX_SECRET_BUF_LEN);
if(aFlag)
{
printf("\nDo you want to CREATE multiple entries for a single Credential Set(y/n)? ");
c = getch();
putchar(c);
printf("\n\n");
}
else
{
c = 'y';
}
if(c == 'y' || c == 'Y')
{
bMultiEntryTest = 1;
shSecret.type = SS_CREDENTIAL_TYPE_F;
strcpy(shSecret.pName, multiEntryCredSet);
shSecret.len = strlen(shSecret.pName)+1;
handle = NSSSCreateSHSHandle();
if(!handle)
{
goto ERROR_1;
}
printf("\nCalling NSSSReadSharedSecret\n");
rcode = NSSSReadSharedSecret(handle, &shSecret, &ctx, &targetObjDN, pFlag, NULL, &rInfo, NULL);
if(rcode != NSSS_SUCCESS)
{
if((rcode != NSSS_E_STORE_NOT_FOUND) && (rcode != NSSS_E_INVALID_SECRET_ID))
{
printf("\nNSSSReadSharedSecret returned [%d] when reading [%s]\n\n", rcode, multiEntryCredSet);
Pause();
goto ERROR_1;
}
}
for(i = 1; i < 6; i++)
{
strcpy(key, mKeyEntries[i-1]);
strcpy(value, mValEntries[i-1]);
printf("\nCalling NSSSAddSHSEntry\n");
if(!(rcode = NSSSAddSHSEntry(handle, key, value, ctx.flags)))
{
printf("\nAdded [%s]=[%s]\n", key, value);
}
else
{
printf("\nNSSSAddSHSEntry returned [%d] when adding [%s]=[%s]\n\n", rcode, key, value);
Pause();
}
}
printf("\nCalling NSSSWriteSharedSecret\n");
if(rcode = NSSSWriteSharedSecret(handle, &shSecret, &ctx, &targetObjDN, pFlag, NULL, NULL))
{
printf("\nNSSSWriteSharedSecret returned [%d] when storing\n[%s]:[%s]\nto [%s]\n\n", rcode, key, value, multiEntryCredSet);
Pause();
goto ERROR_1;
}
else
{
printf("\nNSSSWriteSharedSecret SUCCEEDED\n");
}
NSSSDestroySHSHandle(handle);
}
memset(key, 0, NSSS_MAX_SECRET_ID_LEN);
memset(value, 0, NSSS_MAX_SECRET_BUF_LEN);
if(bMultiEntryTest)
{
if(aFlag)
{
printf("\nDo you want to READ the multiple entries in the single Credential Set(y/n)? ");
c = getch();
putchar(c);
printf("\n\n");
}
else
{
c = 'y';
}
if(c == 'y' || c == 'Y')
{
shSecret.type = SS_CREDENTIAL_TYPE_F;
strcpy(shSecret.pName, multiEntryCredSet);
shSecret.len = strlen(shSecret.pName)+1;
handle = NSSSCreateSHSHandle();
if(!handle)
{
goto ERROR_1;
}
printf("\nCalling NSSSReadSharedSecret\n");
rcode = NSSSReadSharedSecret(handle, &shSecret, &ctx, &targetObjDN, pFlag, NULL, &rInfo, NULL);
if(rcode != NSSS_SUCCESS)
{
printf("\nNSSSReadSharedSecret returned [%d] when reading [%s]\n\n", rcode, multiEntryCredSet);
Pause();
goto ERROR_1;
}
printf("\nCalling NSSSGetNextSHSEntry\n");
if(!(rcode = NSSSGetNextSHSEntry(1, handle, &kLen, key, &vLen, value, ctx.flags)))
{
while(rcode == NSSS_SUCCESS)
{
if(0 == strlen(key))
{
class='cKeyword'>break;
}
strcpy(pSecret, key);
strcat(pSecret, "=");
strcat(pSecret, value);
printf("\nNSSSGetNextSHSEntry returned [%s]=[%s]\n\n", key, value);
memset(key, 0, NSSS_MAX_SECRET_ID_LEN);
memset(value, 0, NSSS_MAX_SECRET_BUF_LEN);
memset(pSecret, 0, NSSS_MAX_SECRET_BUF_LEN);
rcode = NSSSGetNextSHSEntry(0, handle, &kLen, key, &vLen, value, ctx.flags);
}
}
NSSSDestroySHSHandle(handle);
}
}
memset(key, 0, NSSS_MAX_SECRET_ID_LEN);
memset(value, 0, NSSS_MAX_SECRET_BUF_LEN);
if(bMultiEntryTest)
{
if(aFlag)
{
printf("\nDo you want to REMOVE the multiple entries from the single Credential Set(y/n)? ");
c = getch();
putchar(c);
printf("\n\n");
}
else
{
c = 'y';
}
if(c == 'y' || c == 'Y')
{
shSecret.type = SS_CREDENTIAL_TYPE_F;
strcpy(shSecret.pName, multiEntryCredSet);
shSecret.len = strlen(shSecret.pName)+1;
handle = NSSSCreateSHSHandle();
if(!handle)
{
goto ERROR_1;
}
printf("\nCalling NSSSReadSharedSecret\n");
rcode = NSSSReadSharedSecret(handle, &shSecret, &ctx, &targetObjDN, pFlag, NULL, &rInfo, NULL);
if(rcode != NSSS_SUCCESS)
{
if((rcode != NSSS_E_STORE_NOT_FOUND) && (rcode != NSSS_E_INVALID_SECRET_ID))
{
printf("\nNSSSReadSharedSecret returned [%d] when reading [%s]\n\n", rcode, multiEntryCredSet);
Pause();
goto ERROR_1;
}
}
for(i = 1; i < 6; i++)
{
strcpy(key, mKeyEntries[i-1]);
strcpy(value, mValEntries[i-1]);
strcpy(shSecret.pName, multiEntryCredSet);
shSecret.len = strlen(shSecret.pName)+1;
kLen = strlen(key)+1;
vLen = strlen(value)+1;
printf("\nCalling NSSSRemoveSHSEntry\n");
if(!(rcode = NSSSRemoveSHSEntry(handle, key, value, ctx.flags)))
{
printf("Removed [%s]=[%s]\n", key, value);
}
else
{
printf("FAILED to remove [%s]:[%s]\nfrom [%s]\n\n", key, value, multiEntryCredSet);
}
memset(key, 0, NSSS_MAX_SECRET_ID_LEN);
memset(value, 0, NSSS_MAX_SECRET_BUF_LEN);
}
printf("\nCalling NSSSWriteSharedSecret\n");
if(rcode = NSSSWriteSharedSecret(handle, &shSecret, &ctx, &targetObjDN, pFlag, NULL, NULL))
{
printf("\nNSSSWriteSharedSecret returned [%d] when storing data in\n[%s]\n\n", rcode, multiEntryCredSet);
Pause();
goto ERROR_1;
}
else
{
printf("\nNSSSWriteSharedSecret SUCCEEDED\n");
}
rcode = NSSSDestroySHSHandle(handle);
}
}
memset(key, 0, NSSS_MAX_SECRET_ID_LEN);
memset(value, 0, NSSS_MAX_SECRET_BUF_LEN);
if(bMultiCredTest)
{
if(aFlag)
{
printf("\nDo you want to REMOVE the multiple Credential Sets\nfrom the single Application Test Secret(y/n)? ");
c = getch();
putchar(c);
printf("\n\n");
}
else
{
c = 'y';
}
if(c == 'y' || c == 'Y')
{
strcpy(shSecret.pName, multiCredApp);
shSecret.len = strlen(shSecret.pName)+1;
shSecret.type = SS_APPLICATION_TYPE_F;
strcpy(key, "SS_CredSet");
handle = NSSSCreateSHSHandle();
if(!handle)
{
goto ERROR_1;
}
printf("\nCalling NSSSReadSharedSecret\n");
rcode = NSSSReadSharedSecret(handle, &shSecret, &ctx, &targetObjDN, pFlag, NULL, &rInfo, NULL);
if(rcode != NSSS_SUCCESS)
{
if((rcode != NSSS_E_STORE_NOT_FOUND) && (rcode != NSSS_E_INVALID_SECRET_ID))
{
printf("\nNSSSReadSharedSecret returned [%d] when reading [%s]\n\n", rcode, multiCredApp);
Pause();
goto ERROR_1;
}
}
for(i = 1; i < 6; i++)
{
strcpy(value, credSetNames[i-1]);
printf("\nCalling NSSSRemoveSHSEntry\n");
kLen = strlen(key)+1;
vLen = strlen(value)+1;
if(!(rcode = NSSSRemoveSHSEntry(handle, key, value, ctx.flags)))
{
printf("\nRemoved [%s]:[%s]\n", key, value);
}
else
{
printf("\nNSSSRemoveSHSEntry returned [%d] when removing [%s]:[%s] from [%s]\n\n", rcode, key, value, credSetNames[i-1]);
}
}
memset(key, 0, NSSS_MAX_SECRET_ID_LEN);
memset(value, 0, NSSS_MAX_SECRET_BUF_LEN);
printf("\nCalling NSSSWriteSharedSecret\n");
if(rcode = NSSSWriteSharedSecret(handle, &shSecret, &ctx, &targetObjDN, pFlag, NULL, NULL))
{
printf("\nNSSSWriteSharedSecret returned [%d] when storing data in\n[%s]\n\n", rcode, multiCredApp);
Pause();
goto ERROR_1;
}
else
{
printf("\nNSSSWriteSharedSecret SUCCEEDED\n");
}
rcode = NSSSDestroySHSHandle(handle);
}
}
memset(key, 0, NSSS_MAX_SECRET_ID_LEN);
memset(value, 0, NSSS_MAX_SECRET_BUF_LEN);
if(bMultiCredTest)
{
if(aFlag)
{
printf("\nDo you want to REMOVE the Credential Set Test Secrets(y/n)?\n");
c = getch();
putchar(c);
printf("\n\n");
}
else
{
c = 'y';
}
if(c == 'y' || c == 'Y')
{
for(i = 1; i < 6; i++)
{
strcpy(shSecret.pName, credSetNames[i-1]);
shSecret.type = SS_CREDENTIAL_TYPE_F;
if(rcode = NSSSRemoveSharedSecret(&shSecret, &ctx, &targetObjDN, pFlag, NULL))
if(rcode = NSSSRemoveSecret(&ctx, &targetObjDN, pFlag, &secretID, NULL))
{
printf("NSSSRemoveSharedSecret returned [%d] when removing [%s]\n\n", rcode, shSecret.pName);
printf("NSSSRemoveSecret returned [%d] when removing [%s]\n\n", rcode, secretID.id);
Pause();
}
else
{
printf("\nRemoved [%s]\n", credSetNames[i-1]);
}
memset(shSecret.pName, 0, NSSS_MAX_SECRET_ID_LEN);
}
}
}
if(bAppTest)
{
if(aFlag)
{
printf("\nDo you want to REMOVE the Application Test Secrets(y/n)? ");
c = getch();
putchar(c);
printf("\n\n");
}
else
{
c = 'y';
}
if(c == 'y' || c == 'Y')
{
for(i = 1; i < 6; i++)
{
strcpy(shSecret.pName, appNames[i-1]);
shSecret.type = SS_APPLICATION_TYPE_F;
if(rcode = NSSSRemoveSharedSecret(&shSecret, &ctx, &targetObjDN, pFlag, NULL))
if(rcode = NSSSRemoveSecret(&ctx, &targetObjDN, pFlag, &secretID, NULL))
{
printf("NSSSRemoveSharedSecret returned [%d] when removing [%s]\n\n", rcode, shSecret.pName);
printf("NSSSRemoveSecret returned [%d] when removing [%s]\n\n", rcode, secretID.id);
Pause();
}
else
{
printf("\nRemoved [%s]\n", appNames[i-1]);
}
memset(shSecret.pName, 0, NSSS_MAX_SECRET_ID_LEN);
}
}
}
if(bAppTest)
{
if(aFlag)
{
printf("\nDo you want to REMOVE the multiple CredSet Application Test Secret(y/n)?\n");
c = getch();
putchar(c);
printf("\n\n");
}
else
{
c = 'y';
}
if(c == 'y' || c == 'Y')
{
strcpy(shSecret.pName, multiCredApp);
shSecret.type = SS_APPLICATION_TYPE_F;
if(rcode = NSSSRemoveSharedSecret(&shSecret, &ctx, &targetObjDN, pFlag, NULL))
if(rcode = NSSSRemoveSecret(&ctx, &targetObjDN, pFlag, &secretID, NULL))
{
printf("NSSSRemoveSharedSecret returned [%d] when removing [%s]\n\n", rcode, shSecret.pName);
printf("NSSSRemoveSecret returned [%d] when removing [%s]\n\n", rcode, secretID.id);
Pause();
}
else
{
printf("\nRemoved [%s]\n", multiCredApp);
}
memset(shSecret.pName, 0, NSSS_MAX_SECRET_ID_LEN);
}
}
if(bMultiEntryTest)
{
if(aFlag)
{
printf("\nDo you want to REMOVE the multiple entry Application Test Secret(y/n)?\n");
c = getch();
putchar(c);
printf("\n\n");
}
else
{
c = 'y';
}
if(c == 'y' || c == 'Y')
{
strcpy(shSecret.pName, multiEntryCredSet);
shSecret.type = SS_CREDENTIAL_TYPE_F;
if(rcode = NSSSRemoveSharedSecret(&shSecret, &ctx, &targetObjDN, pFlag, NULL))
if(rcode = NSSSRemoveSecret(&ctx, &targetObjDN, pFlag, &secretID, NULL))
{
printf("NSSSRemoveSharedSecret returned [%d] when removing [%s]\n\n", rcode, shSecret.pName);
printf("NSSSRemoveSecret returned [%d] when removing [%s]\n\n", rcode, secretID.id);
Pause();
}
else
{
printf("\nRemoved [%s]\n", multiEntryCredSet);
}
memset(shSecret.pName, 0, NSSS_MAX_SECRET_ID_LEN);
}
}
class='cKeyword'>class='cKeyword'>#ifndef LONG_VAL_TEST
if(bUTF8Test)
{
if(aFlag)
{
printf("\nDo you want to REMOVE the UTF8 Credential Test Secret(y/n)?\n");
c = getch();
putchar(c);
printf("\n\n");
}
else
{
c = 'y';
}
if(c == 'y' || c == 'Y')
{
strcpy(shSecret.pName, UTF8TestID);
shSecret.type = SS_CREDENTIAL_TYPE_F;
if(rcode = NSSSRemoveSharedSecret(&shSecret, &ctx, &targetObjDN, pFlag, NULL))
if(rcode = NSSSRemoveSecret(&ctx, &targetObjDN, pFlag, &secretID, NULL))
{
printf("NSSSRemoveSharedSecret returned [%d] when removing [%s]\n\n", rcode, shSecret.pName);
printf("NSSSRemoveSecret returned [%d] when removing [%s]\n\n", rcode, secretID.id);
Pause();
}
else
{
printf("\nRemoved [%s]\n", UTF8TestID);
}
memset(shSecret.pName, 0, NSSS_MAX_SECRET_ID_LEN);
}
}
opCount++;
printf("\n\n\n");
printf("NUMBER OF THE LOOPS = %d\n", j+1);
printf("NUMBER OF OPERATIONS COMPLETED = %d\n", opCount);
class='cKeyword'>#endif
} /* end for */
class='cKeyword'>class='cKeyword'>#ifndef LONG_VAL_TEST
}
while(c == 'y' || c == 'Y');
class='cKeyword'>#endif
endTime = time(NULL);
printf("ELAPSED TIME IN SECONDS = [%ld]\n\n", (endTime - startTime));
ERROR_1:
NSSSGetServiceInformation(&ctx, NULL, (pFlag | NSSS_DESTROY_CONTEXT_F), &gsInfo, NULL);
class='cKeyword'>class='cKeyword'>#ifdef N_PLAT_NLM
NWCallsTerm(NULL);
class='cKeyword'>#endif
if(secretIDList.data)
{
free(secretIDList.data);
}
if(key) free(key);
if(value) free(value);
if(pSecret) free(pSecret);
if(tempSecretID) free(tempSecretID);
Pause();
}
class='cKeyword'>class='cKeyword'>#ifdef N_PLAT_NLM
class='cKeyword'>class='cKeyword'>#ifdef FAST_ALLOC
static int ss_InitSSAllocTag(void)
{
if (!(*ssclAllocTag.tag = (void *)AllocateResourceTag((void *)ssLSSCLModuleHandle,
ssclAllocTag.name, ssclAllocTag.signature)))
{
return(NSSS_E_SYSTEM_FAILURE);
}
else
{
return(NSSS_SUCCESS);
}
}
void *ss_GetAllocTag(void)
{
return (ssLSSCLAllocRTag);
}
class='cKeyword'>#endif
int SSLDAPCLCanIUnload(void)
{
return (NSSS_SUCCESS);
}
void __WATCOM_Prelude(void){}
int ss_GetLDAPCLThreadGroupID(void)
{
return (ssLSSCLThreadGroupID);
}
unsigned int ss_GetLDAPCLModuleHandle(void)
{
return (ssLSSCLModuleHandle);
}
void UnloadLDAPSSCLMain(int sigNbr)
{
int tgid;
sigNbr = sigNbr;
tgid = SetThreadGroupID(ssLSSCLThreadGroupID);
NWCallsTerm(NULL);
SetThreadGroupID(tgid);
}
class='cKeyword'>#endif