• M
    Add initial state machine rewrite code · f8e0a557
    Matt Caswell 提交于
    This is the first drop of the new state machine code.
    
    The rewrite has the following objectives:
    - Remove duplication of state code between client and server
    - Remove duplication of state code between TLS and DTLS
    - Simplify transitions and bring the logic together in a single location
      so that it is easier to validate
    - Remove duplication of code between each of the message handling functions
    - Receive a message first and then work out whether that is a valid
      transition - not the other way around (the other way causes lots of issues
      where we are expecting one type of message next but actually get something
      else)
    - Separate message flow state from handshake state (in order to better
      understand each)
      - message flow state = when to flush buffers; handling restarts in the
        event of NBIO events; handling the common flow of steps for reading a
        message and the common flow of steps for writing a message etc
      - handshake state = what handshake message are we working on now
    - Control complexity: only the state machine can change state: keep all
      the state changes local to a file
    
    This builds on previous state machine related work:
    - Surface CCS processing in the state machine
    - Version negotiation rewrite
    Reviewed-by: NTim Hudson <tjh@openssl.org>
    Reviewed-by: NRichard Levitte <levitte@openssl.org>
    f8e0a557
ssl_locl.h 88.4 KB