mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-28 11:42:15 -05:00
catch invalid base64 on omemo key decoding
This commit is contained in:
parent
3db7087658
commit
8f4b7686c9
@ -149,7 +149,12 @@ public class IqParser extends AbstractParser implements OnIqPacketReceived {
|
|||||||
if(signedPreKeySignature == null) {
|
if(signedPreKeySignature == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return Base64.decode(signedPreKeySignature.getContent(),Base64.DEFAULT);
|
try {
|
||||||
|
return Base64.decode(signedPreKeySignature.getContent(), Base64.DEFAULT);
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
Log.e(Config.LOGTAG,AxolotlService.LOGPREFIX+" : Invalid base64 in signedPreKeySignature");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public IdentityKey identityKey(final Element bundle) {
|
public IdentityKey identityKey(final Element bundle) {
|
||||||
@ -160,7 +165,7 @@ public class IqParser extends AbstractParser implements OnIqPacketReceived {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
identityKey = new IdentityKey(Base64.decode(identityKeyElement.getContent(), Base64.DEFAULT), 0);
|
identityKey = new IdentityKey(Base64.decode(identityKeyElement.getContent(), Base64.DEFAULT), 0);
|
||||||
} catch (InvalidKeyException e) {
|
} catch (InvalidKeyException | IllegalArgumentException e) {
|
||||||
Log.e(Config.LOGTAG,AxolotlService.LOGPREFIX+" : "+"Invalid identityKey in PEP: "+e.getMessage());
|
Log.e(Config.LOGTAG,AxolotlService.LOGPREFIX+" : "+"Invalid identityKey in PEP: "+e.getMessage());
|
||||||
}
|
}
|
||||||
return identityKey;
|
return identityKey;
|
||||||
@ -191,7 +196,7 @@ public class IqParser extends AbstractParser implements OnIqPacketReceived {
|
|||||||
try {
|
try {
|
||||||
ECPublicKey preKeyPublic = Curve.decodePoint(Base64.decode(preKeyPublicElement.getContent(), Base64.DEFAULT), 0);
|
ECPublicKey preKeyPublic = Curve.decodePoint(Base64.decode(preKeyPublicElement.getContent(), Base64.DEFAULT), 0);
|
||||||
preKeyRecords.put(preKeyId, preKeyPublic);
|
preKeyRecords.put(preKeyId, preKeyPublic);
|
||||||
} catch (InvalidKeyException e) {
|
} catch (InvalidKeyException | IllegalArgumentException e) {
|
||||||
Log.e(Config.LOGTAG, AxolotlService.LOGPREFIX+" : "+"Invalid preKeyPublic (ID="+preKeyId+") in PEP: "+ e.getMessage()+", skipping...");
|
Log.e(Config.LOGTAG, AxolotlService.LOGPREFIX+" : "+"Invalid preKeyPublic (ID="+preKeyId+") in PEP: "+ e.getMessage()+", skipping...");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user