From: Pádraig Brady
Date: Sun, 24 Jun 2018 08:29:55 +0000 (-0700) Subject: af_alg: fix error handling when hash not returned X-Git-Tag: v1.0~5557 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=4208523235711502ad50692ff8cc2014f3b568e5;p=gnulib.git af_alg: fix error handling when hash not returned * lib/af_alg.c (afalg_stream): Handle the case where we've successfully written data to the kernel in the read/write loop, but the kernel doesn't respond with the hash. --- diff --git a/ChangeLog b/ChangeLog index bb2fabf249..093ec41fb5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -32,6 +32,13 @@ * tests/test-wcwidth.c (main): If the wchar-single module is present, skip the tests in the C locale. +2018-06-24 Pádraig Brady
+ + af_alg: fix error handling when hash not returned + * lib/af_alg.c (afalg_stream): Handle the case where we've + successfully written data to the kernel in the read/write loop, + but the kernel doesn't respond with the hash. + 2018-06-23 Pádraig Brady
crypto: mention --without-linux-crypto in --with-openssl --help diff --git a/lib/af_alg.c b/lib/af_alg.c index ded4b326b7..f362caba8b 100644 --- a/lib/af_alg.c +++ b/lib/af_alg.c @@ -145,7 +145,12 @@ afalg_stream (FILE *stream, const char *alg, } if (result == 0 && read (ofd, resblock, hashlen) != hashlen) - result = -EAFNOSUPPORT; + { + if (nseek == 0 || fseeko (stream, nseek, SEEK_CUR) == 0) + result = -EAFNOSUPPORT; + else + result = -EIO; + } close (ofd); return result; }