Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Conversation

@kapilash
Copy link
Contributor

SafeFreeCredentials and SafeDeleteContext are used across two native libraries - libssl and System.Net.Security.Native.
Moving these two classes a common location.

@kapilash
Copy link
Contributor Author

This is in response to a PR comment received

@kapilash
Copy link
Contributor Author

cc: @stephentoub

@stephentoub
Copy link
Member

cc: @bartonjs

}
}

internal sealed class SafeDeleteSslContext : SafeDeleteContext
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything left in this file (for example, this class) should be also moved to new files so we can delete the whole libssl directory

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Split the file into different classes. I moved the classes which are under System.Net.Security namespace to $(COMMONPATH)\System\Net\Security\Unix and those in default namespace (Interop.*) to $(COMMONPATH)\Interop\Unix\System.Security.Cryptography.Native
Please let me know if you have any other location in mind

@stephentoub
Copy link
Member

Test Innerloop CentOS7.1 Debug Build and Test please

@kapilash
Copy link
Contributor Author

@dotnet-bot test outerloop rhel7.2 release

@kapilash
Copy link
Contributor Author

Outerloop test failure is due to

    08:38:16 Unhandled Exception: System.InvalidOperationException: This operation is only allowed using a successfully authenticated context.
    08:38:16    at System.Net.Security.SslState.CheckThrow(Boolean authSucessCheck)
    08:38:16    at System.Net.Security.SslState.get_SecureStream()
    08:38:16    at System.Net.Security.SslStream.Read(Byte[] buffer, Int32 offset, Int32 count)
    08:38:16    at System.IO.Stream.<>c.<BeginReadInternal>b__38_0(Object <arg>)
    08:38:16    at System.Threading.Tasks.Task`1.InnerInvoke()
    08:38:16    at System.Threading.Tasks.Task.Execute()
    08:38:16 --- End of stack trace from previous location where exception was thrown ---
    08:38:16    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    08:38:16    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    08:38:16    at System.IO.Stream.EndRead(IAsyncResult asyncResult)
    08:38:16    at System.Net.Security.Tests.DummyTcpServer.OnReceive(IAsyncResult result)
    08:38:16    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
    08:38:16    at System.IO.Stream.ReadWriteTask.System.Threading.Tasks.ITaskCompletionAction.Invoke(Task completingTask)
    08:38:16    at System.Threading.Tasks.Task.FinishContinuations()
    08:38:16    at System.Threading.Tasks.Task.Finish(Boolean bUserDelegateExecuted)
    08:38:16    at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
    08:38:16    at System.Threading.Tasks.Task.ExecuteEntry(Boolean bPreventDoubleExecution)
    08:38:16    at System.Threading.ThreadPoolWorkQueue.Dispatch()
    08:38:30 ./RunTests.sh: line 198: 33435 Aborted                 (core dumped) ./corerun xunit.console.netcore.exe System.Net.Security.Tests.dll -xml testResults.xml -notrait Benchmark=true -notrait category=IgnoreForCI -notrait category=failing -notrait category=nonlinuxtests

I think this is same as #8472 (which should get fixed with new packages)

using System.Diagnostics;
using System.Runtime.InteropServices;
//using System.Security.Authentication;
//using System.Security.Authentication.ExtendedProtection;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These seem like they could be deleted...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you. I missed these. Removed them now

* Corefx does not pinvoke into libssl directly anymore. This commit moves the Interop files in $(COMMONPATH)\Interop\Unix\libssl to $(COMMONPATH)\Interop\Unix\System.Security.Cryptography.Native directory. Likewise, the SecuritySafeHandles are split across different files and are moved to $(COMMONPATH)\System\Net\Security\Unix.
@kapilash
Copy link
Contributor Author

Both the inner loop failures are in System.Runtime.Loader.Tests. Not yet sure why they fail only on CentOS

                        System.Runtime.Loader.Tests.AssemblyLoadContextTest.LoadFromAssemblyName_ValidTrustedPlatformAssembly [FAIL]
      06:51:24       Assert.Throws() Failure
      06:51:24       Expected: typeof(System.IO.FileLoadException)
      06:51:24       Actual:   (No exception was thrown)
      06:51:24       Stack Trace:
      06:51:24             at  System.Runtime.Loader.Tests.AssemblyLoadContextTest.LoadFromAssemblyName_ValidTrustedPlatformAssembly()

@kapilash
Copy link
Contributor Author

@dotnet-bot test outerloop rhel7.2 release

@kapilash
Copy link
Contributor Author

kapilash commented May 18, 2016

@dotnet-bot test Innerloop CentOS7.1 debug

@kapilash
Copy link
Contributor Author

@dotnet-bot test this please

@bartonjs
Copy link
Member

Looks a lot better. Thanks, Hemanth.

@bartonjs bartonjs merged commit b020dfd into dotnet:master May 19, 2016
@karelz karelz modified the milestone: 1.0.0-rtm Dec 3, 2016
@karelz karelz added os-linux Linux OS (any supported distro) and removed X-Plat labels Mar 8, 2017
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
Moving SafeDeleteContext and SafeFreeCredentials to common location

Commit migrated from dotnet/corefx@b020dfd
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Net os-linux Linux OS (any supported distro)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants