OCMOSJ: Don't create unused objects for ECIES

This commit is contained in:
zzz
2025-01-06 10:39:55 -05:00
parent 793b51c026
commit d64483189b
2 changed files with 14 additions and 5 deletions

View File

@ -104,9 +104,11 @@ class OutboundClientMessageJobHelper {
* @param dataClove may be null for ECIES-layer ack
* @param tagsToSendOverride if > 0, use this instead of skm's default
* @param lowTagsOverride if > 0, use this instead of skm's default
* @param wrappedKey non-null with null data,
* output parameter that will be filled with the SessionKey used
* @param wrappedTags output parameter that will be filled with the sessionTags used
* @param wrappedKey for ElGamal, non-null with null data,
* output parameter that will be filled with the SessionKey used,
* may be null for ECIES
* @param wrappedTags for ElGamal, output parameter that will be filled with the sessionTags used,
* may be null for ECIES
* @param replyTunnel non-null if requireAck is true or bundledReplyLeaseSet is non-null
* @param requireAck if true, bundle replyToken in an ack clove
* @param bundledReplyLeaseSet may be null; if non-null, put it in a clove

View File

@ -699,8 +699,15 @@ public class OutboundClientMessageOneShotJob extends JobImpl {
clove = null;
}
SessionKey sessKey = new SessionKey();
Set<SessionTag> tags = new HashSet<SessionTag>();
SessionKey sessKey;
Set<SessionTag> tags;
if (_encryptionKey.getType() == EncType.ECIES_X25519) {
sessKey = null;
tags = null;
} else {
sessKey = new SessionKey();
tags = new HashSet<SessionTag>();
}
// Per-message flag > 0 overrides per-session option
int tagsToSend = SendMessageOptions.getTagsToSend(sendFlags);