Allow zero-length encrypt IOVs in _krb5_evp_encrypt_iov_cts()
commit07b3e6fd748e05a40d6e53b0c92d0b74f97406b2
authorSimon Wilkinson <sxw@auristor.com>
Tue, 18 Sep 2018 14:43:28 +0000 (18 15:43 +0100)
committerJeffrey Altman <jaltman@auristor.com>
Tue, 18 Sep 2018 23:23:31 +0000 (18 19:23 -0400)
tree0acddc3b4764dc19bba14b94636750e22805a726
parentd570541e3d399eaa39cf8b88a6252ac9cf8333de
Allow zero-length encrypt IOVs in _krb5_evp_encrypt_iov_cts()

The iovec encryption code doesn't handle 0 length iovecs correctly.
Instead of just skipping them, _krb5_evp_encrypt_iov_cts() will spin
on the 0 length iovec.

Modify the _krb5_evp_iov_cursor_expand helper so that iovec expansion
simply skips 0 length iovecs, and make _krb5_evp_iov_cursor_nextcrypt
do the same.

Original bug report and tests from Andrew Bartlett <abartlet@samba.org>
lib/gssapi/test_context.c
lib/krb5/crypto-evp.c