Made some formatting changes, added some additional debug statements, and updated the project file to adjust for the new directory structure.
This commit is contained in:
parent
f145a46ffe
commit
f6106fcd67
@ -137,8 +137,7 @@ CreateAuthTokenCacheEntry(
|
||||
strncat(pKey, "@", keySize);
|
||||
strncat(pKey, pGroupOrHostName, keySize);
|
||||
|
||||
retStatus = miCASAWriteBinaryKey(
|
||||
g_hCASAContext,
|
||||
retStatus = miCASAWriteBinaryKey(g_hCASAContext,
|
||||
0,
|
||||
&sessionKeyChain,
|
||||
&sharedId,
|
||||
@ -243,8 +242,7 @@ CreateSessionTokenCacheEntry(
|
||||
pEntry->doesNotExpire = TRUE;
|
||||
}
|
||||
|
||||
retStatus = miCASAWriteBinaryKey(
|
||||
g_hCASAContext,
|
||||
retStatus = miCASAWriteBinaryKey(g_hCASAContext,
|
||||
0,
|
||||
&sessionKeyChain,
|
||||
&sharedId,
|
||||
@ -392,8 +390,7 @@ FindSessionTokenEntryInCache(
|
||||
valueLength = 0;
|
||||
bytesRequired = 0;
|
||||
|
||||
retStatus = miCASAReadBinaryKey(
|
||||
g_hCASAContext,
|
||||
retStatus = miCASAReadBinaryKey(g_hCASAContext,
|
||||
0,
|
||||
&sessionKeyChain,
|
||||
&sharedId,
|
||||
@ -415,8 +412,7 @@ FindSessionTokenEntryInCache(
|
||||
valueLength = bytesRequired;
|
||||
bytesRequired = 0;
|
||||
|
||||
retStatus = miCASAReadBinaryKey(
|
||||
g_hCASAContext,
|
||||
retStatus = miCASAReadBinaryKey(g_hCASAContext,
|
||||
0,
|
||||
&sessionKeyChain,
|
||||
&sharedId,
|
||||
@ -427,7 +423,6 @@ FindSessionTokenEntryInCache(
|
||||
NULL,
|
||||
&bytesRequired,
|
||||
NULL);
|
||||
|
||||
if (CASA_SUCCESS(retStatus))
|
||||
{
|
||||
if (pEntry->doesNotExpire == FALSE
|
||||
@ -486,7 +481,6 @@ FindAuthTokenEntryInCache(
|
||||
keySize = (uint32_t)strlen(pCacheKey) + (uint32_t)strlen(pGroupOrHostName) + 2;
|
||||
|
||||
pKey = malloc(keySize);
|
||||
|
||||
if (pKey)
|
||||
{
|
||||
strncpy(pKey, pCacheKey, keySize);
|
||||
@ -496,8 +490,7 @@ FindAuthTokenEntryInCache(
|
||||
valueLength = 0;
|
||||
bytesRequired = 0;
|
||||
|
||||
retStatus = miCASAReadBinaryKey(
|
||||
g_hCASAContext,
|
||||
retStatus = miCASAReadBinaryKey(g_hCASAContext,
|
||||
0,
|
||||
&sessionKeyChain,
|
||||
&sharedId,
|
||||
@ -519,8 +512,7 @@ FindAuthTokenEntryInCache(
|
||||
valueLength = bytesRequired;
|
||||
bytesRequired = 0;
|
||||
|
||||
retStatus = miCASAReadBinaryKey(
|
||||
g_hCASAContext,
|
||||
retStatus = miCASAReadBinaryKey(g_hCASAContext,
|
||||
0,
|
||||
&sessionKeyChain,
|
||||
&sharedId,
|
||||
@ -531,7 +523,6 @@ FindAuthTokenEntryInCache(
|
||||
NULL,
|
||||
&bytesRequired,
|
||||
NULL);
|
||||
|
||||
if (CASA_SUCCESS(retStatus))
|
||||
{
|
||||
if (pEntry->doesNotExpire == FALSE
|
||||
@ -586,15 +577,12 @@ InitializeAuthCache()
|
||||
ssId.version = NSSCS_VERSION_NUMBER;
|
||||
strcpy((char *)ssId.ssName, (char *)SSCS_DEFAULT_SECRETSTORE_ID);
|
||||
|
||||
g_hCASAContext = miCASAOpenSecretStoreCache(
|
||||
&ssId,
|
||||
g_hCASAContext = miCASAOpenSecretStoreCache(&ssId,
|
||||
0,
|
||||
NULL);
|
||||
|
||||
if (!g_hCASAContext)
|
||||
{
|
||||
retStatus = CasaStatusBuild(
|
||||
CASA_SEVERITY_ERROR,
|
||||
retStatus = CasaStatusBuild(CASA_SEVERITY_ERROR,
|
||||
CASA_FACILITY_AUTHTOKEN,
|
||||
CASA_STATUS_UNSUCCESSFUL);
|
||||
}
|
||||
|
@ -36,7 +36,7 @@
|
||||
Name="VCLinkerTool"
|
||||
IgnoreImportLibrary="FALSE"
|
||||
AdditionalOptions="/EXPORT:ObtainAuthToken"
|
||||
AdditionalDependencies="ws2_32.lib winhttp.lib libexpatml.lib micasa.lib"
|
||||
AdditionalDependencies="ws2_32.lib winhttp.lib libexpatml.lib micasa.lib shlwapi.lib"
|
||||
OutputFile="$(OutDir)/authtoken.dll"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories=""\Program Files\Novell\CASA\lib";"..\..\..\..\Expat-2.0.0\StaticLibs""
|
||||
@ -93,7 +93,7 @@ copy $(SolutionDir)client\windows\authtoken.lib \"Program Files"\novel
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/EXPORT:ObtainAuthToken"
|
||||
AdditionalDependencies="ws2_32.lib winhttp.lib libexpatml.lib micasa.lib"
|
||||
AdditionalDependencies="ws2_32.lib winhttp.lib libexpatml.lib micasa.lib shlwapi.lib"
|
||||
OutputFile="$(OutDir)/authtoken.dll"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories=""\Program Files\Novell\CASA\lib";"..\..\..\Expat-2.0.0\StaticLibs""
|
||||
|
@ -664,7 +664,8 @@ GetConfigInterface(
|
||||
}
|
||||
else
|
||||
{
|
||||
DbgTrace(1, "-GetConfigInterface- Unable to open config file, errno = %d\n", errno);
|
||||
DbgTrace(0, "-GetConfigInterface- Unable to open config file, errno = %d\n", errno);
|
||||
DbgTrace(0, "-GetConfigInterface- Config file unable to open = %s\n", pFilePath);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -160,8 +160,7 @@ ObtainSessionToken(
|
||||
if (CASA_SUCCESS(retStatus))
|
||||
{
|
||||
// Return the auth token to the caller
|
||||
pCacheEntry = CreateSessionTokenCacheEntry(
|
||||
pAuthContext->pContext,
|
||||
pCacheEntry = CreateSessionTokenCacheEntry(pAuthContext->pContext,
|
||||
retStatus,
|
||||
pAuthenticateResp->pToken,
|
||||
pAuthenticateResp->tokenLifetime);
|
||||
@ -195,8 +194,7 @@ ObtainSessionToken(
|
||||
// was because the server was unavailable.
|
||||
if (CasaStatusCode(retStatus) == CASA_STATUS_AUTH_SERVER_UNAVAILABLE)
|
||||
{
|
||||
pCacheEntry = CreateSessionTokenCacheEntry(
|
||||
pAuthContext->pContext,
|
||||
pCacheEntry = CreateSessionTokenCacheEntry(pAuthContext->pContext,
|
||||
retStatus,
|
||||
NULL,
|
||||
DEFAULT_RETRY_LIFETIME);
|
||||
@ -290,7 +288,7 @@ ObtainAuthTokenFromServer(
|
||||
char *pSessionToken = NULL;
|
||||
|
||||
// Request the auth parameters associated with this service
|
||||
pReqMsg = BuildGetAuthPolicyMsg(pServiceName, pHostName);
|
||||
pReqMsg = BuildGetAuthPolicyMsg(pServiceName, "localhost"); // tbd - This will be changed in the future so that we can support services residing in a different host than the ATS
|
||||
if (pReqMsg)
|
||||
{
|
||||
// Issue rpc
|
||||
@ -318,7 +316,7 @@ ObtainAuthTokenFromServer(
|
||||
{
|
||||
// Request auth token for the service
|
||||
free(pReqMsg);
|
||||
pReqMsg = BuildGetAuthTokenMsg(pServiceName, pHostName, pSessionToken);
|
||||
pReqMsg = BuildGetAuthTokenMsg(pServiceName, "localhost", pSessionToken); // tbd - This will be changed in the future so that we can support services residing in a different host than the ATS
|
||||
if (pReqMsg)
|
||||
{
|
||||
// Free the previous response msg buffer
|
||||
@ -492,6 +490,10 @@ ObtainAuthToken(
|
||||
goto exit;
|
||||
}
|
||||
|
||||
DbgTrace(1, "-ObtainAuthToken- ServiceName = %s\n", pServiceName);
|
||||
DbgTrace(1, "-ObtainAuthToken- HostName = %s\n", pHostName);
|
||||
DbgTrace(1, "-ObtainAuthToken- BufferLength = %d\n", *pAuthTokenBufLen);
|
||||
|
||||
// Make sure we are initialized
|
||||
// Obtain our synchronization mutex
|
||||
AcquireInitializationMutex();
|
||||
@ -547,13 +549,11 @@ ObtainAuthToken(
|
||||
if (CASA_SUCCESS(retStatus)
|
||||
|| CasaStatusCode(retStatus) == CASA_STATUS_AUTH_SERVER_UNAVAILABLE)
|
||||
{
|
||||
pCacheEntry = CreateAuthTokenCacheEntry(
|
||||
pServiceName,
|
||||
pCacheEntry = CreateAuthTokenCacheEntry(pServiceName,
|
||||
pNormalizedHostName,
|
||||
retStatus,
|
||||
pToken,
|
||||
cacheEntryLifetime);
|
||||
|
||||
if (pCacheEntry)
|
||||
{
|
||||
// Release the cache entry if the resulting status is not successful
|
||||
@ -563,7 +563,6 @@ ObtainAuthToken(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -586,6 +585,7 @@ ObtainAuthToken(
|
||||
if (*pAuthTokenBufLen >= tokenLen)
|
||||
{
|
||||
// Return the auth token to the caller
|
||||
DbgTrace(0, "-ObtainAuthToken- Copying the token into the callers buffer\n", 0);
|
||||
strcpy(pAuthTokenBuf, pCacheEntry->token);
|
||||
}
|
||||
else
|
||||
@ -677,14 +677,11 @@ InitializeLibrary(void)
|
||||
|
||||
// Initialize the host name normalization
|
||||
retStatus = InitializeHostNameNormalization();
|
||||
|
||||
|
||||
if (CASA_SUCCESS(retStatus))
|
||||
{
|
||||
retStatus = InitializeAuthCache();
|
||||
}
|
||||
|
||||
|
||||
DbgTrace(1, "-InitializeLibrary- End, retStatus = %08X\n", retStatus);
|
||||
|
||||
return retStatus;
|
||||
|
Loading…
Reference in New Issue
Block a user