<p><a class="user-mention" data-hovercard-user-id="170962" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ripcurlx">@ripcurlx</a><br>
There was a bug with SetupUtils.<br>
<code>UserThread.execute(resultHandler::handleResult);</code> was removed in an earlier commit.</p>
<p>Should be:</p>
<pre><code>Thread checkCryptoThread = new Thread() {
@Override
public void run() {
try {
Thread.currentThread().setName("checkCryptoThread");
log.trace("Run crypto test");
// just use any simple dummy msg
Ping payload = new Ping(1, 1);
SealedAndSigned sealedAndSigned = EncryptionService.encryptHybridWithSignature(payload,
keyRing.getSignatureKeyPair(), keyRing.getPubKeyRing().getEncryptionPubKey());
DecryptedDataTuple tuple = encryptionService.decryptHybridWithSignature(sealedAndSigned,
keyRing.getEncryptionKeyPair().getPrivate());
if (tuple.getNetworkEnvelope() instanceof Ping &&
((Ping) tuple.getNetworkEnvelope()).getNonce() == payload.getNonce() &&
((Ping) tuple.getNetworkEnvelope()).getLastRoundTripTime() == payload.getLastRoundTripTime()) {
log.debug("Crypto test succeeded");
UserThread.execute(resultHandler::handleResult);
} else {
errorHandler.accept(new CryptoException("Payload not correct after decryption"));
}
} catch (CryptoException | ProtobufferException e) {
log.error(e.toString());
e.printStackTrace();
errorHandler.accept(e);
}
}
};
checkCryptoThread.start();
}
</code></pre>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/bisq-network/bisq/pull/1660#issuecomment-422471614">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AkpZtoNCAj2QBmoitSpw_gdXWcZAtxEpks5ucSd7gaJpZM4WeuKv">mute the thread</a>.<img src="https://github.com/notifications/beacon/AkpZthjU_5cYathVrJTcs2mNUBxflu0-ks5ucSd7gaJpZM4WeuKv.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/bisq-network/bisq","title":"bisq-network/bisq","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/bisq-network/bisq"}},"updates":{"snippets":[{"icon":"PERSON","message":"@ManfredKarrer in #1660: @ripcurlx \r\nThere was a bug with SetupUtils.\r\n`UserThread.execute(resultHandler::handleResult);` was removed in an earlier commit.\r\n\r\nShould be:\r\n```\r\nThread checkCryptoThread = new Thread() {\r\n @Override\r\n public void run() {\r\n try {\r\n Thread.currentThread().setName(\"checkCryptoThread\");\r\n log.trace(\"Run crypto test\");\r\n // just use any simple dummy msg\r\n Ping payload = new Ping(1, 1);\r\n SealedAndSigned sealedAndSigned = EncryptionService.encryptHybridWithSignature(payload,\r\n keyRing.getSignatureKeyPair(), keyRing.getPubKeyRing().getEncryptionPubKey());\r\n DecryptedDataTuple tuple = encryptionService.decryptHybridWithSignature(sealedAndSigned,\r\n keyRing.getEncryptionKeyPair().getPrivate());\r\n if (tuple.getNetworkEnvelope() instanceof Ping \u0026\u0026\r\n ((Ping) tuple.getNetworkEnvelope()).getNonce() == payload.getNonce() \u0026\u0026\r\n ((Ping) tuple.getNetworkEnvelope()).getLastRoundTripTime() == payload.getLastRoundTripTime()) {\r\n log.debug(\"Crypto test succeeded\");\r\n\r\n UserThread.execute(resultHandler::handleResult);\r\n } else {\r\n errorHandler.accept(new CryptoException(\"Payload not correct after decryption\"));\r\n }\r\n } catch (CryptoException | ProtobufferException e) {\r\n log.error(e.toString());\r\n e.printStackTrace();\r\n errorHandler.accept(e);\r\n }\r\n }\r\n };\r\n checkCryptoThread.start();\r\n }\r\n```"}],"action":{"name":"View Pull Request","url":"https://github.com/bisq-network/bisq/pull/1660#issuecomment-422471614"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/bisq-network/bisq/pull/1660#issuecomment-422471614",
"url": "https://github.com/bisq-network/bisq/pull/1660#issuecomment-422471614",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
},
{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"hideOriginalBody": "false",
"originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB",
"title": "Re: [bisq-network/bisq] Java 10 support (#1660)",
"sections": [
{
"text": "",
"activityTitle": "**Manfred Karrer**",
"activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png",
"activitySubtitle": "@ManfredKarrer",
"facts": [
]
}
],
"potentialAction": [
{
"name": "Add a comment",
"@type": "ActionCard",
"inputs": [
{
"isMultiLine": true,
"@type": "TextInput",
"id": "IssueComment",
"isRequired": false
}
],
"actions": [
{
"name": "Comment",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"bisq-network/bisq\",\n\"issueId\": 1660,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}"
}
]
},
{
"name": "Close pull request",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"PullRequestClose\",\n\"repositoryFullName\": \"bisq-network/bisq\",\n\"pullRequestId\": 1660\n}"
},
{
"targets": [
{
"os": "default",
"uri": "https://github.com/bisq-network/bisq/pull/1660#issuecomment-422471614"
}
],
"@type": "OpenUri",
"name": "View on GitHub"
},
{
"name": "Unsubscribe",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 377152175\n}"
}
],
"themeColor": "26292E"
}
]</script>