From 5167c6e197af8e07e36fa4baa6c48dd4e4c06cf4 Mon Sep 17 00:00:00 2001 From: deraadt Date: Sat, 9 Dec 2017 07:16:51 +0000 Subject: [PATCH] In the middle of CRYPTO_gcm128_finish() there is a complicated #ifdef block which defines a variable late, after code. Place this chunk into a { subblock } to satisfy old compilers and old eyes. --- lib/libcrypto/modes/gcm128.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/libcrypto/modes/gcm128.c b/lib/libcrypto/modes/gcm128.c index 69b1dd4f495..42291519bcf 100644 --- a/lib/libcrypto/modes/gcm128.c +++ b/lib/libcrypto/modes/gcm128.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gcm128.c,v 1.20 2017/09/03 13:07:34 inoguchi Exp $ */ +/* $OpenBSD: gcm128.c,v 1.21 2017/12/09 07:16:51 deraadt Exp $ */ /* ==================================================================== * Copyright (c) 2010 The OpenSSL Project. All rights reserved. * @@ -1515,13 +1515,15 @@ int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx,const unsigned char *tag, alen = BSWAP8(alen); clen = BSWAP8(clen); #else - u8 *p = ctx->len.c; + { + u8 *p = ctx->len.c; - ctx->len.u[0] = alen; - ctx->len.u[1] = clen; + ctx->len.u[0] = alen; + ctx->len.u[1] = clen; - alen = (u64)GETU32(p) <<32|GETU32(p+4); - clen = (u64)GETU32(p+8)<<32|GETU32(p+12); + alen = (u64)GETU32(p) <<32|GETU32(p+4); + clen = (u64)GETU32(p+8)<<32|GETU32(p+12); + } #endif #endif -- 2.20.1