コード例 #1
0
        internal static int InitializeSecurityContext(SSPIInterface SecModule, SafeFreeCredentials credential, ref SafeDeleteContext context, string targetName, ContextFlags inFlags, Endianness datarep, SecurityBuffer[] inputBuffers, SecurityBuffer outputBuffer, ref ContextFlags outFlags)
        {
            if (Logging.On)
            {
                Logging.PrintInfo(Logging.Web, string.Concat(new object[] { "InitializeSecurityContext(credential = ", credential.ToString(), ", context = ", ValidationHelper.ToString(context), ", targetName = ", targetName, ", inFlags = ", inFlags, ")" }));
            }
            int num = SecModule.InitializeSecurityContext(credential, ref context, targetName, inFlags, datarep, inputBuffers, outputBuffer, ref outFlags);

            if (Logging.On)
            {
                Logging.PrintInfo(Logging.Web, SR.GetString("net_log_sspi_security_context_input_buffers", new object[] { "InitializeSecurityContext", (inputBuffers == null) ? 0 : inputBuffers.Length, outputBuffer.size, (SecurityStatus)num }));
            }
            return(num);
        }
コード例 #2
0
ファイル: _SSPIWrapper.cs プロジェクト: talha020/corefx
        internal static SecurityStatus InitializeSecurityContext(SSPIInterface SecModule, SafeFreeCredentials credential, ref SafeDeleteContext context, string targetName, SecurityBuffer[] inputBuffers, SecurityBuffer outputBuffer)
        {
            if (Logging.On)
            {
                Logging.PrintInfo(Logging.Web,
                                  "InitializeSecurityContext(" +
                                  "credential = " + credential.ToString() + ", " +
                                  "context = " + Logging.ObjectToString(context) + ", " +
                                  "targetName = " + targetName);
            }

            SecurityStatus errorCode = SecModule.InitializeSecurityContext(credential, ref context, targetName, inputBuffers, outputBuffer);

            return(errorCode);
        }
コード例 #3
0
        internal static int InitializeSecurityContext(SSPIInterface secModule, SafeFreeCredentials credential, ref SafeDeleteContext context, string targetName, Interop.SspiCli.ContextFlags inFlags, Interop.SspiCli.Endianness datarep, SecurityBuffer[] inputBuffers, SecurityBuffer outputBuffer, ref Interop.SspiCli.ContextFlags outFlags)
        {
            if (NetEventSource.IsEnabled)
            {
                NetEventSource.Log.InitializeSecurityContext(credential, context, targetName, inFlags);
            }

            int errorCode = secModule.InitializeSecurityContext(credential, ref context, targetName, inFlags, datarep, inputBuffers, outputBuffer, ref outFlags);

            if (NetEventSource.IsEnabled)
            {
                NetEventSource.Log.SecurityContextInputBuffers(nameof(InitializeSecurityContext), inputBuffers?.Length ?? 0, outputBuffer.size, (Interop.SECURITY_STATUS)errorCode);
            }

            return(errorCode);
        }
コード例 #4
0
ファイル: SSPIWrapper.cs プロジェクト: yetanotherchris/corefx
        internal static int InitializeSecurityContext(SSPIInterface secModule, SafeFreeCredentials credential, ref SafeDeleteContext context, string targetName, Interop.SspiCli.ContextFlags inFlags, Interop.SspiCli.Endianness datarep, SecurityBuffer[] inputBuffers, SecurityBuffer outputBuffer, ref Interop.SspiCli.ContextFlags outFlags)
        {
            if (SecurityEventSource.Log.IsEnabled())
            {
                SecurityEventSource.Log.InitializeSecurityContext(credential.ToString(),
                                                                  LoggingHash.ObjectToString(context),
                                                                  targetName,
                                                                  inFlags);
            }

            int errorCode = secModule.InitializeSecurityContext(credential, ref context, targetName, inFlags, datarep, inputBuffers, outputBuffer, ref outFlags);

            if (SecurityEventSource.Log.IsEnabled())
            {
                SecurityEventSource.Log.SecurityContextInputBuffers(nameof(InitializeSecurityContext), (inputBuffers == null ? 0 : inputBuffers.Length), outputBuffer.size, (Interop.SECURITY_STATUS)errorCode);
            }

            return(errorCode);
        }
