Skip to content

Commit

Permalink
Handle unknown PB data from encrypted messages
Browse files Browse the repository at this point in the history
- Use ProtobufferException for
CoreNetworkProtoResolver.fromProto(PB.NetworkEnvelope proto)
- Add raw PB data in case if an exception
- log error if the encrypted data contains unknown PB data

Note: We should refactor the resolvers with checked exceptions instead
of the ProtobufferRuntimeException, but for the moment we leave that to
not add too much complexity/risk for that release.
  • Loading branch information
ManfredKarrer committed Jun 22, 2018
1 parent 511458b commit 68c4089
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/bisq/desktop/main/MainViewModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
import bisq.common.crypto.CryptoException;
import bisq.common.crypto.KeyRing;
import bisq.common.crypto.SealedAndSigned;
import bisq.common.proto.ProtobufferException;
import bisq.common.storage.CorruptedDatabaseFilesHandler;

import org.bitcoinj.core.Address;
Expand Down Expand Up @@ -807,7 +808,7 @@ public void run() {
} else {
throw new CryptoException("Payload not correct after decryption");
}
} catch (CryptoException e) {
} catch (CryptoException | ProtobufferException e) {
e.printStackTrace();
String msg = Res.get("popup.warning.cryptoTestFailed", e.getMessage());
log.error(msg);
Expand Down

0 comments on commit 68c4089

Please sign in to comment.