Working on writing comments and documentation.
This commit is contained in:
@@ -7,69 +7,161 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace NSspi
|
namespace NSspi
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Stores information about a particular security package.
|
||||||
|
/// </summary>
|
||||||
[StructLayout( LayoutKind.Sequential )]
|
[StructLayout( LayoutKind.Sequential )]
|
||||||
public class SecPkgInfo
|
public class SecPkgInfo
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The packages capabilities and options.
|
||||||
|
/// </summary>
|
||||||
public SecPkgCapability Capabilities;
|
public SecPkgCapability Capabilities;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The package's version number.
|
||||||
|
/// </summary>
|
||||||
public short Version;
|
public short Version;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The package's Id when used in RPC contexts.
|
||||||
|
/// </summary>
|
||||||
public short RpcId;
|
public short RpcId;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The maximum size, in bytes, of tokens generated by the package.
|
||||||
|
/// </summary>
|
||||||
public int MaxTokenLength;
|
public int MaxTokenLength;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The human-readable name of the package.
|
||||||
|
/// </summary>
|
||||||
[MarshalAs( UnmanagedType.LPWStr )]
|
[MarshalAs( UnmanagedType.LPWStr )]
|
||||||
public string Name;
|
public string Name;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A short description of the package.
|
||||||
|
/// </summary>
|
||||||
[MarshalAs( UnmanagedType.LPWStr )]
|
[MarshalAs( UnmanagedType.LPWStr )]
|
||||||
public string Comment;
|
public string Comment;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Describes the capabilities of a security package.
|
||||||
|
/// </summary>
|
||||||
[Flags]
|
[Flags]
|
||||||
public enum SecPkgCapability : uint
|
public enum SecPkgCapability : uint
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Whether the package supports generating messages with integrity information. Required for MakeSignature and VerifySignature.
|
||||||
|
/// </summary>
|
||||||
Integrity = 0x1,
|
Integrity = 0x1,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether the package supports generating encrypted messages. Required for EncryptMessage and DecryptMessage.
|
||||||
|
/// </summary>
|
||||||
Privacy = 0x2,
|
Privacy = 0x2,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether the package uses any other buffer information than token buffers.
|
||||||
|
/// </summary>
|
||||||
TokenOnly = 0x4,
|
TokenOnly = 0x4,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether the package supports datagram-style authentication.
|
||||||
|
/// </summary>
|
||||||
Datagram = 0x8,
|
Datagram = 0x8,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether the package supports creating contexts with connection semantics
|
||||||
|
/// </summary>
|
||||||
Connection = 0x10,
|
Connection = 0x10,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Multiple legs are neccessary for authentication.
|
||||||
|
/// </summary>
|
||||||
MultiLeg = 0x20,
|
MultiLeg = 0x20,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Server authentication is not supported.
|
||||||
|
/// </summary>
|
||||||
ClientOnly = 0x40,
|
ClientOnly = 0x40,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Supports extended error handling facilities.
|
||||||
|
/// </summary>
|
||||||
ExtendedError = 0x80,
|
ExtendedError = 0x80,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Supports client impersonation on the server.
|
||||||
|
/// </summary>
|
||||||
Impersonation = 0x100,
|
Impersonation = 0x100,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Understands Windows princple and target names.
|
||||||
|
/// </summary>
|
||||||
AcceptWin32Name = 0x200,
|
AcceptWin32Name = 0x200,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Supports stream semantics
|
||||||
|
/// </summary>
|
||||||
Stream = 0x400,
|
Stream = 0x400,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Package may be used by the Negiotiate meta-package.
|
||||||
|
/// </summary>
|
||||||
Negotiable = 0x800,
|
Negotiable = 0x800,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Compatible with GSS.
|
||||||
|
/// </summary>
|
||||||
GssCompatible = 0x1000,
|
GssCompatible = 0x1000,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Supports LsaLogonUser
|
||||||
|
/// </summary>
|
||||||
Logon = 0x2000,
|
Logon = 0x2000,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Token buffers are in Ascii format.
|
||||||
|
/// </summary>
|
||||||
AsciiBuffers = 0x4000,
|
AsciiBuffers = 0x4000,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Supports separating large tokens into multiple buffers.
|
||||||
|
/// </summary>
|
||||||
Fragment = 0x8000,
|
Fragment = 0x8000,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Supports mutual authentication between a client and server.
|
||||||
|
/// </summary>
|
||||||
MutualAuth = 0x10000,
|
MutualAuth = 0x10000,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Supports credential delegation from the server to a third context.
|
||||||
|
/// </summary>
|
||||||
Delegation = 0x20000,
|
Delegation = 0x20000,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Supports calling EncryptMessage with the read-only-checksum flag, which protects data only
|
||||||
|
/// with a checksum and does not encrypt it.
|
||||||
|
/// </summary>
|
||||||
ReadOnlyChecksum = 0x40000,
|
ReadOnlyChecksum = 0x40000,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether the package supports handling restricted tokens, which are tokens derived from existing tokens
|
||||||
|
/// that have had restrictions placed on them.
|
||||||
|
/// </summary>
|
||||||
RestrictedTokens = 0x80000,
|
RestrictedTokens = 0x80000,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Extends the negotiate package; only one such package may be registered at any time.
|
||||||
|
/// </summary>
|
||||||
ExtendsNego = 0x00100000,
|
ExtendsNego = 0x00100000,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// This package is negotiated by the package of type ExtendsNego.
|
||||||
|
/// </summary>
|
||||||
Negotiable2 = 0x00200000,
|
Negotiable2 = 0x00200000,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,11 +22,34 @@ namespace NSspi
|
|||||||
|
|
||||||
public enum SecurityStatus : uint
|
public enum SecurityStatus : uint
|
||||||
{
|
{
|
||||||
// Success / Informational
|
// --- Success / Informational ---
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The request completed successfully
|
||||||
|
/// </summary>
|
||||||
OK = 0x00000000,
|
OK = 0x00000000,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The token returned by the context needs to be provided to the cooperating party
|
||||||
|
/// to continue construction of the context.
|
||||||
|
/// </summary>
|
||||||
ContinueNeeded = 0x00090312,
|
ContinueNeeded = 0x00090312,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Occurs after a client calls InitializeSecurityContext to indicate that the client
|
||||||
|
/// must call CompleteAuthToken.
|
||||||
|
/// </summary>
|
||||||
CompleteNeeded = 0x00090313,
|
CompleteNeeded = 0x00090313,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Occurs after a client calls InitializeSecurityContext to indicate that the client
|
||||||
|
/// must call CompleteAuthToken and pass the result to the server.
|
||||||
|
/// </summary>
|
||||||
CompAndContinue = 0x00090314,
|
CompAndContinue = 0x00090314,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// An attempt to use the context was performed after the context's expiration time elapsed.
|
||||||
|
/// </summary>
|
||||||
ContextExpired = 0x00090317,
|
ContextExpired = 0x00090317,
|
||||||
CredentialsNeeded = 0x00090320,
|
CredentialsNeeded = 0x00090320,
|
||||||
Renegotiate = 0x00090321,
|
Renegotiate = 0x00090321,
|
||||||
|
|||||||
Reference in New Issue
Block a user