aboutsummaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorpedroGitt <pedro.contreiras@amdocs.com>2016-10-20 17:39:09 +0200
committerpedroGitt <pedro.contreiras@amdocs.com>2016-10-20 17:39:09 +0200
commit50bf60499ab6b2147d42fc3943eea173de64a601 (patch)
tree7e4c3f359a86088c3862675a5bc1f18d2dd17769 /java
parent09fd7246eacddc0f9fe43f614dd59596c6944dbc (diff)
Update verifyEd25519Signature() to fix error message processing
Diffstat (limited to 'java')
-rw-r--r--java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmUtility.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmUtility.java b/java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmUtility.java
index a6e9c4f..2843f0f 100644
--- a/java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmUtility.java
+++ b/java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmUtility.java
@@ -78,20 +78,20 @@ public class OlmUtility implements Serializable {
*/
public boolean verifyEd25519Signature(String aSignature, String aFingerprintKey, String aMessage, StringBuffer aError) {
boolean retCode = false;
- String errorRetValue = null;
+ String jniError;
- if(null == aError) {
+ if (null == aError) {
Log.e(LOG_TAG, "## verifyEd25519Signature(): invalid input error parameter");
- }
- else if(TextUtils.isEmpty(aSignature) || TextUtils.isEmpty(aFingerprintKey) || TextUtils.isEmpty(aMessage)){
- Log.e(LOG_TAG, "## verifyEd25519Signature(): invalid input parameters");
} else {
aError.setLength(0);
- if( null == (errorRetValue = verifyEd25519SignatureJni(aSignature,aFingerprintKey, aMessage))) {
+ if (TextUtils.isEmpty(aSignature) || TextUtils.isEmpty(aFingerprintKey) || TextUtils.isEmpty(aMessage)) {
+ Log.e(LOG_TAG, "## verifyEd25519Signature(): invalid input parameters");
+ aError.append("JAVA sanity check failure - invalid input parameters");
+ } else if (null == (jniError = verifyEd25519SignatureJni(aSignature, aFingerprintKey, aMessage))) {
retCode = true;
} else {
- aError.append(errorRetValue);
+ aError.append(jniError);
}
}