Collapse SessionRecord, SessionState, and PreKeyRecord interfaces.

This commit is contained in:
Moxie Marlinspike
2014-04-24 15:39:55 -07:00
parent 5a3c19fe3e
commit a601c56af1
25 changed files with 1271 additions and 1836 deletions

View File

@@ -220,16 +220,13 @@ public class SessionBuilderTest extends AndroidTestCase {
}
}
private class InMemoryPreKey implements PreKey, PreKeyRecord {
private class InMemoryPreKey extends PreKeyRecord implements PreKey {
private final int keyId;
private final ECKeyPair keyPair;
private final IdentityKey identityKey;
private final int registrationId;
public InMemoryPreKey(int keyId, ECKeyPair keyPair, IdentityKey identityKey, int registrationId) {
this.keyId = keyId;
this.keyPair = keyPair;
super(keyId, keyPair);
this.identityKey = identityKey;
this.registrationId = registrationId;
}
@@ -241,12 +238,12 @@ public class SessionBuilderTest extends AndroidTestCase {
@Override
public int getKeyId() {
return keyId;
return getId();
}
@Override
public ECPublicKey getPublicKey() {
return keyPair.getPublicKey();
return getKeyPair().getPublicKey();
}
@Override
@@ -258,21 +255,6 @@ public class SessionBuilderTest extends AndroidTestCase {
public int getRegistrationId() {
return registrationId;
}
@Override
public int getId() {
return keyId;
}
@Override
public ECKeyPair getKeyPair() {
return keyPair;
}
@Override
public byte[] serialize() {
throw new AssertionError("nyi");
}
}
}