summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2017-12-09 07:16:51 +0000
committerderaadt <deraadt@openbsd.org>2017-12-09 07:16:51 +0000
commit5167c6e197af8e07e36fa4baa6c48dd4e4c06cf4 (patch)
treee3daa1857a48cb992f3ef2f7a9b478b7be90d9c6
parentPlease variable decl before code. (diff)
downloadwireguard-openbsd-5167c6e197af8e07e36fa4baa6c48dd4e4c06cf4.tar.xz
wireguard-openbsd-5167c6e197af8e07e36fa4baa6c48dd4e4c06cf4.zip
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.
-rw-r--r--lib/libcrypto/modes/gcm128.c14
1 files 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