Exemple #1
0
        /// <summary>
        /// Dispose the instance
        /// </summary>
        /// <param name="bIsDisposing"></param>
        protected void Dispose(bool bIsDisposing)
        {
            // Check if we have an inbound credential
            if (_inboundCredential.IsValid())
            {
                // Call into security API to release the credentials
                if (SecurityWrapper.FreeCredentialsHandle(ref _inboundCredential) != (int)SecResult.Ok)
                {
                    // Throw an exception
                    throw new Exception("Failed to release inbound credentials handle");
                }

                // Reset inbound credential
                _inboundCredential = new SecurityHandle();
            }

            // Check if we have an outbound credential
            if (_outboundCredential.IsValid())
            {
                // Call into security API to release the credentials
                if (SecurityWrapper.FreeCredentialsHandle(ref _outboundCredential) != (int)SecResult.Ok)
                {
                    // Throw an exception
                    throw new Exception("Failed to release outbound credentials handle");
                }

                // Reset inbound credential
                _outboundCredential = new SecurityHandle();
            }
        }
Exemple #2
0
 static internal extern int AcceptSecurityContext(ref SecurityHandle phCredential,
                                                  ref SecurityHandle phContext,
                                                  ref SecBufferDesc pInput,
                                                  uint fContextReq,
                                                  uint TargetDataRep,
                                                  out SecurityHandle phNewContext,
                                                  out SecBufferDesc pOutput,
                                                  out uint pfContextAttr,
                                                  out SecurityInteger ptsTimeStamp);
Exemple #3
0
 static internal extern int AcquireCredentialsHandle(
     string pszPrincipal,
     string pszPackage,
     int fCredentialUse,
     IntPtr pvLogonID,
     IntPtr pAuthData,
     int pGetKeyFn,
     IntPtr pvGetKeyArgument,
     ref SecurityHandle phCredential,
     ref SecurityInteger ptsExpiry);
Exemple #4
0
 static internal extern int AcquireCredentialsHandle(
     string pszPrincipal,
     string pszPackage,
     int fCredentialUse,
     IntPtr pvLogonID,
     IntPtr pAuthData,
     int pGetKeyFn,
     IntPtr pvGetKeyArgument,
     ref SecurityHandle phCredential,
     ref SecurityInteger ptsExpiry);
Exemple #5
0
 static internal extern int InitializeSecurityContext(ref SecurityHandle phCredential,
                                                      ref SecurityHandle phContext,
                                                      string pszTargetName,
                                                      uint fContextReq,
                                                      int Reserved1,
                                                      uint TargetDataRep,
                                                      ref SecBufferDesc pInput,
                                                      int Reserved2,
                                                      out SecurityHandle phNewContext,
                                                      out SecBufferDesc pOutput,
                                                      out uint pfContextAttr,
                                                      out SecurityInteger ptsTimeStamp);
Exemple #6
0
 static internal extern int InitializeSecurityContext(ref SecurityHandle phCredential,
     ref SecurityHandle phContext,
     string pszTargetName,
     uint fContextReq,
     int Reserved1,
     uint TargetDataRep,
     ref SecBufferDesc pInput,
     int Reserved2,
     out SecurityHandle phNewContext,
     out SecBufferDesc pOutput,
     out uint pfContextAttr,
     out SecurityInteger ptsTimeStamp);
Exemple #7
0
 static internal extern int QuerySecurityContextToken(ref SecurityHandle phContext, ref IntPtr phToken);
Exemple #8
0
 static internal extern int FreeCredentialsHandle(ref SecurityHandle phCredential);
Exemple #9
0
 static internal extern int CompleteAuthToken(ref SecurityHandle phContext, out SecBufferDesc pOutput);
Exemple #10
0
 static internal extern int QuerySecurityContextToken(ref SecurityHandle phContext, ref IntPtr phToken);
Exemple #11
0
 static internal extern int FreeCredentialsHandle(ref SecurityHandle phCredential);
Exemple #12
0
 static internal extern int AcceptSecurityContext(ref SecurityHandle phCredential,
     ref SecurityHandle phContext,
     ref SecBufferDesc pInput,
     uint fContextReq,
     uint TargetDataRep,
     out SecurityHandle phNewContext,
     out SecBufferDesc pOutput,
     out uint pfContextAttr,
     out SecurityInteger ptsTimeStamp);
Exemple #13
0
 static internal extern int CompleteAuthToken(ref SecurityHandle phContext, out SecBufferDesc pOutput);
Exemple #14
0
        /// <summary>
        /// Dispose the instance
        /// </summary>
        /// <param name="bIsDisposing"></param>
        protected void Dispose(bool bIsDisposing)
        {
            // Check if we have an inbound credential
            if (_inboundCredential.IsValid())
            {
                // Call into security API to release the credentials
                if (SecurityWrapper.FreeCredentialsHandle(ref _inboundCredential) != (int)SecResult.Ok)
                {
                    // Throw an exception
                    throw new Exception("Failed to release inbound credentials handle");
                }

                // Reset inbound credential
                _inboundCredential = new SecurityHandle();
            }

            // Check if we have an outbound credential
            if (_outboundCredential.IsValid())
            {
                // Call into security API to release the credentials
                if (SecurityWrapper.FreeCredentialsHandle(ref _outboundCredential) != (int)SecResult.Ok)
                {
                    // Throw an exception
                    throw new Exception("Failed to release outbound credentials handle");
                }

                // Reset inbound credential
                _outboundCredential = new SecurityHandle();
            }
        }