From 97c7a3936d826decb38407bb9eb559b20b21a5ef Mon Sep 17 00:00:00 2001 From: tb <> Date: Tue, 20 May 2025 18:21:34 +0000 Subject: Unbreak GHASH on some architectures setting GHASH_ASM The last #else branch in CRYPTO_gcm128_init() doesn't initialize the function pointers for gmult/ghash, which results in a segfault when using GCM on architectures taking this branch, notably sparc64. found by and fix from jca --- src/lib/libcrypto/modes/gcm128.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/lib/libcrypto/modes') diff --git a/src/lib/libcrypto/modes/gcm128.c b/src/lib/libcrypto/modes/gcm128.c index 8714a33c2c..eeb7f921e6 100644 --- a/src/lib/libcrypto/modes/gcm128.c +++ b/src/lib/libcrypto/modes/gcm128.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gcm128.c,v 1.40 2025/05/18 09:05:59 jsing Exp $ */ +/* $OpenBSD: gcm128.c,v 1.41 2025/05/20 18:21:34 tb Exp $ */ /* ==================================================================== * Copyright (c) 2010 The OpenSSL Project. All rights reserved. * @@ -428,6 +428,8 @@ CRYPTO_gcm128_init(GCM128_CONTEXT *ctx, void *key, block128_f block) } # else gcm_init_4bit(ctx->Htable, ctx->H.u); + ctx->gmult = gcm_gmult_4bit; + ctx->ghash = gcm_ghash_4bit; # endif } LCRYPTO_ALIAS(CRYPTO_gcm128_init); -- cgit v1.2.3-55-g6feb