WIP: clean up unused exceptions
parent
d8104c0d5c
commit
8cc78e8f4c
@ -1,57 +0,0 @@
|
|||||||
syntax = "proto2";
|
|
||||||
|
|
||||||
package textsecure;
|
|
||||||
|
|
||||||
option java_package = "org.session.libsignal.libsignal.protocol";
|
|
||||||
option java_outer_classname = "SignalProtos";
|
|
||||||
|
|
||||||
message SignalMessage {
|
|
||||||
optional bytes ratchetKey = 1;
|
|
||||||
optional uint32 counter = 2;
|
|
||||||
optional uint32 previousCounter = 3;
|
|
||||||
optional bytes ciphertext = 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
message PreKeySignalMessage {
|
|
||||||
optional uint32 registrationId = 5;
|
|
||||||
optional uint32 preKeyId = 1;
|
|
||||||
optional uint32 signedPreKeyId = 6;
|
|
||||||
optional bytes baseKey = 2;
|
|
||||||
optional bytes identityKey = 3;
|
|
||||||
optional bytes message = 4; // SignalMessage
|
|
||||||
}
|
|
||||||
|
|
||||||
message KeyExchangeMessage {
|
|
||||||
optional uint32 id = 1;
|
|
||||||
optional bytes baseKey = 2;
|
|
||||||
optional bytes ratchetKey = 3;
|
|
||||||
optional bytes identityKey = 4;
|
|
||||||
optional bytes baseKeySignature = 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
message SenderKeyMessage {
|
|
||||||
optional uint32 id = 1;
|
|
||||||
optional uint32 iteration = 2;
|
|
||||||
optional bytes ciphertext = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
message SenderKeyDistributionMessage {
|
|
||||||
optional uint32 id = 1;
|
|
||||||
optional uint32 iteration = 2;
|
|
||||||
optional bytes chainKey = 3;
|
|
||||||
optional bytes signingKey = 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
message DeviceConsistencyCodeMessage {
|
|
||||||
optional uint32 generation = 1;
|
|
||||||
optional bytes signature = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message ClosedGroupCiphertextMessage {
|
|
||||||
// @required
|
|
||||||
optional bytes ciphertext = 1;
|
|
||||||
// @required
|
|
||||||
optional bytes senderPublicKey = 2;
|
|
||||||
// @required
|
|
||||||
optional uint32 keyIndex = 3;
|
|
||||||
}
|
|
@ -1,12 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (C) 2014-2016 Open Whisper Systems
|
|
||||||
*
|
|
||||||
* Licensed according to the LICENSE file in this repository.
|
|
||||||
*/
|
|
||||||
package org.session.libsignal.libsignal;
|
|
||||||
|
|
||||||
public class DuplicateMessageException extends Exception {
|
|
||||||
public DuplicateMessageException(String s) {
|
|
||||||
super(s);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,16 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (C) 2014-2016 Open Whisper Systems
|
|
||||||
*
|
|
||||||
* Licensed according to the LICENSE file in this repository.
|
|
||||||
*/
|
|
||||||
package org.session.libsignal.libsignal;
|
|
||||||
|
|
||||||
public class InvalidKeyIdException extends Exception {
|
|
||||||
public InvalidKeyIdException(String detailMessage) {
|
|
||||||
super(detailMessage);
|
|
||||||
}
|
|
||||||
|
|
||||||
public InvalidKeyIdException(Throwable throwable) {
|
|
||||||
super(throwable);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,12 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (C) 2014-2016 Open Whisper Systems
|
|
||||||
*
|
|
||||||
* Licensed according to the LICENSE file in this repository.
|
|
||||||
*/
|
|
||||||
package org.session.libsignal.libsignal;
|
|
||||||
|
|
||||||
public class LegacyMessageException extends Exception {
|
|
||||||
public LegacyMessageException(String s) {
|
|
||||||
super(s);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,16 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (C) 2014-2016 Open Whisper Systems
|
|
||||||
*
|
|
||||||
* Licensed according to the LICENSE file in this repository.
|
|
||||||
*/
|
|
||||||
package org.session.libsignal.libsignal;
|
|
||||||
|
|
||||||
public class NoSessionException extends Exception {
|
|
||||||
public NoSessionException(String s) {
|
|
||||||
super(s);
|
|
||||||
}
|
|
||||||
|
|
||||||
public NoSessionException(Exception nested) {
|
|
||||||
super(nested);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,44 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (C) 2014-2016 Open Whisper Systems
|
|
||||||
*
|
|
||||||
* Licensed according to the LICENSE file in this repository.
|
|
||||||
*/
|
|
||||||
package org.session.libsignal.libsignal;
|
|
||||||
|
|
||||||
public class SignalProtocolAddress {
|
|
||||||
|
|
||||||
private final String name;
|
|
||||||
private final int deviceId;
|
|
||||||
|
|
||||||
public SignalProtocolAddress(String name, int deviceId) {
|
|
||||||
this.name = name;
|
|
||||||
this.deviceId = deviceId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getDeviceId() {
|
|
||||||
return deviceId;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return name + ":" + deviceId;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean equals(Object other) {
|
|
||||||
if (other == null) return false;
|
|
||||||
if (!(other instanceof SignalProtocolAddress)) return false;
|
|
||||||
|
|
||||||
SignalProtocolAddress that = (SignalProtocolAddress)other;
|
|
||||||
return this.name.equals(that.name) && this.deviceId == that.deviceId;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int hashCode() {
|
|
||||||
return this.name.hashCode() ^ this.deviceId;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,9 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (C) 2014-2016 Open Whisper Systems
|
|
||||||
*
|
|
||||||
* Licensed according to the LICENSE file in this repository.
|
|
||||||
*/
|
|
||||||
package org.session.libsignal.libsignal;
|
|
||||||
|
|
||||||
public class StaleKeyExchangeException extends Throwable {
|
|
||||||
}
|
|
@ -1,25 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (C) 2014-2016 Open Whisper Systems
|
|
||||||
*
|
|
||||||
* Licensed according to the LICENSE file in this repository.
|
|
||||||
*/
|
|
||||||
package org.session.libsignal.libsignal;
|
|
||||||
|
|
||||||
public class UntrustedIdentityException extends Exception {
|
|
||||||
|
|
||||||
private final String name;
|
|
||||||
private final IdentityKey key;
|
|
||||||
|
|
||||||
public UntrustedIdentityException(String name, IdentityKey key) {
|
|
||||||
this.name = name;
|
|
||||||
this.key = key;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IdentityKey getUntrustedIdentity() {
|
|
||||||
return key;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
}
|
|
File diff suppressed because it is too large
Load Diff
@ -1,8 +0,0 @@
|
|||||||
package org.session.libsignal.metadata;
|
|
||||||
|
|
||||||
|
|
||||||
public class InvalidMetadataVersionException extends Exception {
|
|
||||||
public InvalidMetadataVersionException(String s) {
|
|
||||||
super(s);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,8 +0,0 @@
|
|||||||
package org.session.libsignal.metadata;
|
|
||||||
|
|
||||||
|
|
||||||
public class ProtocolDuplicateMessageException extends ProtocolException {
|
|
||||||
public ProtocolDuplicateMessageException(Exception e, String sender, int senderDevice) {
|
|
||||||
super(e, sender, senderDevice);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
package org.session.libsignal.metadata;
|
|
||||||
|
|
||||||
|
|
||||||
import org.session.libsignal.libsignal.InvalidKeyException;
|
|
||||||
|
|
||||||
public class ProtocolInvalidKeyException extends ProtocolException {
|
|
||||||
public ProtocolInvalidKeyException(InvalidKeyException e, String sender, int senderDevice) {
|
|
||||||
super(e, sender, senderDevice);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,8 +0,0 @@
|
|||||||
package org.session.libsignal.metadata;
|
|
||||||
|
|
||||||
|
|
||||||
public class ProtocolInvalidKeyIdException extends ProtocolException {
|
|
||||||
public ProtocolInvalidKeyIdException(Exception e, String sender, int senderDevice) {
|
|
||||||
super(e, sender, senderDevice);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
package org.session.libsignal.metadata;
|
|
||||||
|
|
||||||
|
|
||||||
import org.session.libsignal.libsignal.InvalidVersionException;
|
|
||||||
|
|
||||||
public class ProtocolInvalidVersionException extends ProtocolException {
|
|
||||||
public ProtocolInvalidVersionException(InvalidVersionException e, String sender, int senderDevice) {
|
|
||||||
super(e, sender, senderDevice);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
package org.session.libsignal.metadata;
|
|
||||||
|
|
||||||
|
|
||||||
import org.session.libsignal.libsignal.LegacyMessageException;
|
|
||||||
|
|
||||||
public class ProtocolLegacyMessageException extends ProtocolException {
|
|
||||||
public ProtocolLegacyMessageException(LegacyMessageException e, String sender, int senderDeviceId) {
|
|
||||||
super(e, sender, senderDeviceId);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
package org.session.libsignal.metadata;
|
|
||||||
|
|
||||||
|
|
||||||
import org.session.libsignal.libsignal.NoSessionException;
|
|
||||||
|
|
||||||
public class ProtocolNoSessionException extends ProtocolException {
|
|
||||||
public ProtocolNoSessionException(NoSessionException e, String sender, int senderDevice) {
|
|
||||||
super(e, sender, senderDevice);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
package org.session.libsignal.metadata;
|
|
||||||
|
|
||||||
|
|
||||||
import org.session.libsignal.libsignal.UntrustedIdentityException;
|
|
||||||
|
|
||||||
public class ProtocolUntrustedIdentityException extends ProtocolException {
|
|
||||||
public ProtocolUntrustedIdentityException(UntrustedIdentityException e, String sender, int senderDevice) {
|
|
||||||
super(e, sender, senderDevice);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,3 +0,0 @@
|
|||||||
package org.session.libsignal.metadata;
|
|
||||||
|
|
||||||
public class SelfSendException extends Exception { }
|
|
Loading…
Reference in New Issue