コード例 #5
0
ファイル: SSPIWrapper.cs プロジェクト: michaelaird/corefx
        internal static int InitializeSecurityContext(SSPIInterface secModule, ref SafeFreeCredentials credential, ref SafeDeleteContext context, string targetName, Interop.Secur32.ContextFlags inFlags, Interop.Secur32.Endianness datarep, SecurityBuffer inputBuffer, SecurityBuffer outputBuffer, ref Interop.Secur32.ContextFlags outFlags)
        {
            if (SecurityEventSource.Log.IsEnabled())
            {
                SecurityEventSource.Log.InitializeSecurityContext(credential.ToString(),
                                                                  LoggingHash.ObjectToString(context),
                                                                  targetName,
                                                                  inFlags);
            }

            int errorCode = secModule.InitializeSecurityContext(ref credential, ref context, targetName, inFlags, datarep, inputBuffer, outputBuffer, ref outFlags);

            if (SecurityEventSource.Log.IsEnabled())
            {
                SecurityEventSource.Log.SecurityContextInputBuffer("InitializeSecurityContext", (inputBuffer == null ? 0 : inputBuffer.size), outputBuffer.size, (Interop.SecurityStatus)errorCode);
            }

            return(errorCode);
        }
コード例 #6
0
ファイル: _SSPIWrapper.cs プロジェクト: talha020/corefx
        internal static SecurityStatus InitializeSecurityContext(SSPIInterface SecModule, ref SafeFreeCredentials credential, ref SafeDeleteContext context, string targetName, SecurityBuffer inputBuffer, SecurityBuffer outputBuffer)
        {
            if (Logging.On)
            {
                Logging.PrintInfo(Logging.Web,
                                  "InitializeSecurityContext(" +
                                  "credential = " + credential.ToString() + ", " +
                                  "context = " + Logging.ObjectToString(context) + ", " +
                                  "targetName = " + targetName);
            }


            SecurityStatus errorCode = SecModule.InitializeSecurityContext(ref credential, ref context, targetName, inputBuffer, outputBuffer);

            if (Logging.On)
            {
                Logging.PrintInfo(Logging.Web, SR.Format(SR.net_log_sspi_security_context_input_buffer, "InitializeSecurityContext", (inputBuffer == null ? 0 : inputBuffer.size), outputBuffer.size, (SecurityStatus)errorCode));
            }

            return(errorCode);
        }
コード例 #7
0
        internal static int InitializeSecurityContext(SSPIInterface SecModule, SafeFreeCredentials credential, ref SafeDeleteContext context, string targetName, ContextFlags inFlags, Endianness datarep, SecurityBuffer[] inputBuffers, SecurityBuffer outputBuffer, ref ContextFlags outFlags)
        {
            if (Logging.On)
            {
                Logging.PrintInfo(Logging.Web,
                                  "InitializeSecurityContext(" +
                                  "credential = " + credential.ToString() + ", " +
                                  "context = " + ValidationHelper.ToString(context) + ", " +
                                  "targetName = " + targetName + ", " +
                                  "inFlags = " + inFlags + ")");
            }

            int errorCode = SecModule.InitializeSecurityContext(credential, ref context, targetName, inFlags, datarep, inputBuffers, outputBuffer, ref outFlags);

            if (Logging.On)
            {
                Logging.PrintInfo(Logging.Web, SR.GetString(SR.net_log_sspi_security_context_input_buffers, "InitializeSecurityContext", (inputBuffers == null ? 0 : inputBuffers.Length), outputBuffer.size, (SecurityStatus)errorCode));
            }

            return(errorCode);
        }
コード例 #8
0
ファイル: _SSPIWrapper.cs プロジェクト: ikopylov/corefx
        internal static int InitializeSecurityContext(SSPIInterface secModule, ref SafeFreeCredentials credential, ref SafeDeleteContext context, string targetName, Interop.Secur32.ContextFlags inFlags, Interop.Secur32.Endianness datarep, SecurityBuffer inputBuffer, SecurityBuffer outputBuffer, ref Interop.Secur32.ContextFlags outFlags)
        {
            if (Logging.On)
            {
                Logging.PrintInfo(Logging.Web,
                                  "InitializeSecurityContext(" +
                                  "credential = " + credential.ToString() + ", " +
                                  "context = " + Logging.ObjectToString(context) + ", " +
                                  "targetName = " + targetName + ", " +
                                  "inFlags = " + inFlags + ")");
            }

            int errorCode = secModule.InitializeSecurityContext(ref credential, ref context, targetName, inFlags, datarep, inputBuffer, outputBuffer, ref outFlags);

            if (Logging.On)
            {
                Logging.PrintInfo(Logging.Web, SR.Format(SR.net_log_sspi_security_context_input_buffer, "InitializeSecurityContext", (inputBuffer == null ? 0 : inputBuffer.size), outputBuffer.size, (Interop.SecurityStatus)errorCode));
            }

            return(errorCode);
        }
