use of sugar.free.sightparser.authlayer.CRCAuthLayerMessage in project SightRemote by TebbeUbben.
the class AuthLayerProcessor method onOutboundMessage.
@Override
public void onOutboundMessage(Object message, Pipeline pipeline) throws Exception {
if (!(message instanceof AuthLayerMessage))
return;
AuthLayerMessage data = (AuthLayerMessage) message;
BigInteger nonce = pipeline.getLastNonceSent();
if (!(data instanceof CRCAuthLayerMessage))
nonce = nonce.add(BigInteger.ONE);
pipeline.send(data.serialize(nonce, (message instanceof KeyRequest) ? 1 : pipeline.getCommID(), pipeline.getDerivedKeys() != null ? pipeline.getDerivedKeys().getOutgoingKey() : null));
pipeline.setLastNonceSent(nonce);
}
Aggregations