summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authordoug <>2015-03-21 08:05:20 +0000
committerdoug <>2015-03-21 08:05:20 +0000
commit2898b0c3a5e1e7f791f70cf4578bb2486c0612fa (patch)
treec3416a85e2e2b40bd36b2e8e612c00007e05c003 /src/lib
parentc12f0e8171f2b611dd77254adddc73b4b515947e (diff)
downloadopenbsd-2898b0c3a5e1e7f791f70cf4578bb2486c0612fa.tar.gz
openbsd-2898b0c3a5e1e7f791f70cf4578bb2486c0612fa.tar.bz2
openbsd-2898b0c3a5e1e7f791f70cf4578bb2486c0612fa.zip
Fix indentation that incorrectly implies a different control flow.
The actual control flow is intentional while the indenting is incorrect. This is intended to be a cosmetic change. Verified that each of these was part of a KNF commit that wasn't intending to change behavior. Also, double checked against the history of changes in OpenSSL and BoringSSL. Addresses Coverity CIDs: 78842, 78859, 78863. ok tedu@
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/bio/bss_mem.c4
-rw-r--r--src/lib/libcrypto/bn/bn_exp.c5
-rw-r--r--src/lib/libcrypto/bn/bn_recp.c10
-rw-r--r--src/lib/libssl/src/crypto/bio/bss_mem.c4
-rw-r--r--src/lib/libssl/src/crypto/bn/bn_exp.c5
-rw-r--r--src/lib/libssl/src/crypto/bn/bn_recp.c10
6 files changed, 22 insertions, 16 deletions
diff --git a/src/lib/libcrypto/bio/bss_mem.c b/src/lib/libcrypto/bio/bss_mem.c
index 8310f8cf4d..119bd672f6 100644
--- a/src/lib/libcrypto/bio/bss_mem.c
+++ b/src/lib/libcrypto/bio/bss_mem.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bss_mem.c,v 1.13 2014/07/11 08:44:47 jsing Exp $ */ 1/* $OpenBSD: bss_mem.c,v 1.14 2015/03/21 08:05:20 doug Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -142,7 +142,7 @@ mem_free(BIO *a)
142 b = (BUF_MEM *)a->ptr; 142 b = (BUF_MEM *)a->ptr;
143 if (a->flags & BIO_FLAGS_MEM_RDONLY) 143 if (a->flags & BIO_FLAGS_MEM_RDONLY)
144 b->data = NULL; 144 b->data = NULL;
145 BUF_MEM_free(b); 145 BUF_MEM_free(b);
146 a->ptr = NULL; 146 a->ptr = NULL;
147 } 147 }
148 } 148 }
diff --git a/src/lib/libcrypto/bn/bn_exp.c b/src/lib/libcrypto/bn/bn_exp.c
index 12de0c5a12..4a28c2c605 100644
--- a/src/lib/libcrypto/bn/bn_exp.c
+++ b/src/lib/libcrypto/bn/bn_exp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_exp.c,v 1.21 2015/02/14 15:13:24 miod Exp $ */ 1/* $OpenBSD: bn_exp.c,v 1.22 2015/03/21 08:05:20 doug Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -874,7 +874,8 @@ BN_mod_exp_mont_word(BIGNUM *rr, BN_ULONG a, const BIGNUM *p, const BIGNUM *m,
874 } 874 }
875 if (m->top == 1) 875 if (m->top == 1)
876 a %= m->d[0]; /* make sure that 'a' is reduced */ 876 a %= m->d[0]; /* make sure that 'a' is reduced */
877 bits = BN_num_bits(p); 877
878 bits = BN_num_bits(p);
878 if (bits == 0) { 879 if (bits == 0) {
879 ret = BN_one(rr); 880 ret = BN_one(rr);
880 return ret; 881 return ret;
diff --git a/src/lib/libcrypto/bn/bn_recp.c b/src/lib/libcrypto/bn/bn_recp.c
index b90c5421f1..7b31fe0adf 100644
--- a/src/lib/libcrypto/bn/bn_recp.c
+++ b/src/lib/libcrypto/bn/bn_recp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_recp.c,v 1.11 2014/07/11 08:44:48 jsing Exp $ */ 1/* $OpenBSD: bn_recp.c,v 1.12 2015/03/21 08:05:20 doug Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -181,9 +181,11 @@ BN_div_recp(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, BN_RECP_CTX *recp,
181 181
182 /* Nr := round(2^i / N) */ 182 /* Nr := round(2^i / N) */
183 if (i != recp->shift) 183 if (i != recp->shift)
184 recp->shift = BN_reciprocal(&(recp->Nr), &(recp->N), i, ctx); /* BN_reciprocal returns i, or -1 for an error */ 184 recp->shift = BN_reciprocal(&(recp->Nr), &(recp->N), i, ctx);
185 if (recp->shift == -1) 185
186 goto err; 186 /* BN_reciprocal returns i, or -1 for an error */
187 if (recp->shift == -1)
188 goto err;
187 189
188 /* d := |round(round(m / 2^BN_num_bits(N)) * recp->Nr / 2^(i - BN_num_bits(N)))| 190 /* d := |round(round(m / 2^BN_num_bits(N)) * recp->Nr / 2^(i - BN_num_bits(N)))|
189 * = |round(round(m / 2^BN_num_bits(N)) * round(2^i / N) / 2^(i - BN_num_bits(N)))| 191 * = |round(round(m / 2^BN_num_bits(N)) * round(2^i / N) / 2^(i - BN_num_bits(N)))|
diff --git a/src/lib/libssl/src/crypto/bio/bss_mem.c b/src/lib/libssl/src/crypto/bio/bss_mem.c
index 8310f8cf4d..119bd672f6 100644
--- a/src/lib/libssl/src/crypto/bio/bss_mem.c
+++ b/src/lib/libssl/src/crypto/bio/bss_mem.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bss_mem.c,v 1.13 2014/07/11 08:44:47 jsing Exp $ */ 1/* $OpenBSD: bss_mem.c,v 1.14 2015/03/21 08:05:20 doug Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -142,7 +142,7 @@ mem_free(BIO *a)
142 b = (BUF_MEM *)a->ptr; 142 b = (BUF_MEM *)a->ptr;
143 if (a->flags & BIO_FLAGS_MEM_RDONLY) 143 if (a->flags & BIO_FLAGS_MEM_RDONLY)
144 b->data = NULL; 144 b->data = NULL;
145 BUF_MEM_free(b); 145 BUF_MEM_free(b);
146 a->ptr = NULL; 146 a->ptr = NULL;
147 } 147 }
148 } 148 }
diff --git a/src/lib/libssl/src/crypto/bn/bn_exp.c b/src/lib/libssl/src/crypto/bn/bn_exp.c
index 12de0c5a12..4a28c2c605 100644
--- a/src/lib/libssl/src/crypto/bn/bn_exp.c
+++ b/src/lib/libssl/src/crypto/bn/bn_exp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_exp.c,v 1.21 2015/02/14 15:13:24 miod Exp $ */ 1/* $OpenBSD: bn_exp.c,v 1.22 2015/03/21 08:05:20 doug Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -874,7 +874,8 @@ BN_mod_exp_mont_word(BIGNUM *rr, BN_ULONG a, const BIGNUM *p, const BIGNUM *m,
874 } 874 }
875 if (m->top == 1) 875 if (m->top == 1)
876 a %= m->d[0]; /* make sure that 'a' is reduced */ 876 a %= m->d[0]; /* make sure that 'a' is reduced */
877 bits = BN_num_bits(p); 877
878 bits = BN_num_bits(p);
878 if (bits == 0) { 879 if (bits == 0) {
879 ret = BN_one(rr); 880 ret = BN_one(rr);
880 return ret; 881 return ret;
diff --git a/src/lib/libssl/src/crypto/bn/bn_recp.c b/src/lib/libssl/src/crypto/bn/bn_recp.c
index b90c5421f1..7b31fe0adf 100644
--- a/src/lib/libssl/src/crypto/bn/bn_recp.c
+++ b/src/lib/libssl/src/crypto/bn/bn_recp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_recp.c,v 1.11 2014/07/11 08:44:48 jsing Exp $ */ 1/* $OpenBSD: bn_recp.c,v 1.12 2015/03/21 08:05:20 doug Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -181,9 +181,11 @@ BN_div_recp(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, BN_RECP_CTX *recp,
181 181
182 /* Nr := round(2^i / N) */ 182 /* Nr := round(2^i / N) */
183 if (i != recp->shift) 183 if (i != recp->shift)
184 recp->shift = BN_reciprocal(&(recp->Nr), &(recp->N), i, ctx); /* BN_reciprocal returns i, or -1 for an error */ 184 recp->shift = BN_reciprocal(&(recp->Nr), &(recp->N), i, ctx);
185 if (recp->shift == -1) 185
186 goto err; 186 /* BN_reciprocal returns i, or -1 for an error */
187 if (recp->shift == -1)
188 goto err;
187 189
188 /* d := |round(round(m / 2^BN_num_bits(N)) * recp->Nr / 2^(i - BN_num_bits(N)))| 190 /* d := |round(round(m / 2^BN_num_bits(N)) * recp->Nr / 2^(i - BN_num_bits(N)))|
189 * = |round(round(m / 2^BN_num_bits(N)) * round(2^i / N) / 2^(i - BN_num_bits(N)))| 191 * = |round(round(m / 2^BN_num_bits(N)) * round(2^i / N) / 2^(i - BN_num_bits(N)))|