summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/rsa/rsa_pk1.c
diff options
context:
space:
mode:
authorjsing <>2014-07-10 07:41:54 +0000
committerjsing <>2014-07-10 07:41:54 +0000
commitec8c499ef7f0ca14b52a751e7d060abd044b3472 (patch)
tree836884d7a6942b35ff95b36ccd0591d0aa95e35c /src/lib/libcrypto/rsa/rsa_pk1.c
parentcff606a33656a8e3011d25140ec13caa6318498a (diff)
downloadopenbsd-ec8c499ef7f0ca14b52a751e7d060abd044b3472.tar.gz
openbsd-ec8c499ef7f0ca14b52a751e7d060abd044b3472.tar.bz2
openbsd-ec8c499ef7f0ca14b52a751e7d060abd044b3472.zip
Use a while loop instead of an ifdowhile loop.
ok miod@ tedu@
Diffstat (limited to 'src/lib/libcrypto/rsa/rsa_pk1.c')
-rw-r--r--src/lib/libcrypto/rsa/rsa_pk1.c11
1 files changed, 5 insertions, 6 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