summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorderaadt <>2014-04-19 16:46:08 +0000
committerderaadt <>2014-04-19 16:46:08 +0000
commit293abf5613325cc93a869974ce3262f4cb33083b (patch)
tree2759e9cd491998cc2d97da7646f12f9514ddbccd /src
parenta267d032e2aaa6ac481f33615c9e57c613d49e2e (diff)
downloadopenbsd-293abf5613325cc93a869974ce3262f4cb33083b.tar.gz
openbsd-293abf5613325cc93a869974ce3262f4cb33083b.tar.bz2
openbsd-293abf5613325cc93a869974ce3262f4cb33083b.zip
remove the openssl_fdset wrapper, and a variety of VMS'ism's like
crazy (void *) casts all over the place ok beck jsing
Diffstat (limited to 'src')
-rw-r--r--src/lib/libssl/src/apps/apps.h2
-rw-r--r--src/lib/libssl/src/apps/ocsp.c10
-rw-r--r--src/lib/libssl/src/apps/s_client.c20
-rw-r--r--src/lib/libssl/src/apps/s_server.c14
-rw-r--r--src/lib/libssl/src/apps/s_socket.c10
-rw-r--r--src/lib/libssl/src/apps/s_time.c11
6 files changed, 19 insertions, 48 deletions
diff --git a/src/lib/libssl/src/apps/apps.h b/src/lib/libssl/src/apps/apps.h
index eae0f4708a..9a5b77f807 100644
--- a/src/lib/libssl/src/apps/apps.h
+++ b/src/lib/libssl/src/apps/apps.h
@@ -170,8 +170,6 @@ extern BIO *bio_err;
170# endif 170# endif
171#endif 171#endif
172 172
173# define openssl_fdset(a,b) FD_SET(a, b)
174
175typedef struct args_st { 173typedef struct args_st {
176 char **data; 174 char **data;
177 int count; 175 int count;
diff --git a/src/lib/libssl/src/apps/ocsp.c b/src/lib/libssl/src/apps/ocsp.c
index 91e5b8cbd2..5b296a96b7 100644
--- a/src/lib/libssl/src/apps/ocsp.c
+++ b/src/lib/libssl/src/apps/ocsp.c
@@ -1131,10 +1131,10 @@ query_responder(BIO * err, BIO * cbio, char *path,
1131 } 1131 }
1132 if (req_timeout != -1 && rv <= 0) { 1132 if (req_timeout != -1 && rv <= 0) {
1133 FD_ZERO(&confds); 1133 FD_ZERO(&confds);
1134 openssl_fdset(fd, &confds); 1134 FD_SET(fd, &confds);
1135 tv.tv_usec = 0; 1135 tv.tv_usec = 0;
1136 tv.tv_sec = req_timeout; 1136 tv.tv_sec = req_timeout;
1137 rv = select(fd + 1, NULL, (void *) &confds, NULL, &tv); 1137 rv = select(fd + 1, NULL, &confds, NULL, &tv);
1138 if (rv == 0) { 1138 if (rv == 0) {
1139 BIO_puts(err, "Timeout on connect\n"); 1139 BIO_puts(err, "Timeout on connect\n");
1140 return NULL; 1140 return NULL;
@@ -1160,13 +1160,13 @@ query_responder(BIO * err, BIO * cbio, char *path,
1160 if (req_timeout == -1) 1160 if (req_timeout == -1)
1161 continue; 1161 continue;
1162 FD_ZERO(&confds); 1162 FD_ZERO(&confds);
1163 openssl_fdset(fd, &confds); 1163 FD_SET(fd, &confds);
1164 tv.tv_usec = 0; 1164 tv.tv_usec = 0;
1165 tv.tv_sec = req_timeout; 1165 tv.tv_sec = req_timeout;
1166 if (BIO_should_read(cbio)) 1166 if (BIO_should_read(cbio))
1167 rv = select(fd + 1, (void *) &confds, NULL, NULL, &tv); 1167 rv = select(fd + 1, &confds, NULL, NULL, &tv);
1168 else if (BIO_should_write(cbio)) 1168 else if (BIO_should_write(cbio))
1169 rv = select(fd + 1, NULL, (void *) &confds, NULL, &tv); 1169 rv = select(fd + 1, NULL, &confds, NULL, &tv);
1170 else { 1170 else {
1171 BIO_puts(err, "Unexpected retry condition\n"); 1171 BIO_puts(err, "Unexpected retry condition\n");
1172 goto err; 1172 goto err;
diff --git a/src/lib/libssl/src/apps/s_client.c b/src/lib/libssl/src/apps/s_client.c
index fada0827a4..94f02e8d5a 100644
--- a/src/lib/libssl/src/apps/s_client.c
+++ b/src/lib/libssl/src/apps/s_client.c
@@ -1432,29 +1432,23 @@ re_start:
1432 1432
1433 ssl_pending = read_ssl && SSL_pending(con); 1433 ssl_pending = read_ssl && SSL_pending(con);
1434 1434
1435 /* XXX should add tests for fd_set overflow */
1436
1435 if (!ssl_pending) { 1437 if (!ssl_pending) {
1436 if (tty_on) { 1438 if (tty_on) {
1437 if (read_tty) 1439 if (read_tty)
1438 openssl_fdset(fileno(stdin), &readfds); 1440 FD_SET(fileno(stdin), &readfds);
1439 if (write_tty) 1441 if (write_tty)
1440 openssl_fdset(fileno(stdout), &writefds); 1442 FD_SET(fileno(stdout), &writefds);
1441 } 1443 }
1442 if (read_ssl) 1444 if (read_ssl)
1443 openssl_fdset(SSL_get_fd(con), &readfds); 1445 FD_SET(SSL_get_fd(con), &readfds);
1444 if (write_ssl) 1446 if (write_ssl)
1445 openssl_fdset(SSL_get_fd(con), &writefds); 1447 FD_SET(SSL_get_fd(con), &writefds);
1446/* printf("mode tty(%d %d%d) ssl(%d%d)\n", 1448/* printf("mode tty(%d %d%d) ssl(%d%d)\n",
1447 tty_on,read_tty,write_tty,read_ssl,write_ssl);*/ 1449 tty_on,read_tty,write_tty,read_ssl,write_ssl);*/
1448 1450
1449 /* 1451 i = select(width, &readfds, &writefds,
1450 * Note: under VMS with SOCKETSHR the second
1451 * parameter is currently of type (int *) whereas
1452 * under other systems it is (void *) if you don't
1453 * have a cast it will choke the compiler: if you do
1454 * have a cast then you can either go for (int *) or
1455 * (void *).
1456 */
1457 i = select(width, (void *) &readfds, (void *) &writefds,
1458 NULL, timeoutp); 1452 NULL, timeoutp);
1459 if (i < 0) { 1453 if (i < 0) {
1460 BIO_printf(bio_err, "bad select %d\n", 1454 BIO_printf(bio_err, "bad select %d\n",
diff --git a/src/lib/libssl/src/apps/s_server.c b/src/lib/libssl/src/apps/s_server.c
index 1082ee51ee..b5c6c2fa7b 100644
--- a/src/lib/libssl/src/apps/s_server.c
+++ b/src/lib/libssl/src/apps/s_server.c
@@ -1773,23 +1773,15 @@ sv_body(char *hostname, int s, unsigned char *context)
1773 1773
1774 if (!read_from_sslcon) { 1774 if (!read_from_sslcon) {
1775 FD_ZERO(&readfds); 1775 FD_ZERO(&readfds);
1776 openssl_fdset(fileno(stdin), &readfds); 1776 FD_SET(fileno(stdin), &readfds);
1777 openssl_fdset(s, &readfds); 1777 FD_SET(s, &readfds);
1778 /*
1779 * Note: under VMS with SOCKETSHR the second
1780 * parameter is currently of type (int *) whereas
1781 * under other systems it is (void *) if you don't
1782 * have a cast it will choke the compiler: if you do
1783 * have a cast then you can either go for (int *) or
1784 * (void *).
1785 */
1786 if ((SSL_version(con) == DTLS1_VERSION) && 1778 if ((SSL_version(con) == DTLS1_VERSION) &&
1787 DTLSv1_get_timeout(con, &timeout)) 1779 DTLSv1_get_timeout(con, &timeout))
1788 timeoutp = &timeout; 1780 timeoutp = &timeout;
1789 else 1781 else
1790 timeoutp = NULL; 1782 timeoutp = NULL;
1791 1783
1792 i = select(width, (void *) &readfds, NULL, NULL, timeoutp); 1784 i = select(width, &readfds, NULL, NULL, timeoutp);
1793 1785
1794 if ((SSL_version(con) == DTLS1_VERSION) && DTLSv1_handle_timeout(con) > 0) { 1786 if ((SSL_version(con) == DTLS1_VERSION) && DTLSv1_handle_timeout(con) > 0) {
1795 BIO_printf(bio_err, "TIMEOUT occured\n"); 1787 BIO_printf(bio_err, "TIMEOUT occured\n");
diff --git a/src/lib/libssl/src/apps/s_socket.c b/src/lib/libssl/src/apps/s_socket.c
index 01257a525e..a44dddb6f5 100644
--- a/src/lib/libssl/src/apps/s_socket.c
+++ b/src/lib/libssl/src/apps/s_socket.c
@@ -245,7 +245,7 @@ do_accept(int acc_sock, int *sock, char **host)
245 int ret; 245 int ret;
246 struct hostent *h1, *h2; 246 struct hostent *h1, *h2;
247 static struct sockaddr_in from; 247 static struct sockaddr_in from;
248 int len; 248 socklen_t len;
249/* struct linger ling; */ 249/* struct linger ling; */
250 250
251 if (!ssl_sock_init()) 251 if (!ssl_sock_init())
@@ -255,13 +255,7 @@ redoit:
255 255
256 memset((char *) &from, 0, sizeof(from)); 256 memset((char *) &from, 0, sizeof(from));
257 len = sizeof(from); 257 len = sizeof(from);
258 /* 258 ret = accept(acc_sock, (struct sockaddr *) & from, &len);
259 * Note: under VMS with SOCKETSHR the fourth parameter is currently
260 * of type (int *) whereas under other systems it is (void *) if you
261 * don't have a cast it will choke the compiler: if you do have a
262 * cast then you can either go for (int *) or (void *).
263 */
264 ret = accept(acc_sock, (struct sockaddr *) & from, (void *) &len);
265 if (ret == -1) { 259 if (ret == -1) {
266 if (errno == EINTR) { 260 if (errno == EINTR) {
267 /* check_timeout(); */ 261 /* check_timeout(); */
diff --git a/src/lib/libssl/src/apps/s_time.c b/src/lib/libssl/src/apps/s_time.c
index 169a9d7839..d8f7294c1e 100644
--- a/src/lib/libssl/src/apps/s_time.c
+++ b/src/lib/libssl/src/apps/s_time.c
@@ -598,15 +598,8 @@ doConnection(SSL * scon)
598 i = SSL_get_fd(serverCon); 598 i = SSL_get_fd(serverCon);
599 width = i + 1; 599 width = i + 1;
600 FD_ZERO(&readfds); 600 FD_ZERO(&readfds);
601 openssl_fdset(i, &readfds); 601 FD_SET(i, &readfds);
602 /* 602 select(width, &readfds, NULL, NULL, NULL);
603 * Note: under VMS with SOCKETSHR the 2nd parameter
604 * is currently of type (int *) whereas under other
605 * systems it is (void *) if you don't have a cast it
606 * will choke the compiler: if you do have a cast
607 * then you can either go for (int *) or (void *).
608 */
609 select(width, (void *) &readfds, NULL, NULL, NULL);
610 continue; 603 continue;
611 } 604 }
612 break; 605 break;