aboutsummaryrefslogtreecommitdiff
path: root/android/olm-sdk/src/main/java/org/matrix/olm/OlmInboundGroupSession.java
diff options
context:
space:
mode:
authorHubert Chathi <hubert@uhoreg.ca>2018-10-10 15:06:58 -0400
committerHubert Chathi <hubert@uhoreg.ca>2018-10-12 15:55:36 -0400
commitaf86a9a8b899eeb3c1c464cb0c54218acd788fa6 (patch)
treeaf8bf2476e95118a7830b075289bb59898ce47ca /android/olm-sdk/src/main/java/org/matrix/olm/OlmInboundGroupSession.java
parentb1130fb77f0bcaa436a5308bd1093b0e94aa6585 (diff)
clear out plaintext buffers in Android SDK where possible
Diffstat (limited to 'android/olm-sdk/src/main/java/org/matrix/olm/OlmInboundGroupSession.java')
-rw-r--r--android/olm-sdk/src/main/java/org/matrix/olm/OlmInboundGroupSession.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/android/olm-sdk/src/main/java/org/matrix/olm/OlmInboundGroupSession.java b/android/olm-sdk/src/main/java/org/matrix/olm/OlmInboundGroupSession.java
index 8c2d7b0..b41c67a 100644
--- a/android/olm-sdk/src/main/java/org/matrix/olm/OlmInboundGroupSession.java
+++ b/android/olm-sdk/src/main/java/org/matrix/olm/OlmInboundGroupSession.java
@@ -25,6 +25,8 @@ import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
+import java.util.Arrays;
+
/**
* Class used to create an inbound <a href="http://matrix.org/docs/guides/e2e_implementation.html#handling-an-m-room-key-event">Megolm session</a>.<br>
* Counter part of the outbound group session {@link OlmOutboundGroupSession}, this class decrypts the messages sent by the outbound side.
@@ -236,7 +238,7 @@ public class OlmInboundGroupSession extends CommonSerializeUtils implements Seri
* In case of error, null is returned and an error message description is provided in aErrorMsg.
* @param aEncryptedMsg the message to be decrypted
* @return the decrypted message information
- * @exception OlmException teh failure reason
+ * @exception OlmException the failure reason
*/
public DecryptMessageResult decryptMessage(String aEncryptedMsg) throws OlmException {
DecryptMessageResult result = new DecryptMessageResult();
@@ -246,6 +248,7 @@ public class OlmInboundGroupSession extends CommonSerializeUtils implements Seri
if (null != decryptedMessageBuffer) {
result.mDecryptedMessage = new String(decryptedMessageBuffer, "UTF-8");
+ Arrays.fill(decryptedMessageBuffer, (byte) 0);
}
} catch (Exception e) {
Log.e(LOG_TAG, "## decryptMessage() failed " + e.getMessage());