Lines Matching defs:env

52     static int jniThrowException(JNIEnv* env, const char* className, const char* msg) {
53 jclass exceptionClass = env->FindClass(className);
61 if (env->ThrowNew(exceptionClass, msg) != JNI_OK) {
67 env->DeleteLocalRef(exceptionClass);
74 static int jniThrowRuntimeException(JNIEnv* env, const char* msg) {
75 return jniThrowException(env, "java/lang/RuntimeException", msg);
81 static int jniThrowNullPointerException(JNIEnv* env, const char* msg) {
82 return jniThrowException(env, "java/lang/NullPointerException", msg);
88 static int jniThrowOutOfMemory(JNIEnv* env, const char* message) {
89 return jniThrowException(env, "java/lang/OutOfMemoryError", message);
95 static int throwBadPaddingException(JNIEnv* env, const char* message) {
97 return jniThrowException(env, "javax/crypto/BadPaddingException", message);
103 static int throwSignatureException(JNIEnv* env, const char* message) {
105 return jniThrowException(env, "java/security/SignatureException", message);
111 static int throwInvalidKeyException(JNIEnv* env, const char* message) {
113 return jniThrowException(env, "java/security/InvalidKeyException", message);
119 static int throwIllegalBlockSizeException(JNIEnv* env, const char* message) {
121 return jniThrowException(env, "javax/crypto/IllegalBlockSizeException", message);
127 static int throwNoSuchAlgorithmException(JNIEnv* env, const char* message) {
129 return jniThrowException(env, "java/security/NoSuchAlgorithmException", message);
135 static int throwIOException(JNIEnv* env, const char* message) {
137 return jniThrowException(env, "java/io/IOException", message);
143 static int throwParsingException(JNIEnv* env, const char* message) {
144 return jniThrowException(env, TO_STRING(JNI_JARJAR_PREFIX) "org/conscrypt/OpenSSLX509CertificateFactory$ParsingException",
148 static int throwInvalidAlgorithmParameterException(JNIEnv* env, const char* message) {
150 return jniThrowException(env, "java/security/InvalidAlgorithmParameterException", message);
153 static int throwForAsn1Error(JNIEnv* env, int reason, const char* message,
169 return throwInvalidKeyException(env, message);
173 return throwNoSuchAlgorithmException(env, message);
176 return defaultThrow(env, message);
179 static int throwForCipherError(JNIEnv* env, int reason, const char* message,
183 return throwBadPaddingException(env, message);
187 return throwIllegalBlockSizeException(env, message);
192 return throwInvalidKeyException(env, message);
195 return defaultThrow(env, message);
198 static int throwForEvpError(JNIEnv* env, int reason, const char* message,
202 return throwInvalidKeyException(env, message);
208 return throwNoSuchAlgorithmException(env, message);
212 return throwInvalidKeyException(env, message);
217 return throwNoSuchAlgorithmException(env, message);
221 return defaultThrow(env, message);
226 static int throwForRsaError(JNIEnv* env, int reason, const char* message,
234 return throwBadPaddingException(env, message);
240 return throwSignatureException(env, message);
243 return throwNoSuchAlgorithmException(env, message);
247 return throwInvalidKeyException(env, message);
250 return throwIllegalBlockSizeException(env, message);
253 return defaultThrow(env, message);
256 static int throwForX509Error(JNIEnv* env, int reason, const char* message,
260 return throwNoSuchAlgorithmException(env, message);
263 return defaultThrow(env, message);
275 JNIEnv* env, CONSCRYPT_UNUSED const char* location,
294 throwForRsaError(env, reason, message, defaultThrow);
297 throwForAsn1Error(env, reason, message, defaultThrow);
300 throwForCipherError(env, reason, message, defaultThrow);
303 throwForEvpError(env, reason, message, defaultThrow);
306 throwForX509Error(env, reason, message, defaultThrow);
309 throwInvalidKeyException(env, message);
312 defaultThrow(env, message);
325 static int throwSocketTimeoutException(JNIEnv* env, const char* message) {
327 return jniThrowException(env, "java/net/SocketTimeoutException", message);
333 static int throwSSLHandshakeExceptionStr(JNIEnv* env, const char* message) {
335 return jniThrowException(env, "javax/net/ssl/SSLHandshakeException", message);
341 static int throwSSLExceptionStr(JNIEnv* env, const char* message) {
343 return jniThrowException(env, "javax/net/ssl/SSLException", message);
349 static int throwSSLProtocolExceptionStr(JNIEnv* env, const char* message) {
351 return jniThrowException(env, "javax/net/ssl/SSLProtocolException", message);
358 * @param env the JNI environment
365 JNIEnv* env, SSL* ssl, int sslErrorCode, const char* message,
413 int ret = actualThrow(env, message);
464 ret = throwSSLProtocolExceptionStr(env, allocStr);
466 ret = actualThrow(env, allocStr);