android: Properly handle exceptions when loading keys/certificates

This commit is contained in:
Tobias Brunner 2012-11-21 18:54:51 +01:00
parent 73d0fb0a66
commit 37d42a76d3
1 changed files with 3 additions and 3 deletions

View File

@ -241,7 +241,7 @@ METHOD(charonservice_t, get_trusted_certificates, linked_list_t*,
goto failed;
}
jcerts = (*env)->CallObjectMethod(env, this->vpn_service, method_id, NULL);
if (!jcerts)
if (!jcerts || androidjni_exception_occurred(env))
{
goto failed;
}
@ -273,7 +273,7 @@ METHOD(charonservice_t, get_user_certificate, linked_list_t*,
goto failed;
}
jencodings = (*env)->CallObjectMethod(env, this->vpn_service, method_id);
if (!jencodings)
if (!jencodings || androidjni_exception_occurred(env))
{
goto failed;
}
@ -305,7 +305,7 @@ METHOD(charonservice_t, get_user_key, private_key_t*,
goto failed;
}
jkey = (*env)->CallObjectMethod(env, this->vpn_service, method_id);
if (!jkey)
if (!jkey || androidjni_exception_occurred(env))
{
goto failed;
}