-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[Android] Use Android SDK instead of OpenSSL where possible #43740
Conversation
Tagging subscribers to this area: @dotnet/ncl |
tools-local/tasks/mobile.tasks/AndroidAppBuilder/Templates/MonoRunner.java
Show resolved
Hide resolved
src/libraries/Native/Unix/System.Security.Cryptography.Native/android_security.c
Outdated
Show resolved
Hide resolved
src/libraries/Native/Unix/System.Security.Cryptography.Native/android_security.c
Outdated
Show resolved
Hide resolved
src/libraries/Native/Unix/System.Security.Cryptography.Native/android_security.c
Outdated
Show resolved
Hide resolved
src/libraries/Native/Unix/System.Security.Cryptography.Native/android_security.h
Outdated
Show resolved
Hide resolved
src/libraries/Native/Unix/System.Security.Cryptography.Native/android_security.c
Outdated
Show resolved
Hide resolved
src/libraries/Native/Unix/System.Security.Cryptography.Native/android_security.c
Outdated
Show resolved
Hide resolved
src/libraries/Native/Unix/System.Security.Cryptography.Native/android_security.c
Outdated
Show resolved
Hide resolved
Overall Aside: you cannot rely on "normal" JNI Local Reference semantics, in which JNI Local References are "automatically freed." You can't rely on this for two reasons:
Consequently, every time you invoke a JNI method which returns a JNI local reference -- which is most of them! -- you must ensure that you call |
src/libraries/Native/Unix/System.Security.Cryptography.Native/android_security.c
Outdated
Show resolved
Hide resolved
src/libraries/Native/Unix/System.Security.Cryptography.Native/android_security.c
Outdated
Show resolved
Hide resolved
src/libraries/Native/Unix/System.Security.Cryptography.Native/android_security.c
Outdated
Show resolved
Hide resolved
src/libraries/Native/Unix/System.Security.Cryptography.Native/android_security.c
Outdated
Show resolved
Hide resolved
@jonpryor thank you so much, amazing feedback! |
src/libraries/Native/Unix/System.Security.Cryptography.Native/android_security.c
Outdated
Show resolved
Hide resolved
src/libraries/Native/Unix/System.Security.Cryptography.Native/android_security.c
Outdated
Show resolved
Hide resolved
src/libraries/Native/Unix/System.Security.Cryptography.Native/android_security.c
Outdated
Show resolved
Hide resolved
src/libraries/Native/Unix/System.Security.Cryptography.Native/android_security.c
Outdated
Show resolved
Hide resolved
src/libraries/Native/Unix/System.Security.Cryptography.Native/openssl.c
Outdated
Show resolved
Hide resolved
@jonpryor could you please re-review? I've added error handling here and there but in general, the managed code on top of it is responsible for input validation like buffers' lengths, non-negative or out-of-bounds indices, etc. |
This PR redirects all
RandomNumberGenerator
,MD5
,Sha1-512
,HMAC
andAES
APIs to use Android SDK instead of OpenSSL.