Skip to content

Commit 15cdaa4

Browse files
authored
Merge pull request #269 from pusher/investigate-decryption-failures
2.2.2 - Fix decryption failures
2 parents 9db458c + e11998a commit 15cdaa4

File tree

10 files changed

+95
-2096
lines changed

10 files changed

+95
-2096
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# pusher-websocket-java changelog
22

3+
### Version 2.2.2 - 6th July 2020
4+
5+
* Fixed an issue where some private encrypted messages were not decrypted accurately by swapping our implementation of SecretBoxOpener for one provided by [Lazy Sodium](https://github.com/terl/lazysodium-java)
6+
37
### Version 2.2.1 - 22nd April 2020
48

59
* Changed PusherOptions `setForceTLS` and `isForceTLS` to `setUseTLS` and `isUseTLS` to align with the other client SDKs.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ The pusher-java-client is available in Maven Central.
6161
<dependency>
6262
<groupId>com.pusher</groupId>
6363
<artifactId>pusher-java-client</artifactId>
64-
<version>2.2.1</version>
64+
<version>2.2.2</version>
6565
</dependency>
6666
</dependencies>
6767
```
@@ -70,7 +70,7 @@ The pusher-java-client is available in Maven Central.
7070

7171
```groovy
7272
dependencies {
73-
compile 'com.pusher:pusher-java-client:2.2.1'
73+
compile 'com.pusher:pusher-java-client:2.2.2'
7474
}
7575
```
7676

build.gradle

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ apply plugin: 'signing'
2222
apply plugin: 'jacoco'
2323

2424
group = "com.pusher"
25-
version = "2.2.1"
25+
version = "2.2.2"
2626
sourceCompatibility = "1.8"
2727
targetCompatibility = "1.8"
2828

@@ -40,12 +40,16 @@ ext.sharedManifest = manifest {
4040

4141
repositories {
4242
mavenCentral()
43+
jcenter()
4344
}
4445

4546
dependencies {
4647
compile "com.google.code.gson:gson:2.2.2"
4748
compile "org.java-websocket:Java-WebSocket:1.4.0"
4849

50+
implementation "com.goterl.lazycode:lazysodium-java:4.2.6"
51+
implementation "net.java.dev.jna:jna:5.5.0"
52+
4953
testCompile "org.mockito:mockito-all:1.8.5"
5054
testCompile "org.powermock:powermock-module-junit4:1.4.11"
5155
testCompile "org.powermock:powermock-api-mockito:1.4.11"
@@ -202,3 +206,10 @@ jacocoTestReport {
202206
reports.html.enabled = false
203207
reports.csv.enabled = false
204208
}
209+
210+
// Test Logging - https://stackoverflow.com/a/42425815/2623314
211+
test {
212+
testLogging {
213+
showStandardStreams = true
214+
}
215+
}

src/main/java/com/pusher/client/channel/impl/PrivateEncryptedChannelImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,9 @@ private PusherEvent decryptMessage(String message) {
181181
final EncryptedReceivedData encryptedReceivedData =
182182
GSON.fromJson((String)receivedMessage.get("data"), EncryptedReceivedData.class);
183183

184-
String decryptedData = new String(secretBoxOpener.open(
184+
String decryptedData = secretBoxOpener.open(
185185
encryptedReceivedData.getCiphertext(),
186-
encryptedReceivedData.getNonce()));
186+
encryptedReceivedData.getNonce());
187187

188188
receivedMessage.replace("data", decryptedData);
189189

0 commit comments

Comments
 (0)