mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-22 03:52:06 +01:00
Make CorruptedOmemoKeyException not swallow exceptions
This commit is contained in:
parent
ac347fc598
commit
6e9fb17f8f
3 changed files with 9 additions and 5 deletions
|
@ -70,7 +70,7 @@ public class SignalOmemoKeyUtil extends OmemoKeyUtil<IdentityKeyPair, IdentityKe
|
|||
try {
|
||||
return KeyHelper.generateSignedPreKey(identityKeyPair, currentPreKeyId);
|
||||
} catch (InvalidKeyException e) {
|
||||
throw new CorruptedOmemoKeyException(e.getMessage());
|
||||
throw new CorruptedOmemoKeyException(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -102,7 +102,7 @@ public class SignalOmemoKeyUtil extends OmemoKeyUtil<IdentityKeyPair, IdentityKe
|
|||
try {
|
||||
return new IdentityKeyPair(data);
|
||||
} catch (InvalidKeyException e) {
|
||||
throw new CorruptedOmemoKeyException(e.getMessage());
|
||||
throw new CorruptedOmemoKeyException(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -112,7 +112,7 @@ public class SignalOmemoKeyUtil extends OmemoKeyUtil<IdentityKeyPair, IdentityKe
|
|||
try {
|
||||
return new IdentityKey(data, 0);
|
||||
} catch (InvalidKeyException e) {
|
||||
throw new CorruptedOmemoKeyException(e.getMessage());
|
||||
throw new CorruptedOmemoKeyException(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -122,7 +122,7 @@ public class SignalOmemoKeyUtil extends OmemoKeyUtil<IdentityKeyPair, IdentityKe
|
|||
try {
|
||||
return Curve.decodePoint(data, 0);
|
||||
} catch (InvalidKeyException e) {
|
||||
throw new CorruptedOmemoKeyException(e.getMessage());
|
||||
throw new CorruptedOmemoKeyException(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -104,7 +104,7 @@ public final class SignalOmemoService
|
|||
builder.process(contactsBundle);
|
||||
LOGGER.log(Level.FINE, "Session built with " + contactsDevice);
|
||||
} catch (org.whispersystems.libsignal.InvalidKeyException e) {
|
||||
throw new CorruptedOmemoKeyException(e.getMessage());
|
||||
throw new CorruptedOmemoKeyException(e);
|
||||
} catch (UntrustedIdentityException e) {
|
||||
// This should never happen.
|
||||
throw new AssertionError(e);
|
||||
|
|
|
@ -27,4 +27,8 @@ public class CorruptedOmemoKeyException extends Exception {
|
|||
public CorruptedOmemoKeyException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public CorruptedOmemoKeyException(Exception exception) {
|
||||
super(exception);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue