Commit Graph

171 Commits

Author SHA1 Message Date
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
antiduh
a8b98b3a1e More visibility restriction. 2014-06-26 18:04:44 +00:00
antiduh
5b3a92ee66 Implemented the server form. Client <-> Server interaction actually works.
Fixed a few bugs in the CustomServer - wasn't configuring the listen socket correctly, doing read/write operations from the wrong socket, etc. Reworked how the CustomConnection class handles serialization.

Added Disconnected events to the sample's CustomConnection and CustomServer classes so the forms could reset state.
2014-06-26 18:00:50 +00:00
antiduh
81ed80a4d0 Fixed namespaces; Working on server-side UI. 2014-06-25 21:49:35 +00:00
antiduh
2e6b847434 Working on a rough demo client/server app. 2014-06-25 21:28:03 +00:00
antiduh
6dfaa54b63 Added basic functionality to query package information. 2014-06-25 20:14:12 +00:00
antiduh
5f3fd64169 Rough implementation of impersonation. 2014-06-25 20:12:46 +00:00
antiduh
9118815314 Forgot to commit the stub class 2014-06-25 02:49:54 +00:00
antiduh
95195f1214 Working on implementing impersonation. 2014-06-25 02:49:25 +00:00
antiduh
ade72b32f4 Implement the context-completion check I've had sitting half done. 2014-06-25 02:00:05 +00:00
antiduh
14d8ad5db7 Now with consistent namespaces and using statement sorting. 2014-06-25 01:48:52 +00:00
antiduh
ea80cfb1f5 More hiding internals. 2014-06-25 01:32:42 +00:00
antiduh
1577d2de66 More reliability contracts for CERs. 2014-06-25 01:30:03 +00:00
antiduh
e274ce06eb Reduce methods visibility 2014-06-25 01:28:15 +00:00
antiduh
3ee755128f More CER goodness. 2014-06-25 01:26:59 +00:00
antiduh
26888a8b7b Create a similar SafeDecryptMessage that handles the CER crud.
Change the Safe*Message methods to order the parameters the same (even though the Win32 API doesn't..) and to take in the SecureBufferAdapter instead of its handle.
2014-06-25 01:08:29 +00:00
antiduh
2b52e1d84f Helper method for invoking native methods with a CER. 2014-06-24 22:57:02 +00:00
antiduh
8837f3e95c Implemented CERs for encryption and decryption. 2014-06-24 22:51:38 +00:00
antiduh
bf1312cb81 More reliability contracts. 2014-06-24 22:43:40 +00:00
antiduh
d2ca5fa81b Now that all handles are properly sized, no longer need to restrict to 32-bit mode. 2014-06-24 22:35:23 +00:00
antiduh
4f98c9467e Implemented safe access to the safeCredHandle when reading credential name. 2014-06-24 22:34:44 +00:00
antiduh
28a3835060 No need to manually delete the context handle, it's under a safe handle now. 2014-06-24 22:01:26 +00:00
antiduh
56e48dc65d Cleaned up code style and comments 2014-06-24 21:35:32 +00:00
antiduh
766b16e93c Added a little helper to understand the meaning of a SecurityStatus. Don't store the SecurityStatus as an int; we don't need signed semantics and it just complicates comparisons and literals. 2014-06-24 21:10:29 +00:00
antiduh
970c0f2bfa Moved the safe handles for credentials and contexts into their own file. 2014-06-24 20:21:09 +00:00
antiduh
508cd9df49 Move credential native methods to their own file. Create a QueryNameSupport.cs file to hold a couple classes related to implementing that functionality. 2014-06-24 20:19:58 +00:00
antiduh
6b3e395f7c Implemented SafeHandle usage for Context et al. The usage isn't actually safe yet, since I still reference the rawHandle without doing safe (CER) reference counting on the handle. 2014-06-24 19:41:19 +00:00
antiduh
a681cc27c5 Changed the SafeSspiHandle et al to invalidate the underlying handle after releasing it. 2014-06-24 17:41:35 +00:00
antiduh
1fcbf6da72 Added the app.config file to the repo. Updated the svn:ignore property to ignore the .user files. 2014-06-24 03:15:46 +00:00
antiduh
fe14836949 Fixed Credential using a fixed-size 64-bit handle; it's always 2 pointers.
Reworked the Credential handle into a SafeCredentialHandle. We still use references to the raw handle, which is unsafe, but I will hopefully rework that soon.
2014-06-24 03:01:53 +00:00
antiduh
19f2e71e9c Make sure prefer 32-bit is set for now. Not 64-bit safe, because I'm bad at credential handle sizes.. 2014-06-24 01:24:42 +00:00
antiduh
6f5834c716 No longer need unsafe. 2014-06-23 21:50:21 +00:00
antiduh
3ac7fb5ec8 Initial implementation of EncryptMessage and DecryptMessage. 2014-06-23 21:50:12 +00:00
antiduh
9785183f31 Added support for querying the context's user name and authority. Still working my way up to EncryptMessage. 2014-06-23 18:30:26 +00:00
antiduh
1be2b9c7ef Saving work.. working on implementing EncryptMessage. The buffer types and allocation that get passed to the call is really crazy in the sample. 2014-06-23 02:34:36 +00:00