コード例 #9
0
        InitializeSecurityContext(SSPIInterface SecModule,
                                  long credential,
                                  long context,
                                  string targetName,
                                  int requirements,
                                  Endianness datarep,
                                  SecurityBufferClass[] inputBuffers,
                                  ref long newContext,
                                  SecurityBufferClass[] outputBuffers,
                                  ref int attributes,
                                  ref long timestamp
                                  )
        {
            GlobalLog.Enter("InitializeSecurityContext#2");
            GlobalLog.Print("SSPIWrapper::InitializeSecurityContext#2()");
            GCHandle[] handleOut = null;
            GCHandle[] handleIn  = null;

            if (outputBuffers != null)
            {
                handleOut = PinBuffers(outputBuffers);
            }

            int errorCode = 0;

            SecurityBufferDescriptor outSecurityBufferDescriptor = new SecurityBufferDescriptor(outputBuffers);

            if (inputBuffers == null)
            {
                GlobalLog.Print("SSPIWrapper::InitializeSecurityContext#2(): inputBuffers == null");
                errorCode = SecModule.InitializeSecurityContext(
                    ref credential,
                    IntPtr.Zero,
                    targetName,
                    requirements,
                    0,
                    (int)datarep,
                    IntPtr.Zero,
                    0,
                    ref newContext,
                    ref outSecurityBufferDescriptor,
                    ref attributes,
                    ref timestamp
                    );
            }
            else
            {
                handleIn = PinBuffers(inputBuffers);

                SecurityBufferDescriptor inSecurityBufferDescriptor = new SecurityBufferDescriptor(inputBuffers);

                errorCode = SecModule.InitializeSecurityContext(
                    ref credential,
                    ref context,
                    targetName,
                    requirements,
                    0,
                    (int)datarep,
                    ref inSecurityBufferDescriptor,
                    0,
                    ref newContext,
                    ref outSecurityBufferDescriptor,
                    ref attributes,
                    ref timestamp
                    );

                inSecurityBufferDescriptor.FreeAllBuffers(0);
            }

            if ((errorCode == 0) || (errorCode == (int)SecurityStatus.ContinueNeeded))
            {
                SecurityBufferClass[] result = outSecurityBufferDescriptor.marshall();

                for (int k = 0; k < outputBuffers.Length; k++)
                {
                    outputBuffers[k] = result[k];
                }
            }
            outSecurityBufferDescriptor.FreeAllBuffers(requirements);
            if (handleOut != null)
            {
                FreeGCHandles(handleOut);
            }
            if (handleIn != null)
            {
                FreeGCHandles(handleIn);
            }
            GlobalLog.Leave("InitializeSecurityContext#2");
            return(errorCode);
        }
コード例 #10
0
 internal static int InitializeSecurityContext(SSPIInterface SecModule, SafeFreeCredentials credential, ref SafeDeleteContext context, string targetName, ContextFlags inFlags, Endianness datarep, SecurityBuffer[] inputBuffers, SecurityBuffer outputBuffer, ref ContextFlags outFlags)
 {
     if (Logging.On)
     {
         Logging.PrintInfo(Logging.Web, string.Concat(new object[] { "InitializeSecurityContext(credential = ", credential.ToString(), ", context = ", ValidationHelper.ToString(context), ", targetName = ", targetName, ", inFlags = ", inFlags, ")" }));
     }
     int num = SecModule.InitializeSecurityContext(credential, ref context, targetName, inFlags, datarep, inputBuffers, outputBuffer, ref outFlags);
     if (Logging.On)
     {
         Logging.PrintInfo(Logging.Web, SR.GetString("net_log_sspi_security_context_input_buffers", new object[] { "InitializeSecurityContext", (inputBuffers == null) ? 0 : inputBuffers.Length, outputBuffer.size, (SecurityStatus) num }));
     }
     return num;
 }