aboutsummaryrefslogtreecommitdiff
path: root/java/android/OlmLibSdk/olm-sdk/src/androidTest
diff options
context:
space:
mode:
Diffstat (limited to 'java/android/OlmLibSdk/olm-sdk/src/androidTest')
-rw-r--r--java/android/OlmLibSdk/olm-sdk/src/androidTest/java/org/matrix/olm/OlmUtilityTest.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/java/android/OlmLibSdk/olm-sdk/src/androidTest/java/org/matrix/olm/OlmUtilityTest.java b/java/android/OlmLibSdk/olm-sdk/src/androidTest/java/org/matrix/olm/OlmUtilityTest.java
index e483d71..d4c3382 100644
--- a/java/android/OlmLibSdk/olm-sdk/src/androidTest/java/org/matrix/olm/OlmUtilityTest.java
+++ b/java/android/OlmLibSdk/olm-sdk/src/androidTest/java/org/matrix/olm/OlmUtilityTest.java
@@ -86,12 +86,18 @@ public class OlmUtilityTest {
assertTrue(isVerified);
assertTrue(String.valueOf(errorMsg).isEmpty());
- // check a bad signature is detected and the error message is not empty
+ // check a bad signature is detected => errorMsg = BAD_MESSAGE_MAC
String badSignature = "Bad signature Bad signature Bad signature..";
isVerified = utility.verifyEd25519Signature(badSignature, fingerPrintKey, message, errorMsg);
assertFalse(isVerified);
assertFalse(String.valueOf(errorMsg).isEmpty());
+ // check bad fingerprint size => errorMsg = INVALID_BASE64
+ String badSizeFingerPrintKey = fingerPrintKey.substring(fingerPrintKey.length()/2);
+ isVerified = utility.verifyEd25519Signature(messageSignature, badSizeFingerPrintKey, message, errorMsg);
+ assertFalse(isVerified);
+ assertFalse(String.valueOf(errorMsg).isEmpty());
+
utility.releaseUtility();
account.releaseAccount();
}