be361cf9ce25c704982422ef47c4f4354daf3d9f |
|
12-Feb-2018 |
Adam Vartanian <flooey@gmail.com> |
Clean up exception throwing in native code. (#417) Change throwExceptionIfNecessary to throwExceptionFromBoringSSLError. The definition changes from throwing an exception if there's an error on the stack to having a precondition of having an error on the stack. This makes its behavior and the expected usage more clear (it always results in an exception pending). This also should let us know if we're encountering return-failure-but-don't-stack-an-error situations that we didn't know about. Normalize function names to throwFooException. Ensure that we always return immediately after throwing an exception. Some call sites allowed the exception-throwing branch to fall through to the return statement from a non-throwing branch, which is unclear, since that return statement is useless, and runs the risk of additional code being inserted after the exception. Fixes #97.
/external/conscrypt/common/src/jni/main/cpp/conscrypt/jniutil.cc
|
70eb95881de277fce5b386a7b259892af090f2e6 |
|
06-Dec-2017 |
Adam Vartanian <flooey@gmail.com> |
Check if an exception is pending before throwing another one. (#386) This can occur if a BoringSSL call results in a socket read from a Java socket which throws an exception. Since throwing an exception when another exception is pending causes the process to crash, just let the other exception propagate out of the function.
/external/conscrypt/common/src/jni/main/cpp/conscrypt/jniutil.cc
|
60836adf1bf204ed8e666568c73276973b9ac048 |
|
13-Sep-2017 |
Adam Vartanian <flooey@gmail.com> |
Switch R_RSA_DATA_TOO_LARGE{,_FOR_MODULUS} exception (#328) These error codes can be generated by the methods used in both raw RSA signatures and RSA ciphers, but the Java API for Cipher and Signature has disjoint declared exceptions. Luckily, in our Signature implementations we catch any Exception and wrap it in a SignatureException, so we can safely turn these into the appropriate exceptions for Cipher and they'll be thrown as SignatureException from Signature anyway.
/external/conscrypt/common/src/jni/main/cpp/conscrypt/jniutil.cc
|
37da11e7b50e02d9271a611ca8db5544bf3464a1 |
|
15-Aug-2017 |
Adam Vartanian <flooey@gmail.com> |
Update build for Android tree. (#301) Android assumes the extensions for C++ files is .cpp, so inform it that we use .cc now. Mark some unused parameters and remove an unused function. Disambiguate calls to jniThrowException, which is also a function in an Android header with the same name and signature.
/external/conscrypt/common/src/jni/main/cpp/conscrypt/jniutil.cc
|
cd7a158c79e938d71584008964d05b2eb281d498 |
|
11-Aug-2017 |
Nathan Mittler <nathanmittler@google.com> |
Avoid util class pattern. (#282) It's unusual in C++ to use classes for utility methods (common in Java). Reworking the utility classes to be just namespaces with global variables and methods.
/external/conscrypt/common/src/jni/main/cpp/conscrypt/jniutil.cc
|