java.lang.Object
net.i2p.router.crypto.ratchet.ECIESAEADEngine.PLCallback
All Implemented Interfaces:
RatchetPayload.PayloadCallback
Enclosing class:
ECIESAEADEngine

private class ECIESAEADEngine.PLCallbackextends Object implements RatchetPayload.PayloadCallback
//////////////////////////////////////////////////////
  • Field Details

    • cloveSet

      public final List<GarlicClove> cloveSet
      Non-null, may be empty.
    • skm

      private final RatchetSKM skm
      The session key manager for the sender.
    • remote

      private final PublicKey remote
      The sender's ratchet public key.
    • datetime

      public long datetime
      The datetime value.
    • nextKeys

      public List<NextSessionKey> nextKeys
      Null or non-empty.
    • ackRequested

      public boolean ackRequested
      Whether an ack was requested.
  • Constructor Details

    • PLCallback

      public PLCallback()
      NS/NSR.
    • PLCallback

      public PLCallback(RatchetSKM keyManager, PublicKey remoteKey)
      Callback for an ES payload, which unlike NS/NSR may carry an ACK to hand back to the ratchet session key manager.
      Parameters:
      keyManager - only for ES, otherwise null
      remoteKey - only for ES, otherwise null
  • Method Details

    • gotDateTime

      public void gotDateTime(long time) throws DataFormatException
      Process a datetime field from the payload.
      Specified by:
      gotDateTime in interface RatchetPayload.PayloadCallback
      Parameters:
      time - the peer's expiry timestamp, in ms since the epoch
      Throws:
      DataFormatException - on bad data
    • gotOptions

      public void gotOptions(byte[] options, boolean isHandshake)
      Process an options field from the payload.

      Intentionally a log-only no-op. This router never emits an OPTIONS block (no option bytes are negotiated in createPayload()) and no local state transition, tag, session key, or acknowledgement behavior is defined in terms of OPTIONS, so ignoring a received block is protocol-correct. The length and framing are already validated by the parser.

      Specified by:
      gotOptions in interface RatchetPayload.PayloadCallback
      Parameters:
      options - the option bytes
      isHandshake - true only for message 3 part 2
    • gotGarlic

      public void gotGarlic(GarlicClove clove)
      Process a garlic clove field from the payload.
      Specified by:
      gotGarlic in interface RatchetPayload.PayloadCallback
      Parameters:
      clove - the garlic clove
    • gotNextKey

      public void gotNextKey(NextSessionKey next)
      Process a next key field from the payload.
      Specified by:
      gotNextKey in interface RatchetPayload.PayloadCallback
      Parameters:
      next - the next one
    • gotAck

      public void gotAck(int id, int n)
      Process an ack field from the payload.
      Specified by:
      gotAck in interface RatchetPayload.PayloadCallback
      Parameters:
      id - the key ID
      n - the message count acknowledged for that key
    • gotAckRequest

      public void gotAckRequest()
      Process an ack request field from the payload.
      Specified by:
      gotAckRequest in interface RatchetPayload.PayloadCallback
    • gotTermination

      public void gotTermination(int reason)
      Process a termination field from the payload.

      Intentionally a log-only no-op. Ratchet sessions here end by ratchet key rotation or by the session expiring in RatchetSKM.aggressiveExpire(), never by a peer-sent TERMINATION block, and this router never emits one. The parser already rejects any block following a TERMINATION other than padding, so the framing is enforced without acting on the reason.

      Specified by:
      gotTermination in interface RatchetPayload.PayloadCallback
      Parameters:
      reason - the peer's termination reason code, 0-255
    • gotPN

      public void gotPN(int pn)
      Process a PN field from the payload.

      Intentionally a log-only no-op. The message number block is an optional advisory hint for out-of-order reassembly; ratchet decryption here is authenticated per message and does not dedupe by number, and this router never emits a PN block. Accepting and ignoring it is therefore protocol-correct.

      Specified by:
      gotPN in interface RatchetPayload.PayloadCallback
      Parameters:
      pn - the peer's message number, 0-65535
    • gotUnknown

      public void gotUnknown(int type, int len)
      Process an unknown field from the payload.
      Specified by:
      gotUnknown in interface RatchetPayload.PayloadCallback
      Parameters:
      type - the block type
      len - the block length
    • gotPadding

      public void gotPadding(int paddingLength, int frameLength)
      Process a padding field from the payload.
      Specified by:
      gotPadding in interface RatchetPayload.PayloadCallback
      Parameters:
      paddingLength - the number of padding bytes, not including the 3-byte block header
      frameLength - the total size of the frame, including all blocks and block headers