class InboundEstablishState extends Object
Modifier and Type | Class and Description |
---|---|
static class |
InboundEstablishState.InboundState |
Constructor and Description |
---|
InboundEstablishState(RouterContext ctx,
byte[] remoteIP,
int remotePort,
int localPort,
DHSessionKeyBuilder dh) |
Modifier and Type | Method and Description |
---|---|
void |
addMessage(OutNetMessage msg)
Queue a message to be sent after the session is established.
|
void |
complete()
Notify successful completion
|
void |
createdPacketSent()
note that we just sent a SessionCreated packet
|
void |
fail() |
void |
generateSessionKey()
Generates session key and mac key.
|
SessionKey |
getCipherKey() |
RouterIdentity |
getConfirmedIdentity()
Who is Alice (null if forged/unknown)
Note that this isn't really confirmed - see below.
|
long |
getEstablishBeginTime() |
long |
getLifetime()
how long have we been trying to establish this session?
|
SessionKey |
getMACKey() |
OutNetMessage |
getNextQueuedMessage()
Pull from the message queue
|
long |
getNextSendTime() |
byte[] |
getReceivedOurIP() |
byte[] |
getReceivedX() |
(package private) RemoteHostId |
getRemoteHostId()
RemoteHostId, uniquely identifies an attempt
|
byte[] |
getSentIP()
what IP do they appear to be on?
|
int |
getSentPort()
what port number do they appear to be coming from?
|
long |
getSentRelayTag() |
Signature |
getSentSignature() |
long |
getSentSignedOnTime() |
byte[] |
getSentY() |
InboundEstablishState.InboundState |
getState() |
boolean |
isComplete() |
boolean |
isIntroductionRequested()
True (default) if no extended options in session request,
or value of flag bit in the extended options.
|
void |
prepareSessionCreated() |
void |
receiveSessionConfirmed(UDPPacketReader.SessionConfirmedReader conf)
Note that while a SessionConfirmed could in theory be fragmented,
in practice a RouterIdentity is 387 bytes and a single fragment is 512 bytes max,
so it will never be fragmented.
|
void |
receiveSessionRequest(UDPPacketReader.SessionRequestReader req) |
boolean |
sessionRequestReceived() |
void |
setSentRelayTag(long tag) |
String |
toString() |
public InboundEstablishState(RouterContext ctx, byte[] remoteIP, int remotePort, int localPort, DHSessionKeyBuilder dh)
localPort
- Must be our external port, otherwise the signature of the
SessionCreated message will be bad if the external port != the internal port.public InboundEstablishState.InboundState getState()
public boolean isComplete()
public void complete()
public void addMessage(OutNetMessage msg)
public OutNetMessage getNextQueuedMessage()
public void receiveSessionRequest(UDPPacketReader.SessionRequestReader req)
public boolean sessionRequestReceived()
public byte[] getReceivedX()
public byte[] getReceivedOurIP()
public boolean isIntroductionRequested()
public void generateSessionKey() throws DHSessionKeyBuilder.InvalidPublicParameterException
public SessionKey getCipherKey()
public SessionKey getMACKey()
public byte[] getSentIP()
public int getSentPort()
public byte[] getSentY()
public void fail()
public long getSentRelayTag()
public void setSentRelayTag(long tag)
public long getSentSignedOnTime()
public void prepareSessionCreated()
public Signature getSentSignature()
public void createdPacketSent()
public long getLifetime()
public long getEstablishBeginTime()
public long getNextSendTime()
RemoteHostId getRemoteHostId()
public void receiveSessionConfirmed(UDPPacketReader.SessionConfirmedReader conf)
public RouterIdentity getConfirmedIdentity()