From f0bc313cef3873b6e2f790e436d8043c3039e72a Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Fri, 25 May 2018 23:13:52 +0100 Subject: [PATCH] krb5/crypto: Fix a couple of places where return codes weren't The recent iovec changes introduced a couple of places where return codes were being incorrectly discarded. Fix them so errors get back to callers. --- lib/krb5/crypto.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/krb5/crypto.c b/lib/krb5/crypto.c index 95c9ee3a1..750f92a8c 100644 --- a/lib/krb5/crypto.c +++ b/lib/krb5/crypto.c @@ -331,6 +331,8 @@ _krb5_SP_HMAC_SHA1_checksum(krb5_context context, ret = _krb5_evp_hmac_iov(context, crypto, key, iov, niov, hmac, &hmaclen, EVP_sha1(), NULL); + if (ret) + return ret; heim_assert(result->checksum.length <= hmaclen, "SHA1 checksum too short"); @@ -1994,10 +1996,10 @@ krb5_create_checksum_iov(krb5_context context, ret = create_checksum_iov(context, ct, crypto, keyusage, data, num_data, &cksum); - if (type) + if (ret == 0 && type) *type = cksum.cksumtype; - return 0; + return ret; } /**