diff options
author | Chung-yih Wang <cywang@google.com> | 2009-07-28 15:15:51 +0800 |
---|---|---|
committer | Chung-yih Wang <cywang@google.com> | 2009-07-28 15:18:22 +0800 |
commit | 191452378639f1135c9591e21911ce250d140769 (patch) | |
tree | f92f5aae2ba422aca3bcd83992176a6e55c097b1 /keystore | |
parent | d0021dcae7f474c062f23a449bdd18be5e882d7e (diff) | |
download | frameworks_base-191452378639f1135c9591e21911ce250d140769.zip frameworks_base-191452378639f1135c9591e21911ce250d140769.tar.gz frameworks_base-191452378639f1135c9591e21911ce250d140769.tar.bz2 |
Forgot to convert the jstring to char* in certificate request.
Diffstat (limited to 'keystore')
-rw-r--r-- | keystore/jni/certtool.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/keystore/jni/certtool.c b/keystore/jni/certtool.c index 1ae8dab..b36b34a 100644 --- a/keystore/jni/certtool.c +++ b/keystore/jni/certtool.c @@ -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; } |