summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjsing <>2014-07-10 07:41:54 +0000
committerjsing <>2014-07-10 07:41:54 +0000
commita056a5f9321e4e7d039f49d894e59dff155713aa (patch)
tree836884d7a6942b35ff95b36ccd0591d0aa95e35c
parentb3742339325c5255c4d028bbe38491007818891d (diff)
downloadopenbsd-a056a5f9321e4e7d039f49d894e59dff155713aa.tar.gz
openbsd-a056a5f9321e4e7d039f49d894e59dff155713aa.tar.bz2
openbsd-a056a5f9321e4e7d039f49d894e59dff155713aa.zip
Use a while loop instead of an ifdowhile loop.
ok miod@ tedu@
-rw-r--r--src/lib/libcrypto/rsa/rsa_pk1.c11
-rw-r--r--src/lib/libcrypto/rsa/rsa_ssl.c11
-rw-r--r--src/lib/libssl/src/crypto/rsa/rsa_pk1.c11
-rw-r--r--src/lib/libssl/src/crypto/rsa/rsa_ssl.c11
4 files changed, 20 insertions, 24 deletions
diff --git a/src/lib/libcrypto/rsa/rsa_pk1.c b/src/lib/libcrypto/rsa/rsa_pk1.c
index d394b300c6..1d6d688d6b 100644
--- a/src/lib/libcrypto/rsa/rsa_pk1.c
+++ b/src/lib/libcrypto/rsa/rsa_pk1.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_pk1.c,v 1.9 2014/07/09 19:51:38 jsing Exp $ */ 1/* $OpenBSD: rsa_pk1.c,v 1.10 2014/07/10 07:41:54 jsing 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 *
@@ -168,11 +168,10 @@ RSA_padding_add_PKCS1_type_2(unsigned char *to, int tlen,
168 if (RAND_bytes(p, j) <= 0) 168 if (RAND_bytes(p, j) <= 0)
169 return 0; 169 return 0;
170 for (i = 0; i < j; i++) { 170 for (i = 0; i < j; i++) {
171 if (*p == '\0') 171 while (*p == '\0') {
172 do { 172 if (RAND_bytes(p, 1) <= 0)
173 if (RAND_bytes(p, 1) <= 0) 173 return 0;
174 return 0; 174 }
175 } while (*p == '\0');
176 p++; 175 p++;
177 } 176 }
178 177
diff --git a/src/lib/libcrypto/rsa/rsa_ssl.c b/src/lib/libcrypto/rsa/rsa_ssl.c
index 09deb08985..fb2e228454 100644
--- a/src/lib/libcrypto/rsa/rsa_ssl.c
+++ b/src/lib/libcrypto/rsa/rsa_ssl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_ssl.c,v 1.9 2014/07/09 19:51:38 jsing Exp $ */ 1/* $OpenBSD: rsa_ssl.c,v 1.10 2014/07/10 07:41:54 jsing 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 *
@@ -86,11 +86,10 @@ RSA_padding_add_SSLv23(unsigned char *to, int tlen, const unsigned char *from,
86 if (RAND_bytes(p, j) <= 0) 86 if (RAND_bytes(p, j) <= 0)
87 return 0; 87 return 0;
88 for (i = 0; i < j; i++) { 88 for (i = 0; i < j; i++) {
89 if (*p == '\0') 89 while (*p == '\0') {
90 do { 90 if (RAND_bytes(p, 1) <= 0)
91 if (RAND_bytes(p, 1) <= 0) 91 return 0;
92 return 0; 92 }
93 } while (*p == '\0');
94 p++; 93 p++;
95 } 94 }
96 95
diff --git a/src/lib/libssl/src/crypto/rsa/rsa_pk1.c b/src/lib/libssl/src/crypto/rsa/rsa_pk1.c
index d394b300c6..1d6d688d6b 100644
--- a/src/lib/libssl/src/crypto/rsa/rsa_pk1.c
+++ b/src/lib/libssl/src/crypto/rsa/rsa_pk1.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_pk1.c,v 1.9 2014/07/09 19:51:38 jsing Exp $ */ 1/* $OpenBSD: rsa_pk1.c,v 1.10 2014/07/10 07:41:54 jsing 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 *
@@ -168,11 +168,10 @@ RSA_padding_add_PKCS1_type_2(unsigned char *to, int tlen,
168 if (RAND_bytes(p, j) <= 0) 168 if (RAND_bytes(p, j) <= 0)
169 return 0; 169 return 0;
170 for (i = 0; i < j; i++) { 170 for (i = 0; i < j; i++) {
171 if (*p == '\0') 171 while (*p == '\0') {
172 do { 172 if (RAND_bytes(p, 1) <= 0)
173 if (RAND_bytes(p, 1) <= 0) 173 return 0;
174 return 0; 174 }
175 } while (*p == '\0');
176 p++; 175 p++;
177 } 176 }
178 177
diff --git a/src/lib/libssl/src/crypto/rsa/rsa_ssl.c b/src/lib/libssl/src/crypto/rsa/rsa_ssl.c
index 09deb08985..fb2e228454 100644
--- a/src/lib/libssl/src/crypto/rsa/rsa_ssl.c
+++ b/src/lib/libssl/src/crypto/rsa/rsa_ssl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_ssl.c,v 1.9 2014/07/09 19:51:38 jsing Exp $ */ 1/* $OpenBSD: rsa_ssl.c,v 1.10 2014/07/10 07:41:54 jsing 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 *
@@ -86,11 +86,10 @@ RSA_padding_add_SSLv23(unsigned char *to, int tlen, const unsigned char *from,
86 if (RAND_bytes(p, j) <= 0) 86 if (RAND_bytes(p, j) <= 0)
87 return 0; 87 return 0;
88 for (i = 0; i < j; i++) { 88 for (i = 0; i < j; i++) {
89 if (*p == '\0') 89 while (*p == '\0') {
90 do { 90 if (RAND_bytes(p, 1) <= 0)
91 if (RAND_bytes(p, 1) <= 0) 91 return 0;
92 return 0; 92 }
93 } while (*p == '\0');
94 p++; 93 p++;
95 } 94 }
96 95