~vcs-imports/libssh/trunk

Viewing all changes in revision 4480.

  • Committer: Andreas Schneider
  • Author(s): Simo Sorce
  • Date: 2019-03-07 11:03:27 UTC
  • Revision ID: git-v1:c180211c6b804628d308743a51a0270873cf7c6f
Clean up code that generates session keys

This patch simply reworks the code to make it more understandable and
reduce if() branches.
It also avoids reallocs, and instead uses a support buffer to hold
intermediate results of the hmac function so that no buffer overrides
happen when the requested size is not an exact mutiple of the digest_len.

Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: