Ejemplo n.º 1
0
 internal override void unknownReceived(Session session, bool authentic = false)
 {
     invalidMessage(session);
 }
Ejemplo n.º 2
0
        internal override void btm2btmReceived(Session session, bool authentic = false)
        {
            if (authentic != true)
                return;

            session.deployBtm2Btm();
        }
Ejemplo n.º 3
0
 internal override void krypt2kryptReceived(Session session, bool authentic = false)
 {
     session.deployKrypt2Krypt();
 }
Ejemplo n.º 4
0
 internal override void securityStatusChanged(Session session)
 {
     //check if session has gone secure
     if (session.isSecure != true)
     {
         //this should never happen
         session._tearDown();
     }
     session.changeState(Routing.Instance(session));
 }
Ejemplo n.º 5
0
 internal static State Instance(Session session)
 {
     session.initBottomProtocol(session.startedProtocol);
     return state;
 }
Ejemplo n.º 6
0
 internal override void ackReceived(Session session, bool authentic = false)
 {
     changeState(session, SessionConfirmed.Instance(session));
 }
Ejemplo n.º 7
0
 internal override void synReceived(Session session, bool authentic = false)
 {
     //TODO: version checks here
     session.sendACK();
     changeState(session, SessionConfirmed.Instance(session));
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Starts a protocol run.
 /// </summary>
 /// <param name="session">The corresponding session.</param>
 internal virtual void startProtocol(Session session)
 {
     invalidMessage(session);
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Called when a SYN message is received.
 /// </summary>
 /// <param name="session">The corresponding session.</param>
 /// <param name="authentic">Flag indicating whether the received message was properly signed.</param>
 internal virtual void synReceived(Session session, bool authentic = false)
 {
     invalidMessage(session);
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Default handler for non protocol-conform events.
 /// Ends the respective protocol run.
 /// </summary>
 /// <param name="session">Corresponding Surface protocol run.</param>
 internal virtual void invalidMessage(Session session)
 {
     session._tearDown();
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Called whenever the security status of a session has changed.
 /// </summary>
 /// <param name="session">The corresponding session.</param>
 internal virtual void securityStatusChanged(Session session)
 {
     session._tearDown();
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Ends a protocol run.
 /// </summary>
 /// <param name="session">The corresponding session.</param>
 internal void endProtocol(Session session)
 {
     session.sendCLOSING();
     session._tearDown();
 }
Ejemplo n.º 13
0
 /// <summary>
 /// Called when a CLOSING message is received.
 /// </summary>
 /// <param name="session">The corresponding session.</param>
 /// <param name="authentic">Flag indicating whether the received message was properly signed.</param>
 internal virtual void closingReceived(Session session, bool authentic = false)
 {
     session._tearDown();
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Default function for a state-transition.
 /// </summary>
 /// <param name="session">Corresponding Surface protocol run.</param>
 /// <param name="state">Next state.</param>
 internal virtual void changeState(Session session, State state)
 {
     session.changeState(state);
 }
Ejemplo n.º 15
0
 internal static State Instance(Session session)
 {
     if (session.isSecure == true)
     {
         return Routing.Instance(session);
     }
     else
     {
         //need to do a key-exchange before we can start routing
         return ExchangingKeys.Instance(session);
     }
 }
Ejemplo n.º 16
0
 internal static State Instance(Session session)
 {
     session.initKryptoniteProtocol(session.startedProtocol);
     return state;
 }
Ejemplo n.º 17
0
 internal static State Instance(Session session)
 {
     return state;
 }
Ejemplo n.º 18
0
 internal override void krypt2kryptReceived(Session session, bool authentic = false)
 {
     //no auth-check in this state of the protocol
     session.deployKrypt2Krypt();
 }
Ejemplo n.º 19
0
 //since NACK is al valid message for this state, it is implemented explicitly
 internal override void nackReceived(Session session, bool authentic = false)
 {
     session._tearDown();
 }
Ejemplo n.º 20
0
 internal override void startProtocol(Session session)
 {
     session.sendSYN();
     changeState(session, WaitingForACK.Instance(session));
 }