}
computedExponential = ctx.getHMACKey(_hisExponential);
} else {
ECPublicKey initiatorKey = ECDH.getPublicKey(initiatorExponential, ecdhCurveToUse);
ECPublicKey responderKey = ECDH.getPublicKey(responderExponential, ecdhCurveToUse);
ECDHLightContext ctx = findECDHContextByPubKey(responderKey);
if (ctx == null) {
Logger.error(this, "WTF? the HMAC verified but we don't know about that exponential! SHOULDN'T HAPPEN! - JFK3 - "+pn);
// Possible this is a replay or severely delayed? We don't keep
// every exponential we ever use.
return;
}
computedExponential = ctx.getHMACKey(initiatorKey);
}
if(logDEBUG) Logger.debug(this, "The shared Master secret is : "+HexUtil.bytesToHex(computedExponential) +" for " + pn);
/* 0 is the outgoing key for the initiator, 7 for the responder */
byte[] outgoingKey = computeJFKSharedKey(computedExponential, nonceInitiatorHashed, nonceResponder, "7");