Skip to content
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

Adding HPKE support for crypto operations per RFC-9180 #1146

Merged
merged 18 commits into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions common/src/jni/main/cpp/conscrypt/jniutil.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ JavaVM *gJavaVM;
jclass cryptoUpcallsClass;
jclass openSslInputStreamClass;
jclass nativeRefClass;
jclass nativeRefHpkeCtxClass;

jclass byteArrayClass;
jclass calendarClass;
Expand Down Expand Up @@ -57,6 +58,7 @@ jmethodID buffer_isDirectMethod;
jmethodID cryptoUpcallsClass_rawSignMethod;
jmethodID cryptoUpcallsClass_rsaSignMethod;
jmethodID cryptoUpcallsClass_rsaDecryptMethod;
jmethodID nativeRefHpkeCtxClass_constructor;
jmethodID sslHandshakeCallbacks_verifyCertificateChain;
jmethodID sslHandshakeCallbacks_onSSLStateChange;
jmethodID sslHandshakeCallbacks_clientCertificateRequested;
Expand Down Expand Up @@ -86,6 +88,8 @@ void init(JavaVM* vm, JNIEnv* env) {
env, TO_STRING(JNI_JARJAR_PREFIX) "org/conscrypt/CryptoUpcalls");
nativeRefClass = getGlobalRefToClass(
env, TO_STRING(JNI_JARJAR_PREFIX) "org/conscrypt/NativeRef");
nativeRefHpkeCtxClass = getGlobalRefToClass(
env, TO_STRING(JNI_JARJAR_PREFIX) "org/conscrypt/NativeRef$EVP_HPKE_CTX");
openSslInputStreamClass = getGlobalRefToClass(
env, TO_STRING(JNI_JARJAR_PREFIX) "org/conscrypt/OpenSSLBIOInputStream");
sslHandshakeCallbacksClass = getGlobalRefToClass(
Expand Down Expand Up @@ -145,6 +149,7 @@ void init(JavaVM* vm, JNIEnv* env) {
if (cryptoUpcallsClass_rsaDecryptMethod == nullptr) {
env->FatalError("Could not find rsaDecryptWithPrivateKey");
}
nativeRefHpkeCtxClass_constructor = env->GetMethodID(nativeRefHpkeCtxClass, "<init>", "(J)V");
}

void jniRegisterNativeMethods(JNIEnv* env, const char* className, const JNINativeMethod* gMethods,
Expand Down
Loading