Skip to content

Commit

Permalink
s390x: Fix GCM setup
Browse files Browse the repository at this point in the history
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: 92c9086 ("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 #18862)

(cherry picked from commit 48e35b9)
  • Loading branch information
juergenchrist authored and t8m committed Nov 23, 2022
1 parent 5c7a383 commit 61763c0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crypto/modes/gcm128.c
Expand Up @@ -495,6 +495,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)
Expand Down

0 comments on commit 61763c0

Please sign in to comment.