Changes due to continued development effort.
This commit is contained in:
parent
47f4dbb6b7
commit
ad7eea8933
@ -61,7 +61,7 @@ BOOL APIENTRY DllMain(
|
|||||||
if (InitializeLibrary() != 0)
|
if (InitializeLibrary() != 0)
|
||||||
{
|
{
|
||||||
// Failed to initialize the library
|
// Failed to initialize the library
|
||||||
OutputDebugString("CASA_PW_MECH -DllMain- Library initialization failed\n");
|
OutputDebugString("CASA_KRB5_MECH -DllMain- Library initialization failed\n");
|
||||||
retStatus = FALSE;
|
retStatus = FALSE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -85,16 +85,16 @@ AuthTokenIf_GetAuthToken(
|
|||||||
// Description:
|
// Description:
|
||||||
// Get authentication token to authenticate user to specified service.
|
// Get authentication token to authenticate user to specified service.
|
||||||
//
|
//
|
||||||
// L0
|
// L2
|
||||||
//=======================================================================--
|
//=======================================================================--
|
||||||
{
|
{
|
||||||
CasaStatus retStatus;
|
CasaStatus retStatus;
|
||||||
char *pKrbServiceName = pMechInfo;
|
char *pKrbServiceName = pMechInfo;
|
||||||
|
|
||||||
SECURITY_STATUS secStatus;
|
SECURITY_STATUS secStatus;
|
||||||
TimeStamp expiry;
|
TimeStamp expiry;
|
||||||
CredHandle hCredentials = {0};
|
CredHandle hCredentials = {0};
|
||||||
|
|
||||||
|
|
||||||
DbgTrace(1, "-AuthTokenIf_GetAuthToken- Start\n", 0);
|
DbgTrace(1, "-AuthTokenIf_GetAuthToken- Start\n", 0);
|
||||||
|
|
||||||
// Validate input parameters
|
// Validate input parameters
|
||||||
@ -161,7 +161,6 @@ AuthTokenIf_GetAuthToken(
|
|||||||
int encodedTokenLen;
|
int encodedTokenLen;
|
||||||
|
|
||||||
// The security context was initialized, now return it to the caller after base64 encoding it.
|
// The security context was initialized, now return it to the caller after base64 encoding it.
|
||||||
// The token has been assembled, now encode it.
|
|
||||||
retStatus = EncodeData(sendTok.pvBuffer,
|
retStatus = EncodeData(sendTok.pvBuffer,
|
||||||
(const int) sendTok.cbBuffer,
|
(const int) sendTok.cbBuffer,
|
||||||
&pEncodedToken,
|
&pEncodedToken,
|
||||||
@ -172,8 +171,6 @@ AuthTokenIf_GetAuthToken(
|
|||||||
if (encodedTokenLen > *pTokenBufLen)
|
if (encodedTokenLen > *pTokenBufLen)
|
||||||
{
|
{
|
||||||
// The buffer is not big enough
|
// The buffer is not big enough
|
||||||
DbgTrace(1, "-AuthTokenIf_GetAuthToken- Insufficient buffer space provided\n", 0);
|
|
||||||
|
|
||||||
retStatus = CasaStatusBuild(CASA_SEVERITY_ERROR,
|
retStatus = CasaStatusBuild(CASA_SEVERITY_ERROR,
|
||||||
CASA_FACILITY_KRB5TOKEN,
|
CASA_FACILITY_KRB5TOKEN,
|
||||||
CASA_STATUS_BUFFER_OVERFLOW);
|
CASA_STATUS_BUFFER_OVERFLOW);
|
||||||
@ -199,9 +196,8 @@ AuthTokenIf_GetAuthToken(
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DbgTrace(1, "-AuthTokenIf_GetAuthToken- Failed to obtain the credentials handle, error = %08X\n", secStatus);
|
DbgTrace(0, "-AuthTokenIf_GetAuthToken- Failed to initialize the security context, error = %08X\n", secStatus);
|
||||||
|
|
||||||
// tdb - Set retStatus based on secStatus
|
|
||||||
retStatus = CasaStatusBuild(CASA_SEVERITY_ERROR,
|
retStatus = CasaStatusBuild(CASA_SEVERITY_ERROR,
|
||||||
CASA_FACILITY_KRB5TOKEN,
|
CASA_FACILITY_KRB5TOKEN,
|
||||||
CASA_STATUS_UNSUCCESSFUL);
|
CASA_STATUS_UNSUCCESSFUL);
|
||||||
@ -219,12 +215,21 @@ AuthTokenIf_GetAuthToken(
|
|||||||
{
|
{
|
||||||
DbgTrace(1, "-AuthTokenIf_GetAuthToken- Failed to obtain the credentials handle, error = %08X\n", secStatus);
|
DbgTrace(1, "-AuthTokenIf_GetAuthToken- Failed to obtain the credentials handle, error = %08X\n", secStatus);
|
||||||
|
|
||||||
// tdb - Set retStatus based on secStatus
|
// Set retStatus based on secStatus
|
||||||
|
if (secStatus == SEC_E_NOT_OWNER
|
||||||
|
|| secStatus == SEC_E_NO_CREDENTIALS)
|
||||||
|
{
|
||||||
retStatus = CasaStatusBuild(CASA_SEVERITY_ERROR,
|
retStatus = CasaStatusBuild(CASA_SEVERITY_ERROR,
|
||||||
CASA_FACILITY_KRB5TOKEN,
|
CASA_FACILITY_KRB5TOKEN,
|
||||||
CASA_STATUS_NO_CREDENTIALS);
|
CASA_STATUS_NO_CREDENTIALS);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
retStatus = CasaStatusBuild(CASA_SEVERITY_ERROR,
|
||||||
|
CASA_FACILITY_KRB5TOKEN,
|
||||||
|
CASA_STATUS_UNSUCCESSFUL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
|
|
||||||
@ -246,13 +251,14 @@ InitializeLibrary(void)
|
|||||||
//
|
//
|
||||||
// Notes:
|
// Notes:
|
||||||
//
|
//
|
||||||
// L0
|
// L2
|
||||||
//=======================================================================--
|
//=======================================================================--
|
||||||
{
|
{
|
||||||
int retStatus = 0;
|
int retStatus = 0;
|
||||||
|
|
||||||
DbgTrace(1, "-InitializeLibrary- Start\n", 0);
|
DbgTrace(1, "-InitializeLibrary- Start\n", 0);
|
||||||
|
|
||||||
|
// Nothing to do at this time.
|
||||||
|
|
||||||
DbgTrace(1, "-InitializeLibrary- End, retStatus = %08X\n", retStatus);
|
DbgTrace(1, "-InitializeLibrary- End, retStatus = %08X\n", retStatus);
|
||||||
|
|
||||||
|
35
auth_token/client/mechanisms/krb5/win32/platform.c
Normal file
35
auth_token/client/mechanisms/krb5/win32/platform.c
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
/***********************************************************************
|
||||||
|
*
|
||||||
|
* Copyright (C) 2006 Novell, Inc. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; version 2.1
|
||||||
|
* of the License.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Library Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, Novell, Inc.
|
||||||
|
*
|
||||||
|
* To contact Novell about this file by physical or electronic mail,
|
||||||
|
* you may find current contact information at www.novell.com.
|
||||||
|
*
|
||||||
|
* Author: Juan Carlos Luciani <jluciani@novell.com>
|
||||||
|
*
|
||||||
|
***********************************************************************/
|
||||||
|
|
||||||
|
//===[ Include files ]=====================================================
|
||||||
|
|
||||||
|
#include "internal.h"
|
||||||
|
|
||||||
|
//===[ Type definitions ]==================================================
|
||||||
|
|
||||||
|
//===[ Function prototypes ]===============================================
|
||||||
|
|
||||||
|
//===[ Global variables ]==================================================
|
||||||
|
|
||||||
|
|
@ -44,17 +44,23 @@
|
|||||||
//
|
//
|
||||||
// DbgTrace macro define
|
// DbgTrace macro define
|
||||||
//
|
//
|
||||||
|
//#define DbgTrace(LEVEL, X, Y) { \
|
||||||
|
//char printBuff[256]; \
|
||||||
|
// if (LEVEL == 0 || DebugLevel >= LEVEL) \
|
||||||
|
// { \
|
||||||
|
// _snprintf(printBuff, sizeof(printBuff), X, Y); \
|
||||||
|
// printf("Krb5Mech %s", printBuff); \
|
||||||
|
// } \
|
||||||
|
//}
|
||||||
#define DbgTrace(LEVEL, X, Y) { \
|
#define DbgTrace(LEVEL, X, Y) { \
|
||||||
|
char formatBuff[128]; \
|
||||||
char printBuff[256]; \
|
char printBuff[256]; \
|
||||||
if (LEVEL == 0) \
|
if (LEVEL == 0 || DebugLevel >= LEVEL) \
|
||||||
{ \
|
{ \
|
||||||
_snprintf(printBuff, sizeof(printBuff), X, Y); \
|
strcpy(formatBuff, "Krb5Mech "); \
|
||||||
printf("Krb5Mech %s", printBuff); \
|
strncat(formatBuff, X, sizeof(formatBuff) - 9); \
|
||||||
} \
|
_snprintf(printBuff, sizeof(printBuff), formatBuff, Y); \
|
||||||
else if (DebugLevel >= LEVEL) \
|
OutputDebugString(printBuff); \
|
||||||
{ \
|
|
||||||
_snprintf(printBuff, sizeof(printBuff), X, Y); \
|
|
||||||
printf("Krb5Mech %s", printBuff); \
|
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user