diff options
author | tb <> | 2025-05-20 18:21:34 +0000 |
---|---|---|
committer | tb <> | 2025-05-20 18:21:34 +0000 |
commit | 97c7a3936d826decb38407bb9eb559b20b21a5ef (patch) | |
tree | 3dfdda858887c10095a3e616ad76fcf78ec4bd30 /src/lib | |
parent | c83a8e02e51e7ea9d6fe6162492db7c1dca3725c (diff) | |
download | openbsd-97c7a3936d826decb38407bb9eb559b20b21a5ef.tar.gz openbsd-97c7a3936d826decb38407bb9eb559b20b21a5ef.tar.bz2 openbsd-97c7a3936d826decb38407bb9eb559b20b21a5ef.zip |
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
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/libcrypto/modes/gcm128.c | 4 |
1 files changed, 3 insertions, 1 deletions
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 @@ | |||
1 | /* $OpenBSD: gcm128.c,v 1.40 2025/05/18 09:05:59 jsing Exp $ */ | 1 | /* $OpenBSD: gcm128.c,v 1.41 2025/05/20 18:21:34 tb Exp $ */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright (c) 2010 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 2010 The OpenSSL Project. All rights reserved. |
4 | * | 4 | * |
@@ -428,6 +428,8 @@ CRYPTO_gcm128_init(GCM128_CONTEXT *ctx, void *key, block128_f block) | |||
428 | } | 428 | } |
429 | # else | 429 | # else |
430 | gcm_init_4bit(ctx->Htable, ctx->H.u); | 430 | gcm_init_4bit(ctx->Htable, ctx->H.u); |
431 | ctx->gmult = gcm_gmult_4bit; | ||
432 | ctx->ghash = gcm_ghash_4bit; | ||
431 | # endif | 433 | # endif |
432 | } | 434 | } |
433 | LCRYPTO_ALIAS(CRYPTO_gcm128_init); | 435 | LCRYPTO_ALIAS(CRYPTO_gcm128_init); |