CASA-auth-token-client: rename lib directory to library and change in makefile
This commit is contained in:
		| @@ -0,0 +1,33 @@ | ||||
| ####################################################### | ||||
| #                                                     # | ||||
| # CASA Authentication Token System configuration file # | ||||
| # for module:                                         # | ||||
| #                                                     # | ||||
| #     Krb5Authenticate                                # | ||||
| #                                                     # | ||||
| ####################################################### | ||||
|  | ||||
| # | ||||
| # LibraryName setting. | ||||
| # | ||||
| # Description: Used to specify the path to the library | ||||
| #              implementing the authentication mechanism. | ||||
| # | ||||
| LibraryName		\Program Files\novell\casa\lib\krb5mech.dll | ||||
|  | ||||
| # | ||||
| # DebugLevel setting. | ||||
| # | ||||
| # Description: Used to specify the level of logging utilized for debugging | ||||
| #              purposes. A level of zero being the lowest debugging level. | ||||
| # | ||||
| #              If this parameter is not set, the client defaults | ||||
| #              to use a debug level of zero. | ||||
| # | ||||
| #              Note: Debug statements can be viewed under Windows by using | ||||
| #              tools such as DbgView. Under Linux, debug statements are logged | ||||
| #              to /var/log/messages. | ||||
| # | ||||
| #DebugLevel	0 | ||||
|  | ||||
|  | ||||
| @@ -0,0 +1,69 @@ | ||||
| ####################################################################### | ||||
| # | ||||
| #  Copyright (C) 2004 Novell, Inc. | ||||
| # | ||||
| #  This program is free software; you can redistribute it and/or | ||||
| #  modify it under the terms of the GNU General Public | ||||
| #  License as published by the Free Software Foundation; either | ||||
| #  version 2 of the License, or (at your option) any later version. | ||||
| # | ||||
| #  This program 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 | ||||
| #  General Public License for more details. | ||||
| # | ||||
| #  You should have received a copy of the GNU General Public | ||||
| #  License along with this program; if not, write to the Free | ||||
| #  Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||||
| # | ||||
| #  Author: Greg Richardson <grichardson@novell.com> | ||||
| # | ||||
| ####################################################################### | ||||
|  | ||||
| SUBDIRS = | ||||
|  | ||||
| DIST_SUBDIRS = | ||||
|  | ||||
| EXTRA_DIST = krb5.vcproj ../*.c *.c *.h *.conf *.def | ||||
|  | ||||
| if DEBUG | ||||
| TARGET_CFG = Debug | ||||
| else | ||||
| TARGET_CFG = Release | ||||
| endif | ||||
|  | ||||
| PACKAGE = krb5 | ||||
| TARGET_FILE = krb5mech.dll | ||||
| LOG_FILE = $(PACKAGE).log | ||||
|  | ||||
| all-am: $(TARGET_FILE) | ||||
|  | ||||
| .PHONY: $TARGET_FILE) devenv | ||||
|  | ||||
| devenv: | ||||
| 	@if ! test -x "$(VSINSTALLDIR)/Common7/IDE/devenv.exe"; then echo "Error: Microsoft Visual Studio .NET is currently required to build MSI and MSM packages"; exit 1; fi | ||||
|  | ||||
| $(TARGET_FILE): devenv | ||||
| 	@rm -f $(LOG_FILE) $@ | ||||
| 	@CMD='"$(VSINSTALLDIR)/Common7/IDE/devenv.exe" ../../../../authclient.sln /build $(TARGET_CFG) /project $(PACKAGE) /out $(LOG_FILE)'; \ | ||||
| 	echo $$CMD; \ | ||||
| 	if eval $$CMD; then \ | ||||
| 		ls -l $(TARGET_CFG)/$(TARGET_FILE); \ | ||||
| 	else \ | ||||
| 		grep -a "ERROR:" $(LOG_FILE); \ | ||||
| 	fi | ||||
| 	 | ||||
| package-clean clean-local: | ||||
| 	rm -rf  Release/* Release Debug/* Debug*/Release */Debug *.log *.suo | ||||
|  | ||||
| clean: | ||||
| 	rm -rf  Release/* Release Debug/* Debug */Release */Debug *.log *.suo | ||||
|  | ||||
| distclean-local: package-clean | ||||
| 	rm -f Makefile  | ||||
|  | ||||
| maintainer-clean-local: | ||||
| 	rm -f Makefile.in | ||||
|  | ||||
|  | ||||
|  | ||||
							
								
								
									
										132
									
								
								CASA-auth-token/client/library/mechanisms/krb5/windows/dllsup.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										132
									
								
								CASA-auth-token/client/library/mechanisms/krb5/windows/dllsup.c
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,132 @@ | ||||
| /*********************************************************************** | ||||
|  *  | ||||
|  *  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" | ||||
|  | ||||
| //===[ External data ]===================================================== | ||||
|  | ||||
| //===[ Manifest constants ]================================================ | ||||
|  | ||||
| //===[ Type definitions ]================================================== | ||||
|  | ||||
| //===[ Function prototypes ]=============================================== | ||||
|  | ||||
| //===[ Global variables ]================================================== | ||||
|  | ||||
| UINT32 g_ulCount  = 0; | ||||
| UINT32 g_ulLock = 0; | ||||
| HANDLE g_hModule; | ||||
|  | ||||
|  | ||||
| //++======================================================================= | ||||
| BOOL APIENTRY DllMain( | ||||
|    HANDLE hModule, | ||||
|    DWORD  ul_reason_for_call, | ||||
|    LPVOID lpReserved    | ||||
|    ) | ||||
| //=======================================================================-- | ||||
| { | ||||
|    BOOL  retStatus = TRUE; | ||||
|  | ||||
|    switch (ul_reason_for_call) | ||||
|    { | ||||
|       case DLL_PROCESS_ATTACH: | ||||
|       { | ||||
|          g_hModule = hModule; | ||||
|  | ||||
|          // Initialize the library | ||||
|          if (InitializeLibrary() != 0) | ||||
|          { | ||||
|             // Failed to initialize the library | ||||
|             OutputDebugString("CASA_KRB5_MECH -DllMain- Library initialization failed\n"); | ||||
|             retStatus = FALSE; | ||||
|          } | ||||
|          break; | ||||
|       } | ||||
|  | ||||
|       case DLL_THREAD_ATTACH: | ||||
|       { | ||||
|          g_hModule = hModule; | ||||
|          break; | ||||
|       } | ||||
|  | ||||
|       case DLL_THREAD_DETACH: | ||||
|          break; | ||||
|  | ||||
|       case DLL_PROCESS_DETACH: | ||||
|       { | ||||
|          /* Don't uninitialize on windows | ||||
|          tbd | ||||
|          */ | ||||
|          break; | ||||
|       } | ||||
|     } | ||||
|  | ||||
|     return retStatus; | ||||
| } | ||||
|  | ||||
| //++======================================================================= | ||||
| // | ||||
| // DllCanUnloadNow | ||||
| // | ||||
| // Synopsis | ||||
| // | ||||
| // | ||||
| STDAPI | ||||
| DllCanUnloadNow() | ||||
| // | ||||
| // Input Arguments | ||||
| // | ||||
| // Ouput Arguments | ||||
| // | ||||
| // Return Value | ||||
| //    S_OK    The DLL can be unloaded. | ||||
| //    S_FALSE The DLL cannot be unloaded now. | ||||
| // | ||||
| // Description | ||||
| //    An Exported Function. | ||||
| //    DLLs that support the OLE Component Object Model (COM) should implement | ||||
| //    and export DllCanUnloadNow. | ||||
| //    A call to DllCanUnloadNow determines whether the DLL from which it is | ||||
| //    exported is still in use. A DLL is no longer in use when it is not | ||||
| //    managing  any existing objects (the reference count on all of its objects | ||||
| //    is 0). | ||||
| //    DllCanUnloadNow returns S_FALSE if there are any existing references to | ||||
| //    objects that the DLL manages. | ||||
| // | ||||
| // Environment | ||||
| // | ||||
| // See Also | ||||
| // | ||||
| //=======================================================================-- | ||||
| { | ||||
|    // tbd | ||||
|    return ((g_ulCount == 0 && g_ulLock == 0) ? S_OK : S_FALSE); | ||||
| } | ||||
|  | ||||
| //========================================================================= | ||||
| //========================================================================= | ||||
|  | ||||
							
								
								
									
										304
									
								
								CASA-auth-token/client/library/mechanisms/krb5/windows/get.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										304
									
								
								CASA-auth-token/client/library/mechanisms/krb5/windows/get.c
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,304 @@ | ||||
| /*********************************************************************** | ||||
|  *  | ||||
|  *  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 ]================================================== | ||||
|  | ||||
|  | ||||
| //++======================================================================= | ||||
| CasaStatus SSCS_CALL | ||||
| AuthTokenIf_GetAuthToken( | ||||
|    IN       const void  *pIfInstance, | ||||
|    IN       const char  *pContext, | ||||
|    IN       const char  *pMechInfo, | ||||
|    IN       const char  *pHostName, | ||||
|    IN       void        *pCredStoreScope, | ||||
|    INOUT    char        *pTokenBuf, | ||||
|    INOUT    int         *pTokenBufLen) | ||||
| // | ||||
| // Arguments:   | ||||
| //    pIfInstance - | ||||
| //       Pointer to interface object. | ||||
| //    | ||||
| //    pContext - | ||||
| //       Pointer to null terminated string containing mechanism specific | ||||
| //       context information. Another name for context is Authentication | ||||
| //       Realm. | ||||
| // | ||||
| //    pMechInfo - | ||||
| //       Pointer to null terminated string containing mechanism specific | ||||
| //       information. This is information is provided by the server to | ||||
| //       aid the mechanism to generate an authentication token. For | ||||
| //       example, the mechanism information for a Kerberos mechanism | ||||
| //       may be the service principal name to which the user will be | ||||
| //       authenticating. | ||||
| //                | ||||
| //    pHostName - | ||||
| //       Pointer to null terminated string containing the name of the | ||||
| //       host where the ATS resides. | ||||
| //    | ||||
| //    pCredStoreScope - | ||||
| //       Pointer to CASA structure for scoping credential store access | ||||
| //       to specific users. This can only be leveraged when running in | ||||
| //       the context of System under Windows. | ||||
| //    | ||||
| //    pTokenBuf - | ||||
| //       Pointer to buffer that will receive the authentication | ||||
| //       token. The length of this buffer is specified by the | ||||
| //       pTokenBufLen parameter. Note that the the authentication | ||||
| //       token will be in the form of a NULL terminated string. | ||||
| // | ||||
| //    pTokenBufLen - | ||||
| //       Pointer to integer that contains the length of the | ||||
| //       buffer pointed at by pTokenBuf. Upon return of the | ||||
| //       function, the integer will contain the actual length | ||||
| //       of the authentication token if the function successfully | ||||
| //       completes or the buffer length required if the function | ||||
| //       fails because the buffer pointed at by pUserNameBuf is | ||||
| //       not large enough. | ||||
| //    | ||||
| // Returns: | ||||
| //    Casa Status | ||||
| //                            | ||||
| // Description: | ||||
| //    Get authentication token to authenticate user to specified service. | ||||
| // | ||||
| // L2 | ||||
| //=======================================================================-- | ||||
| { | ||||
|    CasaStatus        retStatus; | ||||
|    char              *pKrbServiceName = pMechInfo; | ||||
|    SECURITY_STATUS   secStatus; | ||||
|    TimeStamp         expiry; | ||||
|    CredHandle        hCredentials = {0}; | ||||
|  | ||||
|    DbgTrace(1, "-AuthTokenIf_GetAuthToken- Start\n", 0); | ||||
|  | ||||
|    // Validate input parameters | ||||
|    if (pIfInstance == NULL | ||||
|        || pContext == NULL | ||||
|        || pHostName == NULL | ||||
|        || pTokenBufLen == NULL | ||||
|        || (pTokenBuf == NULL && *pTokenBufLen != 0)) | ||||
|    { | ||||
|       DbgTrace(0, "-AuthTokenIf_GetAuthToken- Invalid input parameter\n", 0); | ||||
|  | ||||
|       retStatus = CasaStatusBuild(CASA_SEVERITY_ERROR, | ||||
|                                   CASA_FACILITY_KRB5TOKEN, | ||||
|                                   CASA_STATUS_INVALID_PARAMETER); | ||||
|       goto exit; | ||||
|    } | ||||
|  | ||||
|    // Check if we need to construct the service name | ||||
|    if (pKrbServiceName == NULL | ||||
|        || strlen(pKrbServiceName) == 0) | ||||
|    { | ||||
|       // The service name will default to host/hostname | ||||
|       pKrbServiceName = malloc(5 /*"host/"*/ + strlen(pHostName) + 1 /*'/0'*/); | ||||
|       if (pKrbServiceName) | ||||
|       { | ||||
|          sprintf(pKrbServiceName, "host/%s", pHostName); | ||||
|       } | ||||
|       else | ||||
|       { | ||||
|          DbgTrace(0, "-AuthTokenIf_GetAuthToken- Memory allocation failure\n", 0); | ||||
|          goto exit; | ||||
|       } | ||||
|    } | ||||
|  | ||||
|    // Acquire a credential handle for the current user | ||||
|    secStatus = AcquireCredentialsHandle(NULL,                  // no principal name | ||||
|                                         "Kerberos",            // package name | ||||
|                                         SECPKG_CRED_OUTBOUND, | ||||
|                                         NULL,                  // no logon id | ||||
|                                         NULL,                  // no auth data | ||||
|                                         NULL,                  // no get key fn | ||||
|                                         NULL,                  // noget key arg | ||||
|                                         &hCredentials, | ||||
|                                         &expiry); | ||||
|    if (secStatus == SEC_E_OK) | ||||
|    { | ||||
|       CtxtHandle        hContext = {0}; | ||||
|       SecBuffer         sendTok; | ||||
|       SecBufferDesc     outputDesc; | ||||
|       ULONG             retFlags; | ||||
|  | ||||
|       // We acquired the credential, now initialize a security context | ||||
|       // so that we can authenticate the user to the specified service. | ||||
|       // | ||||
|       // First ready an output descriptor so that we can receive the | ||||
|       // token buffer. | ||||
|       outputDesc.cBuffers = 1; | ||||
|       outputDesc.pBuffers = &sendTok; | ||||
|       outputDesc.ulVersion = SECBUFFER_VERSION; | ||||
|  | ||||
|       sendTok.BufferType = SECBUFFER_TOKEN; | ||||
|       sendTok.cbBuffer = 0; | ||||
|       sendTok.pvBuffer = NULL; | ||||
|  | ||||
|       // Initialize the security context for the specified service | ||||
|       secStatus = InitializeSecurityContext(&hCredentials, | ||||
|                                             NULL, | ||||
|                                             pKrbServiceName, | ||||
|                                             ISC_REQ_ALLOCATE_MEMORY, | ||||
|                                             0,          // reserved | ||||
|                                             SECURITY_NATIVE_DREP, | ||||
|                                             NULL, | ||||
|                                             0,          // reserved | ||||
|                                             &hContext, | ||||
|                                             &outputDesc, | ||||
|                                             &retFlags, | ||||
|                                             &expiry); | ||||
|       if (secStatus == SEC_E_OK) | ||||
|       { | ||||
|          char  *pEncodedToken; | ||||
|          int   encodedTokenLen; | ||||
|  | ||||
|          // The security context was initialized, now return it to the caller after base64 encoding it. | ||||
|          retStatus = EncodeData(sendTok.pvBuffer, | ||||
|                                 (const int) sendTok.cbBuffer, | ||||
|                                 &pEncodedToken, | ||||
|                                 &encodedTokenLen); | ||||
|          if (CASA_SUCCESS(retStatus)) | ||||
|          { | ||||
|             // Verify that the caller provided a buffer that is big enough | ||||
|             if (encodedTokenLen > *pTokenBufLen) | ||||
|             { | ||||
|                // The buffer is not big enough | ||||
|                retStatus = CasaStatusBuild(CASA_SEVERITY_ERROR, | ||||
|                                            CASA_FACILITY_KRB5TOKEN, | ||||
|                                            CASA_STATUS_BUFFER_OVERFLOW); | ||||
|             } | ||||
|             else | ||||
|             { | ||||
|                // The buffer provided is large enough, copy the data. | ||||
|                memcpy((void*) pTokenBuf, pEncodedToken, encodedTokenLen); | ||||
|  | ||||
|                // Success | ||||
|                retStatus = CASA_STATUS_SUCCESS; | ||||
|             } | ||||
|  | ||||
|             // Return the actual size or the size required | ||||
|             *pTokenBufLen = encodedTokenLen; | ||||
|  | ||||
|             // Free the buffer containing the encoded token after clearing | ||||
|             // its memory to avoid leaking sensitive information. | ||||
|             memset(pEncodedToken, 0, strlen(pEncodedToken)); | ||||
|             free(pEncodedToken); | ||||
|          } | ||||
|  | ||||
|          // Delete the security context | ||||
|          DeleteSecurityContext(&hContext); | ||||
|       } | ||||
|       else | ||||
|       { | ||||
|          DbgTrace(0, "-AuthTokenIf_GetAuthToken- Failed to initialize the security context, error = %08X\n", secStatus); | ||||
|  | ||||
|          retStatus = CasaStatusBuild(CASA_SEVERITY_ERROR, | ||||
|                                      CASA_FACILITY_KRB5TOKEN, | ||||
|                                      CASA_STATUS_UNSUCCESSFUL); | ||||
|       } | ||||
|  | ||||
|       // Free any buffer associated with the sendToken | ||||
|       if (sendTok.pvBuffer) | ||||
|       { | ||||
|          memset(sendTok.pvBuffer, 0, sendTok.cbBuffer); | ||||
|          FreeContextBuffer(sendTok.pvBuffer); | ||||
|       } | ||||
|  | ||||
|       // Free the credential handle obtained | ||||
|       FreeCredentialsHandle(&hCredentials); | ||||
|    } | ||||
|    else | ||||
|    { | ||||
|       DbgTrace(1, "-AuthTokenIf_GetAuthToken- Failed to obtain the credentials handle, error = %08X\n", secStatus); | ||||
|  | ||||
|       // Set retStatus based on secStatus | ||||
|       if (secStatus == SEC_E_NOT_OWNER | ||||
|           || secStatus == SEC_E_NO_CREDENTIALS) | ||||
|       { | ||||
|          retStatus = CasaStatusBuild(CASA_SEVERITY_ERROR, | ||||
|                                      CASA_FACILITY_KRB5TOKEN, | ||||
|                                      CASA_STATUS_NO_CREDENTIALS); | ||||
|       } | ||||
|       else | ||||
|       { | ||||
|          retStatus = CasaStatusBuild(CASA_SEVERITY_ERROR, | ||||
|                                      CASA_FACILITY_KRB5TOKEN, | ||||
|                                      CASA_STATUS_UNSUCCESSFUL); | ||||
|       } | ||||
|    } | ||||
|           | ||||
| exit: | ||||
|  | ||||
|    // Free buffer holding the Krb Service Name if necessary | ||||
|    if (pKrbServiceName | ||||
|        && pKrbServiceName != pMechInfo) | ||||
|       free(pKrbServiceName); | ||||
|  | ||||
|    DbgTrace(1, "-AuthTokenIf_GetAuthToken- End, retStatus = %08X\n", retStatus); | ||||
|  | ||||
|    return retStatus; | ||||
| } | ||||
|  | ||||
|  | ||||
| //++======================================================================= | ||||
| int | ||||
| InitializeLibrary(void) | ||||
| // | ||||
| //  Arguments:  | ||||
| // | ||||
| //  Returns:    | ||||
| // | ||||
| //  Abstract:   | ||||
| // | ||||
| //  Notes: | ||||
| // | ||||
| // L2 | ||||
| //=======================================================================-- | ||||
| { | ||||
|    int   retStatus = 0; | ||||
|  | ||||
|    DbgTrace(1, "-InitializeLibrary- Start\n", 0); | ||||
|  | ||||
|    // Nothing to do at this time. | ||||
|  | ||||
|    DbgTrace(1, "-InitializeLibrary- End, retStatus = %08X\n", retStatus); | ||||
|  | ||||
|    return retStatus; | ||||
| } | ||||
|  | ||||
|  | ||||
| //++======================================================================= | ||||
| //++======================================================================= | ||||
| //++======================================================================= | ||||
|  | ||||
| @@ -0,0 +1,244 @@ | ||||
| <?xml version="1.0" encoding="Windows-1252"?> | ||||
| <VisualStudioProject | ||||
| 	ProjectType="Visual C++" | ||||
| 	Version="8.00" | ||||
| 	Name="krb5" | ||||
| 	ProjectGUID="{5499F624-F371-4559-B4C2-A484BCE892FD}" | ||||
| 	Keyword="Win32Proj" | ||||
| 	> | ||||
| 	<Platforms> | ||||
| 		<Platform | ||||
| 			Name="Win32" | ||||
| 		/> | ||||
| 	</Platforms> | ||||
| 	<ToolFiles> | ||||
| 	</ToolFiles> | ||||
| 	<Configurations> | ||||
| 		<Configuration | ||||
| 			Name="Debug|Win32" | ||||
| 			OutputDirectory="$(SolutionDir)lib\mechanisms\krb5\windows\$(ConfigurationName)" | ||||
| 			IntermediateDirectory="$(SolutionDir)lib\mechanisms\krb5\windows\$(ConfigurationName)" | ||||
| 			ConfigurationType="2" | ||||
| 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" | ||||
| 			CharacterSet="2" | ||||
| 			> | ||||
| 			<Tool | ||||
| 				Name="VCPreBuildEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCustomBuildTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXMLDataGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCWebServiceProxyGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCMIDLTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCLCompilerTool" | ||||
| 				AdditionalOptions="-DSECURITY_WIN32 -D"_CRT_SECURE_NO_DEPRECATE"" | ||||
| 				Optimization="0" | ||||
| 				AdditionalIncludeDirectories=".\;..\;..\..\..;..\..\..\..\include;"..\..\..\..\..\..\..\Expat-2.0.0\source\lib";"c:\Program Files\Novell\CASA\include"" | ||||
| 				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS" | ||||
| 				MinimalRebuild="true" | ||||
| 				BasicRuntimeChecks="3" | ||||
| 				RuntimeLibrary="1" | ||||
| 				UsePrecompiledHeader="0" | ||||
| 				WarningLevel="3" | ||||
| 				Detect64BitPortabilityProblems="true" | ||||
| 				DebugInformationFormat="4" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCManagedResourceCompilerTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCResourceCompilerTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPreLinkEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCLinkerTool" | ||||
| 				AdditionalOptions="/EXPORT:GetAuthTokenInterface" | ||||
| 				AdditionalDependencies="secur32.lib" | ||||
| 				OutputFile="$(OutDir)/krb5mech.dll" | ||||
| 				LinkIncremental="1" | ||||
| 				IgnoreDefaultLibraryNames="libc" | ||||
| 				GenerateDebugInformation="true" | ||||
| 				ProgramDatabaseFile="$(OutDir)/pw.pdb" | ||||
| 				SubSystem="0" | ||||
| 				TargetMachine="1" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCALinkTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCManifestTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXDCMakeTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCBscMakeTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCFxCopTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCAppVerifierTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCWebDeploymentTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPostBuildEventTool" | ||||
| 				CommandLine="mkdir \"Program Files"\novell\
mkdir \"Program Files"\novell\casa
mkdir \"Program Files"\novell\casa\lib\
mkdir \"Program Files"\novell\casa\etc\
mkdir \"Program Files"\novell\casa\etc\auth\
mkdir \"Program Files"\novell\casa\etc\auth\mechanisms\
copy Krb5Authenticate.conf \"Program Files"\novell\casa\etc\auth\mechanisms\Krb5Authenticate.conf
copy $(OutDir)\krb5mech.dll \"Program Files"\novell\casa\lib\krb5mech.dll
" | ||||
| 			/> | ||||
| 		</Configuration> | ||||
| 		<Configuration | ||||
| 			Name="Release|Win32" | ||||
| 			OutputDirectory="$(SolutionDir)lib\mechanisms\krb5\windows\$(ConfigurationName)" | ||||
| 			IntermediateDirectory="$(SolutionDir)lib\mechanisms\krb5\windows\$(ConfigurationName)" | ||||
| 			ConfigurationType="2" | ||||
| 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" | ||||
| 			CharacterSet="2" | ||||
| 			> | ||||
| 			<Tool | ||||
| 				Name="VCPreBuildEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCustomBuildTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXMLDataGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCWebServiceProxyGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCMIDLTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCLCompilerTool" | ||||
| 				AdditionalOptions="-DSECURITY_WIN32 -D"_CRT_SECURE_NO_DEPRECATE"" | ||||
| 				AdditionalIncludeDirectories=".\;..\;..\..\..;..\..\..\..\include;"..\..\..\..\..\..\..\Expat-2.0.0\source\lib";"c:\Program Files\Novell\CASA\include"" | ||||
| 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS" | ||||
| 				RuntimeLibrary="0" | ||||
| 				UsePrecompiledHeader="0" | ||||
| 				WarningLevel="3" | ||||
| 				Detect64BitPortabilityProblems="true" | ||||
| 				DebugInformationFormat="3" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCManagedResourceCompilerTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCResourceCompilerTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPreLinkEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCLinkerTool" | ||||
| 				AdditionalOptions="/EXPORT:GetAuthTokenInterface" | ||||
| 				AdditionalDependencies="secur32.lib" | ||||
| 				OutputFile="$(OutDir)/krb5mech.dll" | ||||
| 				LinkIncremental="1" | ||||
| 				IgnoreDefaultLibraryNames="libc" | ||||
| 				GenerateDebugInformation="true" | ||||
| 				SubSystem="0" | ||||
| 				OptimizeReferences="2" | ||||
| 				EnableCOMDATFolding="2" | ||||
| 				TargetMachine="1" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCALinkTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCManifestTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXDCMakeTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCBscMakeTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCFxCopTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCAppVerifierTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCWebDeploymentTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPostBuildEventTool" | ||||
| 				CommandLine="mkdir \"Program Files"\novell\
mkdir \"Program Files"\novell\casa
mkdir \"Program Files"\novell\casa\lib\
mkdir \"Program Files"\novell\casa\etc\
mkdir \"Program Files"\novell\casa\etc\auth\
mkdir \"Program Files"\novell\casa\etc\auth\mechanisms\
copy Krb5Authenticate.conf \"Program Files"\novell\casa\etc\auth\mechanisms\Krb5Authenticate.conf
copy $(OutDir)\krb5mech.dll \"Program Files"\novell\casa\lib\krb5mech.dll
" | ||||
| 			/> | ||||
| 		</Configuration> | ||||
| 	</Configurations> | ||||
| 	<References> | ||||
| 	</References> | ||||
| 	<Files> | ||||
| 		<Filter | ||||
| 			Name="Source Files" | ||||
| 			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx" | ||||
| 			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" | ||||
| 			> | ||||
| 			<File | ||||
| 				RelativePath=".\dllsup.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath=".\get.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\interface.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath=".\Krb5Authenticate.conf" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath=".\krb5mech.def" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath=".\platform.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\util.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 		</Filter> | ||||
| 		<Filter | ||||
| 			Name="Header Files" | ||||
| 			Filter="h;hpp;hxx;hm;inl;inc;xsd" | ||||
| 			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" | ||||
| 			> | ||||
| 			<File | ||||
| 				RelativePath="..\internal.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath=".\platform.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 		</Filter> | ||||
| 		<Filter | ||||
| 			Name="Resource Files" | ||||
| 			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx" | ||||
| 			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" | ||||
| 			> | ||||
| 		</Filter> | ||||
| 	</Files> | ||||
| 	<Globals> | ||||
| 	</Globals> | ||||
| </VisualStudioProject> | ||||
| @@ -0,0 +1,10 @@ | ||||
| LIBRARY         KRB5MECH | ||||
| DESCRIPTION     'CASA Kerberos V Authentication Mechanism Library.' | ||||
|  | ||||
|  | ||||
| EXPORTS | ||||
| ;                DllRegisterServer   PRIVATE | ||||
| ;                DllUnregisterServer PRIVATE | ||||
| ;                DllGetClassObject   PRIVATE | ||||
|                 GetAuthTokenInterface  PRIVATE         | ||||
| ;               DllCanUnloadNow     PRIVATE   | ||||
| @@ -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 ]================================================== | ||||
|  | ||||
|  | ||||
| @@ -0,0 +1,83 @@ | ||||
| /*********************************************************************** | ||||
|  *  | ||||
|  *  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> | ||||
|  * | ||||
|  ***********************************************************************/ | ||||
|  | ||||
| #ifndef _PLATFORM_H_ | ||||
| #define _PLATFORM_H_ | ||||
|  | ||||
| //===[ Include files ]===================================================== | ||||
|  | ||||
| #include <windows.h> | ||||
| #include <stdio.h> | ||||
| #include <winerror.h> | ||||
| #include <security.h> | ||||
| #include <sspi.h> | ||||
|  | ||||
| //===[ Type definitions ]================================================== | ||||
|  | ||||
| #ifndef CONTAINING_RECORD | ||||
| #define CONTAINING_RECORD(address, type, field) ((type *)(     \ | ||||
|              (char*)(address) -                                \ | ||||
|              (char*)(&((type *)0)->field))) | ||||
| #endif | ||||
|  | ||||
| // | ||||
| // 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) {                                \ | ||||
| char formatBuff[128];                                          \ | ||||
| char printBuff[256];                                           \ | ||||
|    if (LEVEL == 0 || DebugLevel >= LEVEL)                      \ | ||||
|    {                                                           \ | ||||
|       strcpy(formatBuff, "Krb5Mech ");                         \ | ||||
|       strncat(formatBuff, X, sizeof(formatBuff) - 9);          \ | ||||
|       _snprintf(printBuff, sizeof(printBuff), formatBuff, Y);  \ | ||||
|       OutputDebugString(printBuff);                            \ | ||||
|    }                                                           \ | ||||
| } | ||||
|  | ||||
| #define bool BOOLEAN | ||||
| #define true TRUE | ||||
| #define false FALSE | ||||
|  | ||||
| //===[ Inlines functions   ]=============================================== | ||||
|  | ||||
| //===[ Function prototypes ]=============================================== | ||||
|  | ||||
| //===[ Global externals ]================================================== | ||||
|  | ||||
| //===[ External prototypes ]=============================================== | ||||
|  | ||||
|  | ||||
| //========================================================================= | ||||
|  | ||||
| #endif // _PLATFORM_H_ | ||||
|  | ||||
		Reference in New Issue
	
	Block a user