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, "@", keySize);
|
||||||
strncat(pKey, pGroupOrHostName, keySize);
|
strncat(pKey, pGroupOrHostName, keySize);
|
||||||
|
|
||||||
retStatus = miCASAWriteBinaryKey(
|
retStatus = miCASAWriteBinaryKey(g_hCASAContext,
|
||||||
g_hCASAContext,
|
|
||||||
0,
|
0,
|
||||||
&sessionKeyChain,
|
&sessionKeyChain,
|
||||||
&sharedId,
|
&sharedId,
|
||||||
@ -243,8 +242,7 @@ CreateSessionTokenCacheEntry(
|
|||||||
pEntry->doesNotExpire = TRUE;
|
pEntry->doesNotExpire = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
retStatus = miCASAWriteBinaryKey(
|
retStatus = miCASAWriteBinaryKey(g_hCASAContext,
|
||||||
g_hCASAContext,
|
|
||||||
0,
|
0,
|
||||||
&sessionKeyChain,
|
&sessionKeyChain,
|
||||||
&sharedId,
|
&sharedId,
|
||||||
@ -392,8 +390,7 @@ FindSessionTokenEntryInCache(
|
|||||||
valueLength = 0;
|
valueLength = 0;
|
||||||
bytesRequired = 0;
|
bytesRequired = 0;
|
||||||
|
|
||||||
retStatus = miCASAReadBinaryKey(
|
retStatus = miCASAReadBinaryKey(g_hCASAContext,
|
||||||
g_hCASAContext,
|
|
||||||
0,
|
0,
|
||||||
&sessionKeyChain,
|
&sessionKeyChain,
|
||||||
&sharedId,
|
&sharedId,
|
||||||
@ -415,8 +412,7 @@ FindSessionTokenEntryInCache(
|
|||||||
valueLength = bytesRequired;
|
valueLength = bytesRequired;
|
||||||
bytesRequired = 0;
|
bytesRequired = 0;
|
||||||
|
|
||||||
retStatus = miCASAReadBinaryKey(
|
retStatus = miCASAReadBinaryKey(g_hCASAContext,
|
||||||
g_hCASAContext,
|
|
||||||
0,
|
0,
|
||||||
&sessionKeyChain,
|
&sessionKeyChain,
|
||||||
&sharedId,
|
&sharedId,
|
||||||
@ -427,7 +423,6 @@ FindSessionTokenEntryInCache(
|
|||||||
NULL,
|
NULL,
|
||||||
&bytesRequired,
|
&bytesRequired,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
if (CASA_SUCCESS(retStatus))
|
if (CASA_SUCCESS(retStatus))
|
||||||
{
|
{
|
||||||
if (pEntry->doesNotExpire == FALSE
|
if (pEntry->doesNotExpire == FALSE
|
||||||
@ -486,7 +481,6 @@ FindAuthTokenEntryInCache(
|
|||||||
keySize = (uint32_t)strlen(pCacheKey) + (uint32_t)strlen(pGroupOrHostName) + 2;
|
keySize = (uint32_t)strlen(pCacheKey) + (uint32_t)strlen(pGroupOrHostName) + 2;
|
||||||
|
|
||||||
pKey = malloc(keySize);
|
pKey = malloc(keySize);
|
||||||
|
|
||||||
if (pKey)
|
if (pKey)
|
||||||
{
|
{
|
||||||
strncpy(pKey, pCacheKey, keySize);
|
strncpy(pKey, pCacheKey, keySize);
|
||||||
@ -496,8 +490,7 @@ FindAuthTokenEntryInCache(
|
|||||||
valueLength = 0;
|
valueLength = 0;
|
||||||
bytesRequired = 0;
|
bytesRequired = 0;
|
||||||
|
|
||||||
retStatus = miCASAReadBinaryKey(
|
retStatus = miCASAReadBinaryKey(g_hCASAContext,
|
||||||
g_hCASAContext,
|
|
||||||
0,
|
0,
|
||||||
&sessionKeyChain,
|
&sessionKeyChain,
|
||||||
&sharedId,
|
&sharedId,
|
||||||
@ -519,8 +512,7 @@ FindAuthTokenEntryInCache(
|
|||||||
valueLength = bytesRequired;
|
valueLength = bytesRequired;
|
||||||
bytesRequired = 0;
|
bytesRequired = 0;
|
||||||
|
|
||||||
retStatus = miCASAReadBinaryKey(
|
retStatus = miCASAReadBinaryKey(g_hCASAContext,
|
||||||
g_hCASAContext,
|
|
||||||
0,
|
0,
|
||||||
&sessionKeyChain,
|
&sessionKeyChain,
|
||||||
&sharedId,
|
&sharedId,
|
||||||
@ -531,7 +523,6 @@ FindAuthTokenEntryInCache(
|
|||||||
NULL,
|
NULL,
|
||||||
&bytesRequired,
|
&bytesRequired,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
if (CASA_SUCCESS(retStatus))
|
if (CASA_SUCCESS(retStatus))
|
||||||
{
|
{
|
||||||
if (pEntry->doesNotExpire == FALSE
|
if (pEntry->doesNotExpire == FALSE
|
||||||
@ -586,15 +577,12 @@ InitializeAuthCache()
|
|||||||
ssId.version = NSSCS_VERSION_NUMBER;
|
ssId.version = NSSCS_VERSION_NUMBER;
|
||||||
strcpy((char *)ssId.ssName, (char *)SSCS_DEFAULT_SECRETSTORE_ID);
|
strcpy((char *)ssId.ssName, (char *)SSCS_DEFAULT_SECRETSTORE_ID);
|
||||||
|
|
||||||
g_hCASAContext = miCASAOpenSecretStoreCache(
|
g_hCASAContext = miCASAOpenSecretStoreCache(&ssId,
|
||||||
&ssId,
|
|
||||||
0,
|
0,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
if (!g_hCASAContext)
|
if (!g_hCASAContext)
|
||||||
{
|
{
|
||||||
retStatus = CasaStatusBuild(
|
retStatus = CasaStatusBuild(CASA_SEVERITY_ERROR,
|
||||||
CASA_SEVERITY_ERROR,
|
|
||||||
CASA_FACILITY_AUTHTOKEN,
|
CASA_FACILITY_AUTHTOKEN,
|
||||||
CASA_STATUS_UNSUCCESSFUL);
|
CASA_STATUS_UNSUCCESSFUL);
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
IgnoreImportLibrary="FALSE"
|
IgnoreImportLibrary="FALSE"
|
||||||
AdditionalOptions="/EXPORT:ObtainAuthToken"
|
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"
|
OutputFile="$(OutDir)/authtoken.dll"
|
||||||
LinkIncremental="1"
|
LinkIncremental="1"
|
||||||
AdditionalLibraryDirectories=""\Program Files\Novell\CASA\lib";"..\..\..\..\Expat-2.0.0\StaticLibs""
|
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
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
AdditionalOptions="/EXPORT:ObtainAuthToken"
|
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"
|
OutputFile="$(OutDir)/authtoken.dll"
|
||||||
LinkIncremental="1"
|
LinkIncremental="1"
|
||||||
AdditionalLibraryDirectories=""\Program Files\Novell\CASA\lib";"..\..\..\Expat-2.0.0\StaticLibs""
|
AdditionalLibraryDirectories=""\Program Files\Novell\CASA\lib";"..\..\..\Expat-2.0.0\StaticLibs""
|
||||||
|
@ -664,7 +664,8 @@ GetConfigInterface(
|
|||||||
}
|
}
|
||||||
else
|
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
|
else
|
||||||
|
@ -160,8 +160,7 @@ ObtainSessionToken(
|
|||||||
if (CASA_SUCCESS(retStatus))
|
if (CASA_SUCCESS(retStatus))
|
||||||
{
|
{
|
||||||
// Return the auth token to the caller
|
// Return the auth token to the caller
|
||||||
pCacheEntry = CreateSessionTokenCacheEntry(
|
pCacheEntry = CreateSessionTokenCacheEntry(pAuthContext->pContext,
|
||||||
pAuthContext->pContext,
|
|
||||||
retStatus,
|
retStatus,
|
||||||
pAuthenticateResp->pToken,
|
pAuthenticateResp->pToken,
|
||||||
pAuthenticateResp->tokenLifetime);
|
pAuthenticateResp->tokenLifetime);
|
||||||
@ -195,8 +194,7 @@ ObtainSessionToken(
|
|||||||
// was because the server was unavailable.
|
// was because the server was unavailable.
|
||||||
if (CasaStatusCode(retStatus) == CASA_STATUS_AUTH_SERVER_UNAVAILABLE)
|
if (CasaStatusCode(retStatus) == CASA_STATUS_AUTH_SERVER_UNAVAILABLE)
|
||||||
{
|
{
|
||||||
pCacheEntry = CreateSessionTokenCacheEntry(
|
pCacheEntry = CreateSessionTokenCacheEntry(pAuthContext->pContext,
|
||||||
pAuthContext->pContext,
|
|
||||||
retStatus,
|
retStatus,
|
||||||
NULL,
|
NULL,
|
||||||
DEFAULT_RETRY_LIFETIME);
|
DEFAULT_RETRY_LIFETIME);
|
||||||
@ -290,7 +288,7 @@ ObtainAuthTokenFromServer(
|
|||||||
char *pSessionToken = NULL;
|
char *pSessionToken = NULL;
|
||||||
|
|
||||||
// Request the auth parameters associated with this service
|
// 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)
|
if (pReqMsg)
|
||||||
{
|
{
|
||||||
// Issue rpc
|
// Issue rpc
|
||||||
@ -318,7 +316,7 @@ ObtainAuthTokenFromServer(
|
|||||||
{
|
{
|
||||||
// Request auth token for the service
|
// Request auth token for the service
|
||||||
free(pReqMsg);
|
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)
|
if (pReqMsg)
|
||||||
{
|
{
|
||||||
// Free the previous response msg buffer
|
// Free the previous response msg buffer
|
||||||
@ -492,6 +490,10 @@ ObtainAuthToken(
|
|||||||
goto exit;
|
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
|
// Make sure we are initialized
|
||||||
// Obtain our synchronization mutex
|
// Obtain our synchronization mutex
|
||||||
AcquireInitializationMutex();
|
AcquireInitializationMutex();
|
||||||
@ -547,13 +549,11 @@ ObtainAuthToken(
|
|||||||
if (CASA_SUCCESS(retStatus)
|
if (CASA_SUCCESS(retStatus)
|
||||||
|| CasaStatusCode(retStatus) == CASA_STATUS_AUTH_SERVER_UNAVAILABLE)
|
|| CasaStatusCode(retStatus) == CASA_STATUS_AUTH_SERVER_UNAVAILABLE)
|
||||||
{
|
{
|
||||||
pCacheEntry = CreateAuthTokenCacheEntry(
|
pCacheEntry = CreateAuthTokenCacheEntry(pServiceName,
|
||||||
pServiceName,
|
|
||||||
pNormalizedHostName,
|
pNormalizedHostName,
|
||||||
retStatus,
|
retStatus,
|
||||||
pToken,
|
pToken,
|
||||||
cacheEntryLifetime);
|
cacheEntryLifetime);
|
||||||
|
|
||||||
if (pCacheEntry)
|
if (pCacheEntry)
|
||||||
{
|
{
|
||||||
// Release the cache entry if the resulting status is not successful
|
// Release the cache entry if the resulting status is not successful
|
||||||
@ -563,7 +563,6 @@ ObtainAuthToken(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -586,6 +585,7 @@ ObtainAuthToken(
|
|||||||
if (*pAuthTokenBufLen >= tokenLen)
|
if (*pAuthTokenBufLen >= tokenLen)
|
||||||
{
|
{
|
||||||
// Return the auth token to the caller
|
// Return the auth token to the caller
|
||||||
|
DbgTrace(0, "-ObtainAuthToken- Copying the token into the callers buffer\n", 0);
|
||||||
strcpy(pAuthTokenBuf, pCacheEntry->token);
|
strcpy(pAuthTokenBuf, pCacheEntry->token);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -677,14 +677,11 @@ InitializeLibrary(void)
|
|||||||
|
|
||||||
// Initialize the host name normalization
|
// Initialize the host name normalization
|
||||||
retStatus = InitializeHostNameNormalization();
|
retStatus = InitializeHostNameNormalization();
|
||||||
|
|
||||||
|
|
||||||
if (CASA_SUCCESS(retStatus))
|
if (CASA_SUCCESS(retStatus))
|
||||||
{
|
{
|
||||||
retStatus = InitializeAuthCache();
|
retStatus = InitializeAuthCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
DbgTrace(1, "-InitializeLibrary- End, retStatus = %08X\n", retStatus);
|
DbgTrace(1, "-InitializeLibrary- End, retStatus = %08X\n", retStatus);
|
||||||
|
|
||||||
return retStatus;
|
return retStatus;
|
||||||
|
Loading…
Reference in New Issue
Block a user