Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e2b066c5 authored by Chung-yih Wang's avatar Chung-yih Wang Committed by Android Git Automerger
Browse files

am 19145237: Forgot to convert the jstring to char* in certificate request.

Merge commit '19145237'

* commit '19145237':
  Forgot to convert the jstring to char* in certificate request.
parents dfe673a5 19145237
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -30,13 +30,17 @@ jstring
android_security_CertTool_generateCertificateRequest(JNIEnv* env,
                                                     jobject thiz,
                                                     jint bits,
                                                     jstring subject)
                                                     jstring jChallenge)

{
    int ret = -1;
    jboolean bIsCopy;
    char csr[REPLY_MAX];
    if (gen_csr(bits, subject, csr) == 0) {
        return (*env)->NewStringUTF(env, csr);
    }
    const char* challenge = (*env)->GetStringUTFChars(env, jChallenge, &bIsCopy);

    ret = gen_csr(bits, challenge , csr);
    (*env)->ReleaseStringUTFChars(env, jChallenge, challenge);
    if (ret == 0) return (*env)->NewStringUTF(env, csr);
    return NULL;
}