[Spice-devel] [PATCH spice-server 00/16] SASL code improvements

Frediano Ziglio fziglio at redhat.com
Thu Dec 14 10:07:32 UTC 2017


SASL authentication code were a bit dodgy to see.
The series have basically 3 parts:
- some minor fixes;
- a test for SASL code;
- some code refactory.

The fixes were handling issues discovered looking at code and writing
the tests.
Test is not that straightforward, maybe some code should be put in
different files. On the other end I don't thing the code that is
mocking SASL will be reused in other tests.
The refactory is mainly put all the authentication logic in one file
(red-stream.c) instead of having half in reds.c and the other half in
red-stream.c. This allows to present a single function instead of one
for each authentication steps.

Frediano Ziglio (16):
  reds: Remove argument from reds_handle_link
  red-stream: Remove SASL "data" field leak
  red-stream: Use mechname for mechname
  red-stream: Simplify mechname matching
  red-stream: Avoid infinite loop on sasl_encode/decode failure
  red-stream: Avoid useless copy of mechlist
  red-stream: Avoid to specify 2 mech names during SASL
  test-sasl: Initial SASL test
  test-sasl: Add code for mocking function to test state
  test-sasl: Base test, connect using SASL
  test-sasl: Add tests for different mechanism names
  test-sasl: Add tests for different failures and cases
  Handle SASL initialisation mainly in red-stream.c
  red-stream: Handle properly endianness in SASL code
  red-stream: Unify start and step passes
  red-stream: Encapsulate all authentication state in RedSASLAuth

 server/red-stream.c      | 348 +++++++++++----------------
 server/red-stream.h      |  11 +-
 server/reds.c            | 126 ++--------
 server/tests/.gitignore  |   1 +
 server/tests/Makefile.am |   1 +
 server/tests/test-sasl.c | 605 +++++++++++++++++++++++++++++++++++++++++++++++
 6 files changed, 767 insertions(+), 325 deletions(-)
 create mode 100644 server/tests/test-sasl.c

-- 
2.14.3



More information about the Spice-devel mailing list