krb5: Use iovecs for internal checksum handling
Modify the signature of the checksum operation in the krb5_checksum_type structure so that it processes iovecs rather than solid blocks of data. Update all of the implementations of these functions for all of the checksum types that we support so that they process iovecs, either by iterating through the iovec in each function, or by calling _krb5_evp_digest_iov or _krb5_evp_hmac_iov() Update callers of these functions so that they turn their single blocks of data into a single iovec of the correct type before calling checksum
This commit is contained in:

committed by
Jeffrey Altman

parent
3484f092e5
commit
ca756f0f7f
@@ -88,6 +88,7 @@ HMAC_MD5_any_checksum(krb5_context context,
|
||||
Checksum *result)
|
||||
{
|
||||
struct _krb5_key_data local_key;
|
||||
struct krb5_crypto_iov iov;
|
||||
krb5_error_code ret;
|
||||
|
||||
memset(&local_key, 0, sizeof(local_key));
|
||||
@@ -103,7 +104,11 @@ HMAC_MD5_any_checksum(krb5_context context,
|
||||
}
|
||||
|
||||
result->cksumtype = CKSUMTYPE_HMAC_MD5;
|
||||
ret = _krb5_HMAC_MD5_checksum(context, &local_key, data, len, usage, result);
|
||||
iov.data.data = (void *)data;
|
||||
iov.data.length = len;
|
||||
iov.flags = KRB5_CRYPTO_TYPE_DATA;
|
||||
|
||||
ret = _krb5_HMAC_MD5_checksum(context, &local_key, usage, &iov, 1, result);
|
||||
if (ret)
|
||||
krb5_data_free(&result->checksum);
|
||||
|
||||
|
Reference in New Issue
Block a user