]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
s390x: Fix GCM setup
authorJuergen Christ <jchrist@linux.ibm.com>
Mon, 25 Jul 2022 08:34:26 +0000 (10:34 +0200)
committerHugo Landau <hlandau@openssl.org>
Tue, 26 Jul 2022 11:27:59 +0000 (12:27 +0100)
Rework of GCM code did not include s390x causing NULL pointer dereferences on
GCM operations other than AES-GCM on platforms that support kma.  Fix this by
a proper setup of the function pointers.

Fixes: 92c9086e5c2b ("Use separate function to get GCM functions")
Signed-off-by: Juergen Christ <jchrist@linux.ibm.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18862)

crypto/modes/gcm128.c

index e6e3455fd0e37d7e99fb98fc8a4464dfc14c1831..22ce8500b61444971f76aacb804004ef229e894c 100644 (file)
@@ -499,6 +499,11 @@ static void gcm_get_funcs(struct gcm_funcs_st *ctx)
     }
     return;
 #endif
+#if defined(__s390__) || defined(__s390x__)
+    ctx->gmult = gcm_gmult_4bit;
+    ctx->ghash = gcm_ghash_4bit;
+    return;
+#endif
 }
 
 void CRYPTO_gcm128_init(GCM128_CONTEXT *ctx, void *key, block128_f block)