Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 5.6k
avoid allocation of SafeFreeSslCredentials and SafeDeleteSslContext on Linux#69527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
f6d35fd847986611d2821361ef58b4f7cf2c7ff6d258980a2b51f2969c2f79b24a5cde42065a1649d8a36ecbc04b816166b2b387783b89a3de4c24b1ffbbaf3349cc2725305fc81d78c2e7c5f3File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -15,6 +15,7 @@ internal sealed class SafeDeleteNegoContext : SafeDeleteContext | ||
| private SafeGssNameHandle? _targetName; | ||
| private SafeGssContextHandle _context; | ||
| private bool _isNtlmUsed; | ||
| private SafeFreeNegoCredentials? _credential; | ||
| public SafeGssCredHandle AcceptorCredential | ||
| { | ||
| @@ -42,14 +43,17 @@ public SafeGssContextHandle GssContext | ||
| } | ||
| public SafeDeleteNegoContext(SafeFreeNegoCredentials credential) | ||
| : base(credential) | ||
| : base(IntPtr.Zero) | ||
| { | ||
| Debug.Assert((null != credential), "Null credential in SafeDeleteNegoContext"); | ||
| bool added = false; | ||
| credential.DangerousAddRef(ref added); | ||
| _credential = credential; | ||
| _context = new SafeGssContextHandle(); | ||
| } | ||
| public SafeDeleteNegoContext(SafeFreeNegoCredentials credential, string targetName) | ||
| : this(credential) | ||
| : base(IntPtr.Zero) | ||
| { | ||
| try | ||
| { | ||
| @@ -61,6 +65,9 @@ public SafeDeleteNegoContext(SafeFreeNegoCredentials credential, string targetNa | ||
| Dispose(); | ||
| throw; | ||
| } | ||
| _credential = credential; | ||
| bool ignore = false; | ||
| _credential.DangerousAddRef(ref ignore); | ||
wfurt marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| } | ||
| public void SetGssContext(SafeGssContextHandle context) | ||
| @@ -73,6 +80,11 @@ public void SetAuthenticationPackage(bool isNtlmUsed) | ||
| _isNtlmUsed = isNtlmUsed; | ||
| } | ||
| public override bool IsInvalid | ||
| { | ||
| get { return (null == _credential); } | ||
| } | ||
| protected override void Dispose(bool disposing) | ||
| { | ||
| if (disposing) | ||
| @@ -93,5 +105,11 @@ protected override void Dispose(bool disposing) | ||
| } | ||
| base.Dispose(disposing); | ||
| } | ||
| protected override bool ReleaseHandle() | ||
| { | ||
| _credential?.DangerousRelease(); | ||
| return true; | ||
| } | ||
| } | ||
| } | ||
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.