diff options
author | 2014-04-13 21:11:19 +0000 | |
---|---|---|
committer | 2014-04-13 21:11:19 +0000 | |
commit | 2fa0eb2764f33e59b5fd5c912036aeae676b2591 (patch) | |
tree | 75d49a5f5c352421e2f17db5737fc9c89a41c7b7 /lib/libssl/src | |
parent | remove more cases of MS_STATIC, MS_CALLBACK, and MS_FAR. Did you (diff) | |
download | wireguard-openbsd-2fa0eb2764f33e59b5fd5c912036aeae676b2591.tar.xz wireguard-openbsd-2fa0eb2764f33e59b5fd5c912036aeae676b2591.zip |
Do not include "e_os.h" anymore. Simply pull in the necessary headers.
ok miod@, deraadt@
Diffstat (limited to 'lib/libssl/src')
-rw-r--r-- | lib/libssl/src/ssl/d1_clnt.c | 2 | ||||
-rw-r--r-- | lib/libssl/src/ssl/d1_lib.c | 6 | ||||
-rw-r--r-- | lib/libssl/src/ssl/d1_pkt.c | 1 | ||||
-rw-r--r-- | lib/libssl/src/ssl/d1_srvr.c | 2 | ||||
-rw-r--r-- | lib/libssl/src/ssl/s23_clnt.c | 2 | ||||
-rw-r--r-- | lib/libssl/src/ssl/s23_lib.c | 6 | ||||
-rw-r--r-- | lib/libssl/src/ssl/s23_pkt.c | 1 | ||||
-rw-r--r-- | lib/libssl/src/ssl/s23_srvr.c | 2 | ||||
-rw-r--r-- | lib/libssl/src/ssl/s2_clnt.c | 2 | ||||
-rw-r--r-- | lib/libssl/src/ssl/s2_pkt.c | 9 | ||||
-rw-r--r-- | lib/libssl/src/ssl/s2_srvr.c | 4 | ||||
-rw-r--r-- | lib/libssl/src/ssl/s3_clnt.c | 2 | ||||
-rw-r--r-- | lib/libssl/src/ssl/s3_lib.c | 4 | ||||
-rw-r--r-- | lib/libssl/src/ssl/s3_pkt.c | 4 | ||||
-rw-r--r-- | lib/libssl/src/ssl/s3_srvr.c | 2 | ||||
-rw-r--r-- | lib/libssl/src/ssl/ssl_cert.c | 12 | ||||
-rw-r--r-- | lib/libssl/src/ssl/ssl_locl.h | 8 | ||||
-rw-r--r-- | lib/libssl/src/ssl/ssl_task.c | 7 | ||||
-rw-r--r-- | lib/libssl/src/ssl/ssltest.c | 28 |
19 files changed, 59 insertions, 45 deletions
diff --git a/lib/libssl/src/ssl/d1_clnt.c b/lib/libssl/src/ssl/d1_clnt.c index 48e5e06bdeb..eb6ea6c0ec8 100644 --- a/lib/libssl/src/ssl/d1_clnt.c +++ b/lib/libssl/src/ssl/d1_clnt.c @@ -158,7 +158,7 @@ int dtls1_connect(SSL *s) RAND_add(&Time,sizeof(Time),0); ERR_clear_error(); - clear_sys_error(); + errno = 0; if (s->info_callback != NULL) cb=s->info_callback; diff --git a/lib/libssl/src/ssl/d1_lib.c b/lib/libssl/src/ssl/d1_lib.c index 106939f2417..7565ce7e366 100644 --- a/lib/libssl/src/ssl/d1_lib.c +++ b/lib/libssl/src/ssl/d1_lib.c @@ -57,8 +57,12 @@ * */ +#include <sys/param.h> +#include <sys/socket.h> + +#include <netinet/in.h> + #include <stdio.h> -#define USE_SOCKETS #include <openssl/objects.h> #include "ssl_locl.h" diff --git a/lib/libssl/src/ssl/d1_pkt.c b/lib/libssl/src/ssl/d1_pkt.c index 8186462d4a6..52f7fc022fe 100644 --- a/lib/libssl/src/ssl/d1_pkt.c +++ b/lib/libssl/src/ssl/d1_pkt.c @@ -115,7 +115,6 @@ #include <stdio.h> #include <errno.h> -#define USE_SOCKETS #include "ssl_locl.h" #include <openssl/evp.h> #include <openssl/buffer.h> diff --git a/lib/libssl/src/ssl/d1_srvr.c b/lib/libssl/src/ssl/d1_srvr.c index 9975e20873c..aacf8fd380d 100644 --- a/lib/libssl/src/ssl/d1_srvr.c +++ b/lib/libssl/src/ssl/d1_srvr.c @@ -158,7 +158,7 @@ int dtls1_accept(SSL *s) RAND_add(&Time,sizeof(Time),0); ERR_clear_error(); - clear_sys_error(); + errno = 0; if (s->info_callback != NULL) cb=s->info_callback; diff --git a/lib/libssl/src/ssl/s23_clnt.c b/lib/libssl/src/ssl/s23_clnt.c index 2b93c639dd2..6315e9d8765 100644 --- a/lib/libssl/src/ssl/s23_clnt.c +++ b/lib/libssl/src/ssl/s23_clnt.c @@ -152,7 +152,7 @@ int ssl23_connect(SSL *s) RAND_add(&Time,sizeof(Time),0); ERR_clear_error(); - clear_sys_error(); + errno = 0; if (s->info_callback != NULL) cb=s->info_callback; diff --git a/lib/libssl/src/ssl/s23_lib.c b/lib/libssl/src/ssl/s23_lib.c index 3bf728318a4..a6285b767fb 100644 --- a/lib/libssl/src/ssl/s23_lib.c +++ b/lib/libssl/src/ssl/s23_lib.c @@ -121,7 +121,7 @@ int ssl23_read(SSL *s, void *buf, int len) { int n; - clear_sys_error(); + errno = 0; if (SSL_in_init(s) && (!s->in_handshake)) { n=s->handshake_func(s); @@ -144,7 +144,7 @@ int ssl23_peek(SSL *s, void *buf, int len) { int n; - clear_sys_error(); + errno = 0; if (SSL_in_init(s) && (!s->in_handshake)) { n=s->handshake_func(s); @@ -167,7 +167,7 @@ int ssl23_write(SSL *s, const void *buf, int len) { int n; - clear_sys_error(); + errno = 0; if (SSL_in_init(s) && (!s->in_handshake)) { n=s->handshake_func(s); diff --git a/lib/libssl/src/ssl/s23_pkt.c b/lib/libssl/src/ssl/s23_pkt.c index 4ca6a1b2584..eba8d9d8fcd 100644 --- a/lib/libssl/src/ssl/s23_pkt.c +++ b/lib/libssl/src/ssl/s23_pkt.c @@ -58,7 +58,6 @@ #include <stdio.h> #include <errno.h> -#define USE_SOCKETS #include "ssl_locl.h" #include <openssl/evp.h> #include <openssl/buffer.h> diff --git a/lib/libssl/src/ssl/s23_srvr.c b/lib/libssl/src/ssl/s23_srvr.c index 48778490135..2ac8786c626 100644 --- a/lib/libssl/src/ssl/s23_srvr.c +++ b/lib/libssl/src/ssl/s23_srvr.c @@ -154,7 +154,7 @@ int ssl23_accept(SSL *s) RAND_add(&Time,sizeof(Time),0); ERR_clear_error(); - clear_sys_error(); + errno = 0; if (s->info_callback != NULL) cb=s->info_callback; diff --git a/lib/libssl/src/ssl/s2_clnt.c b/lib/libssl/src/ssl/s2_clnt.c index 03b6cf96738..15fbef9c778 100644 --- a/lib/libssl/src/ssl/s2_clnt.c +++ b/lib/libssl/src/ssl/s2_clnt.c @@ -152,7 +152,7 @@ int ssl2_connect(SSL *s) RAND_add(&l,sizeof(l),0); ERR_clear_error(); - clear_sys_error(); + errno = 0; if (s->info_callback != NULL) cb=s->info_callback; diff --git a/lib/libssl/src/ssl/s2_pkt.c b/lib/libssl/src/ssl/s2_pkt.c index 8bb6ab8baa3..7efad40153b 100644 --- a/lib/libssl/src/ssl/s2_pkt.c +++ b/lib/libssl/src/ssl/s2_pkt.c @@ -113,7 +113,6 @@ #ifndef OPENSSL_NO_SSL2 #include <stdio.h> #include <errno.h> -#define USE_SOCKETS static int read_n(SSL *s,unsigned int n,unsigned int max,unsigned int extend); static int n_do_ssl_write(SSL *s, const unsigned char *buf, unsigned int len); @@ -144,7 +143,7 @@ static int ssl2_read_internal(SSL *s, void *buf, int len, int peek) } } - clear_sys_error(); + errno = 0; s->rwstate=SSL_NOTHING; if (len <= 0) return(len); @@ -372,7 +371,7 @@ static int read_n(SSL *s, unsigned int n, unsigned int max, s->packet=s->s2->rbuf; while (newb < (int)n) { - clear_sys_error(); + errno = 0; if (s->rbio != NULL) { s->rwstate=SSL_READING; @@ -438,7 +437,7 @@ int ssl2_write(SSL *s, const void *_buf, int len) return(-1); } - clear_sys_error(); + errno = 0; s->rwstate=SSL_NOTHING; if (len <= 0) return(len); @@ -483,7 +482,7 @@ static int write_pending(SSL *s, const unsigned char *buf, unsigned int len) for (;;) { - clear_sys_error(); + errno = 0; if (s->wbio != NULL) { s->rwstate=SSL_WRITING; diff --git a/lib/libssl/src/ssl/s2_srvr.c b/lib/libssl/src/ssl/s2_srvr.c index 2cba426bb7e..cac405db7c7 100644 --- a/lib/libssl/src/ssl/s2_srvr.c +++ b/lib/libssl/src/ssl/s2_srvr.c @@ -153,7 +153,7 @@ int ssl2_accept(SSL *s) RAND_add(&l,sizeof(l),0); ERR_clear_error(); - clear_sys_error(); + errno = 0; if (s->info_callback != NULL) cb=s->info_callback; @@ -170,7 +170,7 @@ int ssl2_accept(SSL *s) return(-1); } - clear_sys_error(); + errno = 0; for (;;) { state=s->state; diff --git a/lib/libssl/src/ssl/s3_clnt.c b/lib/libssl/src/ssl/s3_clnt.c index a6b3c01afa1..64e7be8d67a 100644 --- a/lib/libssl/src/ssl/s3_clnt.c +++ b/lib/libssl/src/ssl/s3_clnt.c @@ -193,7 +193,7 @@ int ssl3_connect(SSL *s) RAND_add(&Time,sizeof(Time),0); ERR_clear_error(); - clear_sys_error(); + errno = 0; if (s->info_callback != NULL) cb=s->info_callback; diff --git a/lib/libssl/src/ssl/s3_lib.c b/lib/libssl/src/ssl/s3_lib.c index 6b2739161de..fd1e7b80d8c 100644 --- a/lib/libssl/src/ssl/s3_lib.c +++ b/lib/libssl/src/ssl/s3_lib.c @@ -4167,7 +4167,7 @@ int ssl3_write(SSL *s, const void *buf, int len) return(0); } #endif - clear_sys_error(); + errno = 0; if (s->s3->renegotiate) ssl3_renegotiate_check(s); /* This is an experimental flag that sends the @@ -4213,7 +4213,7 @@ static int ssl3_read_internal(SSL *s, void *buf, int len, int peek) { int ret; - clear_sys_error(); + errno = 0; if (s->s3->renegotiate) ssl3_renegotiate_check(s); s->s3->in_read_app_data=1; ret=s->method->ssl_read_bytes(s,SSL3_RT_APPLICATION_DATA,buf,len,peek); diff --git a/lib/libssl/src/ssl/s3_pkt.c b/lib/libssl/src/ssl/s3_pkt.c index 96ba63262e4..6b55d21a3e9 100644 --- a/lib/libssl/src/ssl/s3_pkt.c +++ b/lib/libssl/src/ssl/s3_pkt.c @@ -232,7 +232,7 @@ int ssl3_read_n(SSL *s, int n, int max, int extend) * and need to read in more until we have len+n (up to * len+max if possible) */ - clear_sys_error(); + errno = 0; if (s->rbio != NULL) { s->rwstate=SSL_READING; @@ -874,7 +874,7 @@ int ssl3_write_pending(SSL *s, int type, const unsigned char *buf, for (;;) { - clear_sys_error(); + errno = 0; if (s->wbio != NULL) { s->rwstate=SSL_WRITING; diff --git a/lib/libssl/src/ssl/s3_srvr.c b/lib/libssl/src/ssl/s3_srvr.c index 9ac19c05f22..518dfcd5e28 100644 --- a/lib/libssl/src/ssl/s3_srvr.c +++ b/lib/libssl/src/ssl/s3_srvr.c @@ -220,7 +220,7 @@ int ssl3_accept(SSL *s) RAND_add(&Time,sizeof(Time),0); ERR_clear_error(); - clear_sys_error(); + errno = 0; if (s->info_callback != NULL) cb=s->info_callback; diff --git a/lib/libssl/src/ssl/ssl_cert.c b/lib/libssl/src/ssl/ssl_cert.c index 5123a89182e..6d144077f9f 100644 --- a/lib/libssl/src/ssl/ssl_cert.c +++ b/lib/libssl/src/ssl/ssl_cert.c @@ -114,13 +114,13 @@ * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project. */ -#include <stdio.h> +#include <sys/types.h> -#include "e_os.h" -#ifndef NO_SYS_TYPES_H -# include <sys/types.h> -#endif +#include <stdio.h> +#include <unistd.h> +#include <openssl/opensslconf.h> +#include <openssl/e_os2.h> #include "o_dir.h" #include <openssl/objects.h> #include <openssl/bio.h> @@ -837,7 +837,7 @@ int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack, if (errno) { - SYSerr(SYS_F_OPENDIR, get_last_sys_error()); + SYSerr(SYS_F_OPENDIR, errno); ERR_add_error_data(3, "OPENSSL_DIR_read(&ctx, '", dir, "')"); SSLerr(SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK, ERR_R_SYS_LIB); goto err; diff --git a/lib/libssl/src/ssl/ssl_locl.h b/lib/libssl/src/ssl/ssl_locl.h index e4859077481..e7fecbc3cb6 100644 --- a/lib/libssl/src/ssl/ssl_locl.h +++ b/lib/libssl/src/ssl/ssl_locl.h @@ -142,13 +142,17 @@ #ifndef HEADER_SSL_LOCL_H #define HEADER_SSL_LOCL_H + +#include <sys/types.h> + #include <stdlib.h> #include <time.h> #include <string.h> #include <errno.h> +#include <unistd.h> -#include "e_os.h" - +#include <openssl/opensslconf.h> +#include <openssl/e_os2.h> #include <openssl/buffer.h> #ifndef OPENSSL_NO_COMP #include <openssl/comp.h> diff --git a/lib/libssl/src/ssl/ssl_task.c b/lib/libssl/src/ssl/ssl_task.c index 416fb16743b..366204f097a 100644 --- a/lib/libssl/src/ssl/ssl_task.c +++ b/lib/libssl/src/ssl/ssl_task.c @@ -114,6 +114,8 @@ * Author: Dave Jones * Date: 22-JUL-1996 */ +#include <sys/types.h> + #include <stdlib.h> #include <stdio.h> #include <iodef.h> /* VMS IO$_ definitions */ @@ -123,9 +125,10 @@ int LIB$INIT_TIMER(), LIB$SHOW_TIMER(); #include <string.h> /* from ssltest.c */ #include <errno.h> +#include <unistd.h> -#include "e_os.h" - +#include <openssl/opensslconf.h> +#include <openssl/e_os2.h> #include <openssl/buffer.h> #include <openssl/x509.h> #include <openssl/ssl.h> diff --git a/lib/libssl/src/ssl/ssltest.c b/lib/libssl/src/ssl/ssltest.c index 8a602cc551b..1e285a5c52d 100644 --- a/lib/libssl/src/ssl/ssltest.c +++ b/lib/libssl/src/ssl/ssltest.c @@ -142,17 +142,21 @@ #define _BSD_SOURCE 1 /* Or gethostname won't be declared properly on Linux and GNU platforms. */ +#include <sys/types.h> +#include <sys/param.h> +#include <sys/socket.h> + +#include <netinet/in.h> #include <assert.h> #include <errno.h> #include <limits.h> +#include <netdb.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> - -#define USE_SOCKETS -#include "e_os.h" +#include <unistd.h> #ifdef OPENSSL_SYS_VMS #define _XOPEN_SOURCE 500 /* Or isascii won't be declared properly on @@ -161,6 +165,8 @@ #include <ctype.h> +#include <openssl/opensslconf.h> +#include <openssl/e_os2.h> #include <openssl/bio.h> #include <openssl/crypto.h> #include <openssl/evp.h> @@ -586,7 +592,7 @@ int main(int argc, char *argv[]) fips_mode=1; #else fprintf(stderr,"not compiled with FIPS support, so exitting without running.\n"); - EXIT(0); + exit(0); #endif } else if (strcmp(*argv,"-server_auth") == 0) @@ -785,7 +791,7 @@ bad: { /* ensure that the cipher list are correctly sorted and exit */ if (do_test_cipherlist() == 0) - EXIT(1); + exit(1); ret = 0; goto end; } @@ -796,7 +802,7 @@ bad: "the test anyway (and\n-d to see what happens), " "or add one of -ssl2, -ssl3, -tls1, -reuse\n" "to avoid protocol mismatch.\n"); - EXIT(1); + exit(1); } #ifdef OPENSSL_FIPS @@ -806,7 +812,7 @@ bad: { ERR_load_crypto_strings(); ERR_print_errors(BIO_new_fp(stderr,BIO_NOCLOSE)); - EXIT(1); + exit(1); } else fprintf(stderr,"*** IN FIPS MODE ***\n"); @@ -1150,7 +1156,7 @@ end: EVP_cleanup(); CRYPTO_mem_leaks(bio_err); if (bio_err != NULL) BIO_free(bio_err); - EXIT(ret); + exit(ret); return ret; } @@ -2144,7 +2150,7 @@ static int process_proxy_cond_multipliers(unsigned int letters[26], default: fprintf(stderr, "SOMETHING IS SERIOUSLY WRONG!" " STOPPING\n"); - EXIT(1); + exit(1); } } break; @@ -2207,7 +2213,7 @@ static int process_proxy_cond_adders(unsigned int letters[26], default: fprintf(stderr, "SOMETHING IS SERIOUSLY WRONG!" " STOPPING\n"); - EXIT(1); + exit(1); } } break; @@ -2306,7 +2312,7 @@ static int app_verify_callback(X509_STORE_CTX *ctx, void *arg) cb_arg->proxy_cond, &cond_end); if (ok < 0) - EXIT(3); + exit(3); if (*cond_end) { fprintf(stderr, "Stopped processing condition before it's end.\n"); |