forked from I2P_Developers/i2p.i2p
fix OCMOSJ SKM NPE
This commit is contained in:
@@ -102,6 +102,7 @@ public class GarlicMessageBuilder {
|
|||||||
* @param config how/what to wrap
|
* @param config how/what to wrap
|
||||||
* @param wrappedKey output parameter that will be filled with the sessionKey used
|
* @param wrappedKey output parameter that will be filled with the sessionKey used
|
||||||
* @param wrappedTags output parameter that will be filled with the sessionTags used
|
* @param wrappedTags output parameter that will be filled with the sessionTags used
|
||||||
|
* @param skm non-null
|
||||||
*/
|
*/
|
||||||
public static GarlicMessage buildMessage(RouterContext ctx, GarlicConfig config, SessionKey wrappedKey, Set<SessionTag> wrappedTags,
|
public static GarlicMessage buildMessage(RouterContext ctx, GarlicConfig config, SessionKey wrappedKey, Set<SessionTag> wrappedTags,
|
||||||
SessionKeyManager skm) {
|
SessionKeyManager skm) {
|
||||||
@@ -122,6 +123,7 @@ public class GarlicMessageBuilder {
|
|||||||
* @param wrappedKey output parameter that will be filled with the sessionKey used
|
* @param wrappedKey output parameter that will be filled with the sessionKey used
|
||||||
* @param wrappedTags output parameter that will be filled with the sessionTags used
|
* @param wrappedTags output parameter that will be filled with the sessionTags used
|
||||||
* @param numTagsToDeliver only if the estimated available tags are below the threshold
|
* @param numTagsToDeliver only if the estimated available tags are below the threshold
|
||||||
|
* @param skm non-null
|
||||||
*/
|
*/
|
||||||
private static GarlicMessage buildMessage(RouterContext ctx, GarlicConfig config, SessionKey wrappedKey, Set<SessionTag> wrappedTags,
|
private static GarlicMessage buildMessage(RouterContext ctx, GarlicConfig config, SessionKey wrappedKey, Set<SessionTag> wrappedTags,
|
||||||
int numTagsToDeliver, boolean forceElGamal, SessionKeyManager skm) {
|
int numTagsToDeliver, boolean forceElGamal, SessionKeyManager skm) {
|
||||||
|
@@ -10,6 +10,7 @@ package net.i2p.router.message;
|
|||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import net.i2p.crypto.SessionKeyManager;
|
||||||
import net.i2p.data.Certificate;
|
import net.i2p.data.Certificate;
|
||||||
import net.i2p.data.Destination;
|
import net.i2p.data.Destination;
|
||||||
import net.i2p.data.Hash;
|
import net.i2p.data.Hash;
|
||||||
@@ -75,8 +76,11 @@ class OutboundClientMessageJobHelper {
|
|||||||
GarlicConfig config = createGarlicConfig(ctx, replyToken, expiration, recipientPK, dataClove, from, dest, replyTunnel, requireAck, bundledReplyLeaseSet);
|
GarlicConfig config = createGarlicConfig(ctx, replyToken, expiration, recipientPK, dataClove, from, dest, replyTunnel, requireAck, bundledReplyLeaseSet);
|
||||||
if (config == null)
|
if (config == null)
|
||||||
return null;
|
return null;
|
||||||
|
SessionKeyManager skm = ctx.clientManager().getClientSessionKeyManager(from);
|
||||||
|
if (skm == null)
|
||||||
|
return null;
|
||||||
GarlicMessage msg = GarlicMessageBuilder.buildMessage(ctx, config, wrappedKey, wrappedTags,
|
GarlicMessage msg = GarlicMessageBuilder.buildMessage(ctx, config, wrappedKey, wrappedTags,
|
||||||
ctx.clientManager().getClientSessionKeyManager(from));
|
skm);
|
||||||
return msg;
|
return msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user