-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Managed classes for AndroidCrypto SSL and X509Certificates #48674
Conversation
We need to use this to get the extensions in the declared order.
Tagging subscribers to this area: @bartonjs, @vcsjones, @krwq, @GrabYourPitchforks Issue Details
cc @jkoritzinsky @steveisok @AaronRobinsonMSFT @bartonjs
|
|
||
public static ICertificatePal FromBlob(ReadOnlySpan<byte> rawData, SafePasswordHandle password, X509KeyStorageFlags keyStorageFlags) | ||
{ | ||
// TODO: [AndroidCrypto] Handle PKCS#12 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The good news is that macOS and Unix-OpenSSL both use a managed PKCS#12 reader/writer to take away a lot of corner case inconsistencies.
But it probably requires that there already be support from the Algorithms layer 😄
src/libraries/System.Net.Security/src/System/Net/Security/SslStreamPal.Android.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The stubs look reasonable to me. Added a networking representative to weigh in on the System.Net.Security parts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generally looks OK to me. Left few comments to consider.
src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_x509.c
Show resolved
Hide resolved
src/libraries/System.Net.Security/src/System/Net/CertificateValidationPal.Android.cs
Outdated
Show resolved
Hide resolved
{ | ||
if (certificateContext != null) | ||
{ | ||
// Make a defensive copy of the certificate. In some async cases the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this is really needed but I know macOS has it there. So it is probably OK to keep.
|
||
namespace System.Net | ||
{ | ||
internal sealed class SafeDeleteSslContext : SafeDeleteContext |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For Windows & Linux SafeDeleteSslContext lives in Common. OSX was here under System.Net.Security. It would make sense to ma to use consistent location. Do you have any preference @stephentoub? We can possibly move it later but since this is new file it may be peer to make sure it its where we want it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the Windows one is actually shared and the Linux one (like OSX and Android) is only used by System.Net.Security
.
I'm going to leave this here for now. Happy to move it (and the OSX one) to common in a follow-up if that is what you / @stephentoub would like.
NotImplementedException
right now, but it is at least a clean split from the existing OpenSSL usageSafeJObjectHandle
for handling deletion of global referencescc @jkoritzinsky @steveisok @AaronRobinsonMSFT @bartonjs