Skip to content

Commit 2b8ece1

Browse files
committed
We have a working routing, certs are delivered and verification works with a few E2E test. Promising.
1 parent 9cf1e51 commit 2b8ece1

9 files changed

Lines changed: 18 additions & 18 deletions

File tree

libs/ASAPJava.jar

267 Bytes
Binary file not shown.

libs/SharkPKI.jar

1.12 KB
Binary file not shown.

libs/SharkPeer.jar

0 Bytes
Binary file not shown.

src/net/sharksystem/cmdline/sharkmessengerUI/commands/pki/PKIPrinter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public String getIAString(CharSequence peerID) {
2020

2121
int ia = 0;
2222
try {
23-
ia = pki.getPersonValuesByID(peerID).getIdentityAssurance();
23+
ia = pki.getIdentityAssurance(peerID);
2424
} catch (ASAPSecurityException e) {
2525
// nothing found
2626
// is it you

src/net/sharksystem/messenger/SharkMessageComparison.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ class SharkMessageComparison implements ASAPMessageCompare {
1818
@Override
1919
public boolean earlier(byte[] msgA, byte[] msgB) {
2020
try {
21-
InMemoSharkMessage sharkMsgA = InMemoSharkMessage.parseMessage(msgA, new ArrayList<ASAPHop>(), this.pki);
22-
InMemoSharkMessage sharkMsgB = InMemoSharkMessage.parseMessage(msgB, new ArrayList<ASAPHop>(), this.pki);
21+
InMemoSharkMessage sharkMsgA =
22+
InMemoSharkMessage.parseMessage(msgA, new ArrayList<ASAPHop>(), this.pki.getASAPKeyStore());
23+
InMemoSharkMessage sharkMsgB =
24+
InMemoSharkMessage.parseMessage(msgB, new ArrayList<ASAPHop>(), this.pki.getASAPKeyStore());
2325

2426
long creationTimeA = -1;
2527
long creationTimeB = -1;

src/net/sharksystem/messenger/SharkMessageListImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public SharkMessage getSharkMessage(int position, boolean chronologically) throw
3030
try {
3131
List<ASAPHop> hopsList = this.asapMessages.getChunk(position, chronologically).getASAPHopList();
3232
byte[] content = this.asapMessages.getMessage(position, chronologically);
33-
return InMemoSharkMessage.parseMessage(content, hopsList, this.pkiComponent);
33+
return InMemoSharkMessage.parseMessage(content, hopsList, this.pkiComponent.getASAPKeyStore());
3434
}
3535
catch(ASAPException | IOException asapException) {
3636
throw new SharkMessengerException(asapException);

src/net/sharksystem/messenger/SharkMessengerComponentImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public void sendSharkMessage(byte[] content, CharSequence uri,
7676
this.asapPeer.getPeerID(),
7777
receiver,
7878
sign, encrypt,
79-
this.sharkPKIComponent));
79+
this.sharkPKIComponent.getASAPKeyStore()));
8080
}
8181
} else {
8282
this.asapPeer.sendASAPMessage(SHARK_MESSENGER_FORMAT, uri,
@@ -86,7 +86,7 @@ public void sendSharkMessage(byte[] content, CharSequence uri,
8686
this.asapPeer.getPeerID(),
8787
selectedRecipients,
8888
sign, encrypt,
89-
this.sharkPKIComponent));
89+
this.sharkPKIComponent.getASAPKeyStore()));
9090
}
9191
} catch (ASAPException e) {
9292
throw new SharkMessengerException("when serialising and sending message: " + e.getLocalizedMessage(), e);

tests/net/sharksystem/messenger/TestHelper.java

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
import net.sharksystem.SharkTestPeerFS;
66
import net.sharksystem.asap.crypto.InMemoASAPKeyStore;
77
import net.sharksystem.asap.pki.ASAPCertificate;
8-
import net.sharksystem.pki.CredentialMessage;
9-
import net.sharksystem.pki.SharkPKIComponent;
10-
import net.sharksystem.pki.SharkPKIComponentFactory;
8+
import net.sharksystem.pki.*;
119
import org.junit.jupiter.api.Assertions;
1210

1311
import java.io.IOException;
@@ -88,9 +86,9 @@ public void setUpScenario_1() throws SharkException, IOException {
8886
SharkPKIComponent claraPKI = (SharkPKIComponent) this.claraPeer.getComponent(SharkPKIComponent.class);
8987

9088
// create credential messages
91-
CredentialMessage aliceCredentialMessage = alicePKI.createCredentialMessage();
92-
CredentialMessage bobCredentialMessage = bobPKI.createCredentialMessage();
93-
CredentialMessage claraCredentialMessage = claraPKI.createCredentialMessage();
89+
CredentialMessage aliceCredentialMessage = ((SharkPKIDebugSupport) alicePKI).createCredentialMessage();
90+
CredentialMessage bobCredentialMessage = ((SharkPKIDebugSupport) bobPKI).createCredentialMessage();
91+
CredentialMessage claraCredentialMessage = ((SharkPKIDebugSupport) claraPKI).createCredentialMessage();
9492

9593
// a) Alice and Bob exchange and accept credential messages and issue certificates
9694
ASAPCertificate aliceIssuedBobCert = alicePKI.acceptAndSignCredential(bobCredentialMessage);
@@ -187,10 +185,10 @@ public void setUpScenario_2() throws SharkException, IOException {
187185
SharkPKIComponent davidPKI = (SharkPKIComponent) this.davidPeer.getComponent(SharkPKIComponent.class);
188186

189187
// create credential messages
190-
CredentialMessage aliceCredentialMessage = alicePKI.createCredentialMessage();
191-
CredentialMessage bobCredentialMessage = bobPKI.createCredentialMessage();
192-
CredentialMessage claraCredentialMessage = claraPKI.createCredentialMessage();
193-
CredentialMessage davidCredentialMessage = davidPKI.createCredentialMessage();
188+
CredentialMessage aliceCredentialMessage = ((SharkPKIDebugSupport) alicePKI).createCredentialMessage();
189+
CredentialMessage bobCredentialMessage = ((SharkPKIDebugSupport) bobPKI).createCredentialMessage();
190+
CredentialMessage claraCredentialMessage = ((SharkPKIDebugSupport) claraPKI).createCredentialMessage();
191+
CredentialMessage davidCredentialMessage = ((SharkPKIDebugSupport) davidPKI).createCredentialMessage();
194192

195193
// a) Alice and Bob exchange and accept credential messages and issue certificates
196194
alicePKI.acceptAndSignCredential(bobCredentialMessage);
@@ -283,7 +281,7 @@ public static void addComponentsToSharkPeer(CharSequence peerID, SharkPeer shark
283281

284282
// create a component factory
285283
SharkPKIComponentFactory certificateComponentFactory =
286-
new SharkPKIComponentFactory(new InMemoASAPKeyStore(peerID));
284+
new SharkPKIComponentFactory();
287285

288286
// register this component with shark peer - note: we use interface SharkPeer
289287
sharkPeer.addComponent(certificateComponentFactory, SharkPKIComponent.class);

tests/net/sharksystem/messenger/version1/CredentialTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ public class CredentialTests {
44
public void a2b2c() {
55
/*
66
step 1:
7-
A send signed message, opens (sendMessage signedA 1 true, openTCP 7777, lsMessages, showOpenTCPPorts) okay
7+
A send signed message, opens (sendMessage signedA 1 true, openTCP 7777, lsMessages, showOpenTCPPorts) fails - cannot verify
88
B connects to A, got message, cannot verify (connectTCP localhost 7777, wait 500, lsMessages) okay
99
1010
step 2:

0 commit comments

Comments
 (0)