From 50bf60499ab6b2147d42fc3943eea173de64a601 Mon Sep 17 00:00:00 2001 From: pedroGitt Date: Thu, 20 Oct 2016 17:39:09 +0200 Subject: Update verifyEd25519Signature() to fix error message processing --- .../olm-sdk/src/main/java/org/matrix/olm/OlmUtility.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'java/android') 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); } } -- cgit v1.2.3