From f6cd363abdc14642253822bdc8fbc54c7bb0e213 Mon Sep 17 00:00:00 2001
From: bcook <>
Date: Mon, 18 Jul 2016 01:04:52 +0000
Subject: don't mix code and decls, ok tedu@

---
 src/lib/libcrypto/bn/bn_nist.c         | 5 +++--
 src/lib/libssl/src/crypto/bn/bn_nist.c | 5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

(limited to 'src')

diff --git a/src/lib/libcrypto/bn/bn_nist.c b/src/lib/libcrypto/bn/bn_nist.c
index 9a0970138d..b16584d6b9 100644
--- a/src/lib/libcrypto/bn/bn_nist.c
+++ b/src/lib/libcrypto/bn/bn_nist.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bn_nist.c,v 1.17 2016/07/17 22:01:01 bcook Exp $ */
+/* $OpenBSD: bn_nist.c,v 1.18 2016/07/18 01:04:52 bcook Exp $ */
 /*
  * Written by Nils Larsch for the OpenSSL project
  */
@@ -570,7 +570,6 @@ BN_nist_mod_224(BIGNUM *r, const BIGNUM *a, const BIGNUM *field, BN_CTX *ctx)
 		unsigned int ui[BN_NIST_224_TOP *
 		    sizeof(BN_ULONG) / sizeof(unsigned int)];
 	} buf;
-	memset(&buf, 0, sizeof(buf));
 	BN_ULONG c_d[BN_NIST_224_TOP], *res;
 	uintptr_t mask;
 	union {
@@ -605,6 +604,8 @@ BN_nist_mod_224(BIGNUM *r, const BIGNUM *a, const BIGNUM *field, BN_CTX *ctx)
 	} else
 		r_d = a_d;
 
+	memset(&buf, 0, sizeof(buf));
+
 #if BN_BITS2==64
 	/* copy upper 256 bits of 448 bit number ... */
 	nist_cp_bn_0(c_d, a_d + (BN_NIST_224_TOP - 1),
diff --git a/src/lib/libssl/src/crypto/bn/bn_nist.c b/src/lib/libssl/src/crypto/bn/bn_nist.c
index 9a0970138d..b16584d6b9 100644
--- a/src/lib/libssl/src/crypto/bn/bn_nist.c
+++ b/src/lib/libssl/src/crypto/bn/bn_nist.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bn_nist.c,v 1.17 2016/07/17 22:01:01 bcook Exp $ */
+/* $OpenBSD: bn_nist.c,v 1.18 2016/07/18 01:04:52 bcook Exp $ */
 /*
  * Written by Nils Larsch for the OpenSSL project
  */
@@ -570,7 +570,6 @@ BN_nist_mod_224(BIGNUM *r, const BIGNUM *a, const BIGNUM *field, BN_CTX *ctx)
 		unsigned int ui[BN_NIST_224_TOP *
 		    sizeof(BN_ULONG) / sizeof(unsigned int)];
 	} buf;
-	memset(&buf, 0, sizeof(buf));
 	BN_ULONG c_d[BN_NIST_224_TOP], *res;
 	uintptr_t mask;
 	union {
@@ -605,6 +604,8 @@ BN_nist_mod_224(BIGNUM *r, const BIGNUM *a, const BIGNUM *field, BN_CTX *ctx)
 	} else
 		r_d = a_d;
 
+	memset(&buf, 0, sizeof(buf));
+
 #if BN_BITS2==64
 	/* copy upper 256 bits of 448 bit number ... */
 	nist_cp_bn_0(c_d, a_d + (BN_NIST_224_TOP - 1),
-- 
cgit v1.2.3-55-g6feb