Skip to content

Commit

Permalink
Merge pull request #444 from signalapp/greyson/decryption-result
Browse files Browse the repository at this point in the history
Added message type to sealed sender decryption result.
  • Loading branch information
jrose-signal committed Feb 9, 2022
2 parents ca944d2 + 2560f7d commit 3477c38
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ public DecryptionResult decrypt(CertificateValidator validator, byte[] ciphertex
return new DecryptionResult(content.getSenderCertificate().getSenderUuid(),
content.getSenderCertificate().getSenderE164(),
content.getSenderCertificate().getSenderDeviceId(),
content.getType(),
content.getGroupId(),
decrypt(content));
} catch (InvalidMessageException e) {
Expand Down Expand Up @@ -212,13 +213,15 @@ public static class DecryptionResult {
private final String senderUuid;
private final Optional<String> senderE164;
private final int deviceId;
private final int messageType;
private final Optional<byte[]> groupId;
private final byte[] paddedMessage;

private DecryptionResult(String senderUuid, Optional<String> senderE164, int deviceId, Optional<byte[]> groupId, byte[] paddedMessage) {
private DecryptionResult(String senderUuid, Optional<String> senderE164, int deviceId, int messageType, Optional<byte[]> groupId, byte[] paddedMessage) {
this.senderUuid = senderUuid;
this.senderE164 = senderE164;
this.deviceId = deviceId;
this.messageType = messageType;
this.groupId = groupId;
this.paddedMessage = paddedMessage;
}
Expand All @@ -235,6 +238,10 @@ public int getDeviceId() {
return deviceId;
}

public int getCiphertextMessageType() {
return messageType;
}

public byte[] getPaddedMessage() {
return paddedMessage;
}
Expand Down

0 comments on commit 3477c38

Please sign in to comment.