Commit Graph

155 Commits

Author SHA1 Message Date
antiduh c1a9712bd4 Variable freeStatus is not used. 2014-07-01 21:19:15 +00:00
antiduh c37e241312 No longer used. 2014-07-01 19:18:03 +00:00
antiduh 7503d37770 Updated comments. 2014-07-01 19:17:56 +00:00
antiduh ce64bf9d9a Simplified object lifecycle verification. 2014-07-01 18:40:35 +00:00
antiduh 2e6962bcc0 Removed the finalizer from Credential. The unmanaged resources are captured by other managed objects, who themselves are finalizable objects (usually CriticalFinalizerObject or SafeHandles). 2014-07-01 18:39:16 +00:00
antiduh b742dbbff4 Simplified lifecycle (initialized, disposed) checks. 2014-07-01 18:36:16 +00:00
antiduh 306fe44cc1 Added more disposed checks. 2014-07-01 18:32:44 +00:00
antiduh e980e11184 Modified the initialization process a little to better control when a context is marked as initialized. 2014-07-01 18:31:33 +00:00
antiduh 5403321a49 Removed the finalizer from Context. The unmanaged resources are captured by other managed objects, who themselves are finalizable objects (usually CriticalFinalizerObject or SafeHandles). 2014-07-01 18:19:11 +00:00
antiduh c8ae206306 Removed todo 2014-07-01 18:15:03 +00:00
antiduh bce9d7b81c Added license. 2014-07-01 18:10:17 +00:00
antiduh db4d5f7d03 Added a Readme. 2014-07-01 18:07:47 +00:00
antiduh 894eb60161 Moved the simple demo code to its own project so that the NSspi.csproj project could be a standard dll, and not a referenced exe assembly. 2014-07-01 15:57:58 +00:00
antiduh b8fd4d9a07 Added a helpful flag to ServerContext to indicate to consumers whether it can support impersonation. Added checks to throw exceptions if impersonation is attempted on a ServerContext that does not support impersonation. Also modified the disposal behavior so that if the ServerContext is disposed while impersonation is occurring, impersonation is explicitly reverted. Consumers wishing to perform long-term impersonation must hold valid references to both the context and impersonation handle. 2014-07-01 15:52:00 +00:00
antiduh aed206e1be Working on writing comments and documentation. 2014-07-01 02:10:53 +00:00
antiduh f65ca7aaaa Added length validation to the Decrypt and VerifySignature methods. 2014-07-01 01:20:08 +00:00
antiduh e86fea598d Refactored the common code in ClientCredential and ServerCredential to a common class, CurrentCredential. 2014-07-01 01:13:33 +00:00
antiduh fcacd2195b Implemented a simple impersonation demo. 2014-06-30 20:09:42 +00:00
antiduh a41e35dc84 CredentialType.cs no longer used. 2014-06-30 20:09:17 +00:00
antiduh dec1509835 Refactored Credential et al so that the security package is provided by name (string), and not an enum. Security packages are runtime enumerable, and new ones may be created that we don't have any idea of. 2014-06-30 15:36:20 +00:00
antiduh 5da12ad4c4 Split the Credential init code off into each concrete credential. 2014-06-30 15:32:31 +00:00
antiduh 372460a78f Reworking Credential so that it can be extended by a third party for adapting to other means of acquiring credentials. 2014-06-30 15:23:12 +00:00
antiduh 9d0403ead6 More ReliabilityContracts for finalizer code. 2014-06-30 15:17:51 +00:00
antiduh 798d6be4ad Added more disposed checks. 2014-06-30 15:05:38 +00:00
antiduh 04df802e54 Add ReliabilityContract for the ReleaseHandle on SafeSspiHandle so that it can fully participate in the implicit CER that is created during finalization. 2014-06-30 15:05:29 +00:00
antiduh 6ed1ab5f76 Added more disposed checks. 2014-06-30 14:49:26 +00:00
antiduh 0070e94aed Changed the demo's ServerForm to display the client's username when a client connects. 2014-06-30 14:40:39 +00:00
antiduh cec7b8b88f Switch the rest of the API to the new TimeStamp structure. Fix the TimeStamp structure to handle dates that are past the upper limit of DateTime.MaxValue. 2014-06-29 16:39:42 +00:00
antiduh 5272979f19 Reworked the Expiry support to expose it in the first place, and to store and present it as a DateTime object. 2014-06-29 14:24:58 +00:00
antiduh bc97ef64ae Removed unused test code 2014-06-29 14:21:20 +00:00
antiduh 60ea145e86 Increase the reliability of QueryCredentialsAttribute_Name usage by wrapping a try-finally around the allocation that happens inside the CER. 2014-06-28 16:46:21 +00:00
antiduh 241da896b1 Implemented the ability to query the EnumerateSecurityPackages native API safely. 2014-06-27 22:00:18 +00:00
antiduh 7e5f2a6308 Fixed the demo's CustomServer confusion over Disconnected - it was firing it when a full shutdown occurred, not just when the current client disconnected. Created a second Stopped event to track when the full shutdown actually occurs; still not used by UI. 2014-06-27 21:59:19 +00:00
antiduh 7512b11a66 Implement signed message passing in the UIs. 2014-06-27 18:01:46 +00:00
antiduh 55969a41f5 Comments. 2014-06-27 17:41:28 +00:00
antiduh cbaf311339 Improve the reliability of the SecureBufferAdapter, so that we can make stronger guarantees that the held GC handles will be released even if the object is leaked.
Also, I added guarding in the Dispose(false) method so that we don't accidentally try to release a handle that was never allocated, possibly causing us to throw an exception and fail to release the handles further down the execution.
2014-06-27 17:40:03 +00:00
antiduh c1b7785440 Reorganized the project to put the library one folder down. 2014-06-27 14:38:28 +00:00
antiduh ffb7e36edb Helper methods to safely invoke the VerifySignature and MakeSignature native methods. 2014-06-27 01:52:42 +00:00
antiduh 4224193f6f CERs around the handle usage in MakeSignature and VerifySignature 2014-06-27 01:47:43 +00:00
antiduh fc9daf3611 Fix ImpersonationHandle so that it survives multiple disposes. 2014-06-27 01:43:08 +00:00
antiduh 85288a9dae Implemented message signature and validation. 2014-06-27 01:29:03 +00:00
antiduh 9310dde83b Rearrange the conditionals so that I always perform the Free if I got back a non-zero pointer, but only perform the Marshal if I got back a valid pointer and a good status code. 2014-06-27 00:18:31 +00:00
antiduh b55c367caa Better protection against leaking handles - use a nested try-finally when allocating inside a CER. The inner finally protects against the case where the PtrToStructure, which allocates, fails. 2014-06-26 23:43:14 +00:00
antiduh c9a4e69dc3 Fixed spelling. 2014-06-26 23:40:35 +00:00
antiduh 0506420ab4 Reconstruct the context after it's done. 2014-06-26 21:56:06 +00:00
antiduh ef8094d9da Fixed server shutdown. 2014-06-26 21:55:51 +00:00
antiduh 3136c0d3b2 Fixed the server form state machine to set that we're back to initializing on disconnect. 2014-06-26 21:47:18 +00:00
antiduh 6d4fc877ec Slowly trying to make this thing work reliably when restarting the demo. 2014-06-26 21:39:58 +00:00
antiduh f91402ef4b Renamed the client and server forms to have their role in the name. 2014-06-26 20:59:32 +00:00
antiduh 8b032cb871 These files were moved. 2014-06-26 20:59:02 +00:00