summaryrefslogtreecommitdiff
path: root/lib/accelerated
diff options
context:
space:
mode:
authorDmitry Baryshkov <dbaryshkov@gmail.com>2020-03-28 02:29:31 +0300
committerDmitry Baryshkov <dbaryshkov@gmail.com>2020-03-28 02:29:31 +0300
commitf8918981407814dcdc9d70afd00ebf22df04fade (patch)
tree4fd9ec607203c30f8be7b8f38b07b5a69c70c470 /lib/accelerated
parent7054f199ec312f55e13256ccdf0d06b2b2335387 (diff)
downloadgnutls-f8918981407814dcdc9d70afd00ebf22df04fade.tar.gz
padlock: fix exception in sha code
padlock sha code will segfault (at least on Nano) if it is passed a NULL data pointer (even if size is 0). Pass digest output buffer as a dummy data pointer in such case. Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Diffstat (limited to 'lib/accelerated')
-rw-r--r--lib/accelerated/x86/sha-padlock.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/accelerated/x86/sha-padlock.c b/lib/accelerated/x86/sha-padlock.c
index e878ebe310..bfb67f62e9 100644
--- a/lib/accelerated/x86/sha-padlock.c
+++ b/lib/accelerated/x86/sha-padlock.c
@@ -331,6 +331,8 @@ int wrap_padlock_hash_fast(gnutls_digest_algorithm_t algo,
const void *text, size_t text_size,
void *digest)
{
+ if (text_size == 0 && text == NULL)
+ text = digest;
if (algo == GNUTLS_DIG_SHA1) {
uint32_t iv[5] = {
0x67452301UL,