mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-22 06:12:05 +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 {
|
try {
|
||||||
return KeyHelper.generateSignedPreKey(identityKeyPair, currentPreKeyId);
|
return KeyHelper.generateSignedPreKey(identityKeyPair, currentPreKeyId);
|
||||||
} catch (InvalidKeyException e) {
|
} catch (InvalidKeyException e) {
|
||||||
throw new CorruptedOmemoKeyException(e.getMessage());
|
throw new CorruptedOmemoKeyException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ public class SignalOmemoKeyUtil extends OmemoKeyUtil<IdentityKeyPair, IdentityKe
|
||||||
try {
|
try {
|
||||||
return new IdentityKeyPair(data);
|
return new IdentityKeyPair(data);
|
||||||
} catch (InvalidKeyException e) {
|
} catch (InvalidKeyException e) {
|
||||||
throw new CorruptedOmemoKeyException(e.getMessage());
|
throw new CorruptedOmemoKeyException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ public class SignalOmemoKeyUtil extends OmemoKeyUtil<IdentityKeyPair, IdentityKe
|
||||||
try {
|
try {
|
||||||
return new IdentityKey(data, 0);
|
return new IdentityKey(data, 0);
|
||||||
} catch (InvalidKeyException e) {
|
} catch (InvalidKeyException e) {
|
||||||
throw new CorruptedOmemoKeyException(e.getMessage());
|
throw new CorruptedOmemoKeyException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@ public class SignalOmemoKeyUtil extends OmemoKeyUtil<IdentityKeyPair, IdentityKe
|
||||||
try {
|
try {
|
||||||
return Curve.decodePoint(data, 0);
|
return Curve.decodePoint(data, 0);
|
||||||
} catch (InvalidKeyException e) {
|
} catch (InvalidKeyException e) {
|
||||||
throw new CorruptedOmemoKeyException(e.getMessage());
|
throw new CorruptedOmemoKeyException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -104,7 +104,7 @@ public final class SignalOmemoService
|
||||||
builder.process(contactsBundle);
|
builder.process(contactsBundle);
|
||||||
LOGGER.log(Level.FINE, "Session built with " + contactsDevice);
|
LOGGER.log(Level.FINE, "Session built with " + contactsDevice);
|
||||||
} catch (org.whispersystems.libsignal.InvalidKeyException e) {
|
} catch (org.whispersystems.libsignal.InvalidKeyException e) {
|
||||||
throw new CorruptedOmemoKeyException(e.getMessage());
|
throw new CorruptedOmemoKeyException(e);
|
||||||
} catch (UntrustedIdentityException e) {
|
} catch (UntrustedIdentityException e) {
|
||||||
// This should never happen.
|
// This should never happen.
|
||||||
throw new AssertionError(e);
|
throw new AssertionError(e);
|
||||||
|
|
|
@ -27,4 +27,8 @@ public class CorruptedOmemoKeyException extends Exception {
|
||||||
public CorruptedOmemoKeyException(String message) {
|
public CorruptedOmemoKeyException(String message) {
|
||||||
super(message);
|
super(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CorruptedOmemoKeyException(Exception exception) {
|
||||||
|
super(exception);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue