]> git.ipfire.org Git - thirdparty/openssl.git/commit - ssl/ssl_locl.h
Add initial state machine rewrite code
authorMatt Caswell <matt@openssl.org>
Wed, 29 Jul 2015 13:23:56 +0000 (14:23 +0100)
committerMatt Caswell <matt@openssl.org>
Fri, 30 Oct 2015 08:27:59 +0000 (08:27 +0000)
commitf8e0a5573820bd7318782d4954c6643ff7e58102
tree4b6a7fa073da7a0c12fbf856eb2ea58c526a627d
parent9ab930b27d51a13362e6647074f13589a8ac004d
Add initial state machine rewrite code

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: Tim Hudson <tjh@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
include/openssl/ssl.h
ssl/Makefile
ssl/s3_both.c
ssl/s3_lib.c
ssl/ssl_err.c
ssl/ssl_lib.c
ssl/ssl_locl.h
ssl/statem.c [new file with mode: 0644]