summaryrefslogtreecommitdiffstats
path: root/lib/libcrypto/rsa/rsa_ssl.c
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2014-07-10 07:41:54 +0000
committerjsing <jsing@openbsd.org>2014-07-10 07:41:54 +0000
commit119425a268a75dc2daee336f5f2afe5c6d80d9aa (patch)
tree47a75ca6e986dcf34056c21fceb55dbe7e172a74 /lib/libcrypto/rsa/rsa_ssl.c
parenttypo in previous (diff)
downloadwireguard-openbsd-119425a268a75dc2daee336f5f2afe5c6d80d9aa.tar.xz
wireguard-openbsd-119425a268a75dc2daee336f5f2afe5c6d80d9aa.zip
Use a while loop instead of an ifdowhile loop.
ok miod@ tedu@
Diffstat (limited to 'lib/libcrypto/rsa/rsa_ssl.c')
-rw-r--r--lib/libcrypto/rsa/rsa_ssl.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/libcrypto/rsa/rsa_ssl.c b/lib/libcrypto/rsa/rsa_ssl.c
index 09deb08985b..fb2e2284545 100644
--- a/lib/libcrypto/rsa/rsa_ssl.c
+++ b/lib/libcrypto/rsa/rsa_ssl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rsa_ssl.c,v 1.9 2014/07/09 19:51:38 jsing Exp $ */
+/* $OpenBSD: rsa_ssl.c,v 1.10 2014/07/10 07:41:54 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -86,11 +86,10 @@ RSA_padding_add_SSLv23(unsigned char *to, int tlen, const unsigned char *from,
if (RAND_bytes(p, j) <= 0)
return 0;
for (i = 0; i < j; i++) {
- if (*p == '\0')
- do {
- if (RAND_bytes(p, 1) <= 0)
- return 0;
- } while (*p == '\0');
+ while (*p == '\0') {
+ if (RAND_bytes(p, 1) <= 0)
+ return 0;
+ }
p++;
}