diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/bio/b_sock.c | 42 | ||||
| -rw-r--r-- | src/lib/libcrypto/bio/bss_acpt.c | 18 | ||||
| -rw-r--r-- | src/lib/libcrypto/bio/bss_conn.c | 24 | ||||
| -rw-r--r-- | src/lib/libcrypto/bio/bss_dgram.c | 26 | ||||
| -rw-r--r-- | src/lib/libcrypto/bio/bss_fd.c | 6 | ||||
| -rw-r--r-- | src/lib/libcrypto/bio/bss_file.c | 6 | ||||
| -rw-r--r-- | src/lib/libcrypto/bio/bss_sock.c | 10 | ||||
| -rw-r--r-- | src/lib/libcrypto/err/err.c | 2 | ||||
| -rw-r--r-- | src/lib/libssl/src/apps/s_client.c | 22 | ||||
| -rw-r--r-- | src/lib/libssl/src/apps/s_server.c | 12 | ||||
| -rw-r--r-- | src/lib/libssl/src/apps/s_socket.c | 21 | ||||
| -rw-r--r-- | src/lib/libssl/src/apps/s_time.c | 12 | ||||
| -rw-r--r-- | src/lib/libssl/src/crypto/bio/b_sock.c | 42 | ||||
| -rw-r--r-- | src/lib/libssl/src/crypto/bio/bss_acpt.c | 18 | ||||
| -rw-r--r-- | src/lib/libssl/src/crypto/bio/bss_conn.c | 24 | ||||
| -rw-r--r-- | src/lib/libssl/src/crypto/bio/bss_dgram.c | 26 | ||||
| -rw-r--r-- | src/lib/libssl/src/crypto/bio/bss_fd.c | 6 | ||||
| -rw-r--r-- | src/lib/libssl/src/crypto/bio/bss_file.c | 6 | ||||
| -rw-r--r-- | src/lib/libssl/src/crypto/bio/bss_sock.c | 10 | ||||
| -rw-r--r-- | src/lib/libssl/src/crypto/err/err.c | 2 | ||||
| -rw-r--r-- | src/lib/libssl/src/e_os.h | 30 |
21 files changed, 179 insertions, 186 deletions
diff --git a/src/lib/libcrypto/bio/b_sock.c b/src/lib/libcrypto/bio/b_sock.c index 41f958be71..779acbaaf5 100644 --- a/src/lib/libcrypto/bio/b_sock.c +++ b/src/lib/libcrypto/bio/b_sock.c | |||
| @@ -221,7 +221,7 @@ int BIO_get_port(const char *str, unsigned short *port_ptr) | |||
| 221 | #endif | 221 | #endif |
| 222 | else | 222 | else |
| 223 | { | 223 | { |
| 224 | SYSerr(SYS_F_GETSERVBYNAME,get_last_socket_error()); | 224 | SYSerr(SYS_F_GETSERVBYNAME,errno); |
| 225 | ERR_add_error_data(3,"service='",str,"'"); | 225 | ERR_add_error_data(3,"service='",str,"'"); |
| 226 | return(0); | 226 | return(0); |
| 227 | } | 227 | } |
| @@ -549,7 +549,7 @@ int BIO_socket_ioctl(int fd, long type, void *arg) | |||
| 549 | int i; | 549 | int i; |
| 550 | 550 | ||
| 551 | #ifdef __DJGPP__ | 551 | #ifdef __DJGPP__ |
| 552 | i=ioctlsocket(fd,type,(char *)arg); | 552 | i=ioctl(fd,type,(char *)arg); |
| 553 | #else | 553 | #else |
| 554 | # if defined(OPENSSL_SYS_VMS) | 554 | # if defined(OPENSSL_SYS_VMS) |
| 555 | /* 2011-02-18 SMS. | 555 | /* 2011-02-18 SMS. |
| @@ -574,10 +574,10 @@ int BIO_socket_ioctl(int fd, long type, void *arg) | |||
| 574 | # define ARG arg | 574 | # define ARG arg |
| 575 | # endif /* defined(OPENSSL_SYS_VMS) [else] */ | 575 | # endif /* defined(OPENSSL_SYS_VMS) [else] */ |
| 576 | 576 | ||
| 577 | i=ioctlsocket(fd,type,ARG); | 577 | i=ioctl(fd,type,ARG); |
| 578 | #endif /* __DJGPP__ */ | 578 | #endif /* __DJGPP__ */ |
| 579 | if (i < 0) | 579 | if (i < 0) |
| 580 | SYSerr(SYS_F_IOCTLSOCKET,get_last_socket_error()); | 580 | SYSerr(SYS_F_IOCTLSOCKET,errno); |
| 581 | return(i); | 581 | return(i); |
| 582 | } | 582 | } |
| 583 | #endif /* __VMS_VER */ | 583 | #endif /* __VMS_VER */ |
| @@ -629,7 +629,7 @@ int BIO_get_accept_socket(char *host, int bind_mode) | |||
| 629 | struct sockaddr_in6 sa_in6; | 629 | struct sockaddr_in6 sa_in6; |
| 630 | #endif | 630 | #endif |
| 631 | } server,client; | 631 | } server,client; |
| 632 | int s=INVALID_SOCKET,cs,addrlen; | 632 | int s=-1,cs,addrlen; |
| 633 | unsigned char ip[4]; | 633 | unsigned char ip[4]; |
| 634 | unsigned short port; | 634 | unsigned short port; |
| 635 | char *str=NULL,*e; | 635 | char *str=NULL,*e; |
| @@ -637,9 +637,9 @@ int BIO_get_accept_socket(char *host, int bind_mode) | |||
| 637 | unsigned long l; | 637 | unsigned long l; |
| 638 | int err_num; | 638 | int err_num; |
| 639 | 639 | ||
| 640 | if (BIO_sock_init() != 1) return(INVALID_SOCKET); | 640 | if (BIO_sock_init() != 1) return(-1); |
| 641 | 641 | ||
| 642 | if ((str=BUF_strdup(host)) == NULL) return(INVALID_SOCKET); | 642 | if ((str=BUF_strdup(host)) == NULL) return(-1); |
| 643 | 643 | ||
| 644 | h=p=NULL; | 644 | h=p=NULL; |
| 645 | h=str; | 645 | h=str; |
| @@ -736,9 +736,9 @@ int BIO_get_accept_socket(char *host, int bind_mode) | |||
| 736 | 736 | ||
| 737 | again: | 737 | again: |
| 738 | s=socket(server.sa.sa_family,SOCK_STREAM,SOCKET_PROTOCOL); | 738 | s=socket(server.sa.sa_family,SOCK_STREAM,SOCKET_PROTOCOL); |
| 739 | if (s == INVALID_SOCKET) | 739 | if (s == -1) |
| 740 | { | 740 | { |
| 741 | SYSerr(SYS_F_SOCKET,get_last_socket_error()); | 741 | SYSerr(SYS_F_SOCKET,errno); |
| 742 | ERR_add_error_data(3,"port='",host,"'"); | 742 | ERR_add_error_data(3,"port='",host,"'"); |
| 743 | BIOerr(BIO_F_BIO_GET_ACCEPT_SOCKET,BIO_R_UNABLE_TO_CREATE_SOCKET); | 743 | BIOerr(BIO_F_BIO_GET_ACCEPT_SOCKET,BIO_R_UNABLE_TO_CREATE_SOCKET); |
| 744 | goto err; | 744 | goto err; |
| @@ -756,7 +756,7 @@ again: | |||
| 756 | if (bind(s,&server.sa,addrlen) == -1) | 756 | if (bind(s,&server.sa,addrlen) == -1) |
| 757 | { | 757 | { |
| 758 | #ifdef SO_REUSEADDR | 758 | #ifdef SO_REUSEADDR |
| 759 | err_num=get_last_socket_error(); | 759 | err_num=errno; |
| 760 | if ((bind_mode == BIO_BIND_REUSEADDR_IF_UNUSED) && | 760 | if ((bind_mode == BIO_BIND_REUSEADDR_IF_UNUSED) && |
| 761 | #ifdef OPENSSL_SYS_WINDOWS | 761 | #ifdef OPENSSL_SYS_WINDOWS |
| 762 | /* Some versions of Windows define EADDRINUSE to | 762 | /* Some versions of Windows define EADDRINUSE to |
| @@ -785,15 +785,15 @@ again: | |||
| 785 | else goto err; | 785 | else goto err; |
| 786 | } | 786 | } |
| 787 | cs=socket(client.sa.sa_family,SOCK_STREAM,SOCKET_PROTOCOL); | 787 | cs=socket(client.sa.sa_family,SOCK_STREAM,SOCKET_PROTOCOL); |
| 788 | if (cs != INVALID_SOCKET) | 788 | if (cs != -1) |
| 789 | { | 789 | { |
| 790 | int ii; | 790 | int ii; |
| 791 | ii=connect(cs,&client.sa,addrlen); | 791 | ii=connect(cs,&client.sa,addrlen); |
| 792 | closesocket(cs); | 792 | close(cs); |
| 793 | if (ii == INVALID_SOCKET) | 793 | if (ii == -1) |
| 794 | { | 794 | { |
| 795 | bind_mode=BIO_BIND_REUSEADDR; | 795 | bind_mode=BIO_BIND_REUSEADDR; |
| 796 | closesocket(s); | 796 | close(s); |
| 797 | goto again; | 797 | goto again; |
| 798 | } | 798 | } |
| 799 | /* else error */ | 799 | /* else error */ |
| @@ -808,7 +808,7 @@ again: | |||
| 808 | } | 808 | } |
| 809 | if (listen(s,MAX_LISTEN) == -1) | 809 | if (listen(s,MAX_LISTEN) == -1) |
| 810 | { | 810 | { |
| 811 | SYSerr(SYS_F_BIND,get_last_socket_error()); | 811 | SYSerr(SYS_F_BIND,errno); |
| 812 | ERR_add_error_data(3,"port='",host,"'"); | 812 | ERR_add_error_data(3,"port='",host,"'"); |
| 813 | BIOerr(BIO_F_BIO_GET_ACCEPT_SOCKET,BIO_R_UNABLE_TO_LISTEN_SOCKET); | 813 | BIOerr(BIO_F_BIO_GET_ACCEPT_SOCKET,BIO_R_UNABLE_TO_LISTEN_SOCKET); |
| 814 | goto err; | 814 | goto err; |
| @@ -816,17 +816,17 @@ again: | |||
| 816 | ret=1; | 816 | ret=1; |
| 817 | err: | 817 | err: |
| 818 | if (str != NULL) OPENSSL_free(str); | 818 | if (str != NULL) OPENSSL_free(str); |
| 819 | if ((ret == 0) && (s != INVALID_SOCKET)) | 819 | if ((ret == 0) && (s != -1)) |
| 820 | { | 820 | { |
| 821 | closesocket(s); | 821 | close(s); |
| 822 | s= INVALID_SOCKET; | 822 | s= -1; |
| 823 | } | 823 | } |
| 824 | return(s); | 824 | return(s); |
| 825 | } | 825 | } |
| 826 | 826 | ||
| 827 | int BIO_accept(int sock, char **addr) | 827 | int BIO_accept(int sock, char **addr) |
| 828 | { | 828 | { |
| 829 | int ret=INVALID_SOCKET; | 829 | int ret=-1; |
| 830 | unsigned long l; | 830 | unsigned long l; |
| 831 | unsigned short port; | 831 | unsigned short port; |
| 832 | char *p; | 832 | char *p; |
| @@ -873,10 +873,10 @@ int BIO_accept(int sock, char **addr) | |||
| 873 | sa.len.i = (int)sa.len.s; | 873 | sa.len.i = (int)sa.len.s; |
| 874 | /* use sa.len.i from this point */ | 874 | /* use sa.len.i from this point */ |
| 875 | } | 875 | } |
| 876 | if (ret == INVALID_SOCKET) | 876 | if (ret == -1) |
| 877 | { | 877 | { |
| 878 | if(BIO_sock_should_retry(ret)) return -2; | 878 | if(BIO_sock_should_retry(ret)) return -2; |
| 879 | SYSerr(SYS_F_ACCEPT,get_last_socket_error()); | 879 | SYSerr(SYS_F_ACCEPT,errno); |
| 880 | BIOerr(BIO_F_BIO_ACCEPT,BIO_R_ACCEPT_ERROR); | 880 | BIOerr(BIO_F_BIO_ACCEPT,BIO_R_ACCEPT_ERROR); |
| 881 | goto end; | 881 | goto end; |
| 882 | } | 882 | } |
diff --git a/src/lib/libcrypto/bio/bss_acpt.c b/src/lib/libcrypto/bio/bss_acpt.c index 5d49e1a72b..5507a53a2f 100644 --- a/src/lib/libcrypto/bio/bss_acpt.c +++ b/src/lib/libcrypto/bio/bss_acpt.c | |||
| @@ -131,7 +131,7 @@ static int acpt_new(BIO *bi) | |||
| 131 | BIO_ACCEPT *ba; | 131 | BIO_ACCEPT *ba; |
| 132 | 132 | ||
| 133 | bi->init=0; | 133 | bi->init=0; |
| 134 | bi->num=INVALID_SOCKET; | 134 | bi->num=-1; |
| 135 | bi->flags=0; | 135 | bi->flags=0; |
| 136 | if ((ba=BIO_ACCEPT_new()) == NULL) | 136 | if ((ba=BIO_ACCEPT_new()) == NULL) |
| 137 | return(0); | 137 | return(0); |
| @@ -149,7 +149,7 @@ static BIO_ACCEPT *BIO_ACCEPT_new(void) | |||
| 149 | return(NULL); | 149 | return(NULL); |
| 150 | 150 | ||
| 151 | memset(ret,0,sizeof(BIO_ACCEPT)); | 151 | memset(ret,0,sizeof(BIO_ACCEPT)); |
| 152 | ret->accept_sock=INVALID_SOCKET; | 152 | ret->accept_sock=-1; |
| 153 | ret->bind_mode=BIO_BIND_NORMAL; | 153 | ret->bind_mode=BIO_BIND_NORMAL; |
| 154 | return(ret); | 154 | return(ret); |
| 155 | } | 155 | } |
| @@ -170,12 +170,12 @@ static void acpt_close_socket(BIO *bio) | |||
| 170 | BIO_ACCEPT *c; | 170 | BIO_ACCEPT *c; |
| 171 | 171 | ||
| 172 | c=(BIO_ACCEPT *)bio->ptr; | 172 | c=(BIO_ACCEPT *)bio->ptr; |
| 173 | if (c->accept_sock != INVALID_SOCKET) | 173 | if (c->accept_sock != -1) |
| 174 | { | 174 | { |
| 175 | shutdown(c->accept_sock,2); | 175 | shutdown(c->accept_sock,2); |
| 176 | closesocket(c->accept_sock); | 176 | close(c->accept_sock); |
| 177 | c->accept_sock=INVALID_SOCKET; | 177 | c->accept_sock=-1; |
| 178 | bio->num=INVALID_SOCKET; | 178 | bio->num=-1; |
| 179 | } | 179 | } |
| 180 | } | 180 | } |
| 181 | 181 | ||
| @@ -213,14 +213,14 @@ again: | |||
| 213 | return(-1); | 213 | return(-1); |
| 214 | } | 214 | } |
| 215 | s=BIO_get_accept_socket(c->param_addr,c->bind_mode); | 215 | s=BIO_get_accept_socket(c->param_addr,c->bind_mode); |
| 216 | if (s == INVALID_SOCKET) | 216 | if (s == -1) |
| 217 | return(-1); | 217 | return(-1); |
| 218 | 218 | ||
| 219 | if (c->accept_nbio) | 219 | if (c->accept_nbio) |
| 220 | { | 220 | { |
| 221 | if (!BIO_socket_nbio(s,1)) | 221 | if (!BIO_socket_nbio(s,1)) |
| 222 | { | 222 | { |
| 223 | closesocket(s); | 223 | close(s); |
| 224 | BIOerr(BIO_F_ACPT_STATE,BIO_R_ERROR_SETTING_NBIO_ON_ACCEPT_SOCKET); | 224 | BIOerr(BIO_F_ACPT_STATE,BIO_R_ERROR_SETTING_NBIO_ON_ACCEPT_SOCKET); |
| 225 | return(-1); | 225 | return(-1); |
| 226 | } | 226 | } |
| @@ -282,7 +282,7 @@ err: | |||
| 282 | if (bio != NULL) | 282 | if (bio != NULL) |
| 283 | BIO_free(bio); | 283 | BIO_free(bio); |
| 284 | else if (s >= 0) | 284 | else if (s >= 0) |
| 285 | closesocket(s); | 285 | close(s); |
| 286 | return(0); | 286 | return(0); |
| 287 | /* break; */ | 287 | /* break; */ |
| 288 | case ACPT_S_OK: | 288 | case ACPT_S_OK: |
diff --git a/src/lib/libcrypto/bio/bss_conn.c b/src/lib/libcrypto/bio/bss_conn.c index c14727855b..bdf540030c 100644 --- a/src/lib/libcrypto/bio/bss_conn.c +++ b/src/lib/libcrypto/bio/bss_conn.c | |||
| @@ -210,9 +210,9 @@ static int conn_state(BIO *b, BIO_CONNECT *c) | |||
| 210 | c->state=BIO_CONN_S_CREATE_SOCKET; | 210 | c->state=BIO_CONN_S_CREATE_SOCKET; |
| 211 | 211 | ||
| 212 | ret=socket(AF_INET,SOCK_STREAM,SOCKET_PROTOCOL); | 212 | ret=socket(AF_INET,SOCK_STREAM,SOCKET_PROTOCOL); |
| 213 | if (ret == INVALID_SOCKET) | 213 | if (ret == -1) |
| 214 | { | 214 | { |
| 215 | SYSerr(SYS_F_SOCKET,get_last_socket_error()); | 215 | SYSerr(SYS_F_SOCKET,errno); |
| 216 | ERR_add_error_data(4,"host=",c->param_hostname, | 216 | ERR_add_error_data(4,"host=",c->param_hostname, |
| 217 | ":",c->param_port); | 217 | ":",c->param_port); |
| 218 | BIOerr(BIO_F_CONN_STATE,BIO_R_UNABLE_TO_CREATE_SOCKET); | 218 | BIOerr(BIO_F_CONN_STATE,BIO_R_UNABLE_TO_CREATE_SOCKET); |
| @@ -241,7 +241,7 @@ static int conn_state(BIO *b, BIO_CONNECT *c) | |||
| 241 | i=setsockopt(b->num,SOL_SOCKET,SO_KEEPALIVE,(char *)&i,sizeof(i)); | 241 | i=setsockopt(b->num,SOL_SOCKET,SO_KEEPALIVE,(char *)&i,sizeof(i)); |
| 242 | if (i < 0) | 242 | if (i < 0) |
| 243 | { | 243 | { |
| 244 | SYSerr(SYS_F_SOCKET,get_last_socket_error()); | 244 | SYSerr(SYS_F_SOCKET,errno); |
| 245 | ERR_add_error_data(4,"host=",c->param_hostname, | 245 | ERR_add_error_data(4,"host=",c->param_hostname, |
| 246 | ":",c->param_port); | 246 | ":",c->param_port); |
| 247 | BIOerr(BIO_F_CONN_STATE,BIO_R_KEEPALIVE); | 247 | BIOerr(BIO_F_CONN_STATE,BIO_R_KEEPALIVE); |
| @@ -266,7 +266,7 @@ static int conn_state(BIO *b, BIO_CONNECT *c) | |||
| 266 | } | 266 | } |
| 267 | else | 267 | else |
| 268 | { | 268 | { |
| 269 | SYSerr(SYS_F_CONNECT,get_last_socket_error()); | 269 | SYSerr(SYS_F_CONNECT,errno); |
| 270 | ERR_add_error_data(4,"host=", | 270 | ERR_add_error_data(4,"host=", |
| 271 | c->param_hostname, | 271 | c->param_hostname, |
| 272 | ":",c->param_port); | 272 | ":",c->param_port); |
| @@ -358,7 +358,7 @@ BIO_METHOD *BIO_s_connect(void) | |||
| 358 | static int conn_new(BIO *bi) | 358 | static int conn_new(BIO *bi) |
| 359 | { | 359 | { |
| 360 | bi->init=0; | 360 | bi->init=0; |
| 361 | bi->num=INVALID_SOCKET; | 361 | bi->num=-1; |
| 362 | bi->flags=0; | 362 | bi->flags=0; |
| 363 | if ((bi->ptr=(char *)BIO_CONNECT_new()) == NULL) | 363 | if ((bi->ptr=(char *)BIO_CONNECT_new()) == NULL) |
| 364 | return(0); | 364 | return(0); |
| @@ -371,13 +371,13 @@ static void conn_close_socket(BIO *bio) | |||
| 371 | BIO_CONNECT *c; | 371 | BIO_CONNECT *c; |
| 372 | 372 | ||
| 373 | c=(BIO_CONNECT *)bio->ptr; | 373 | c=(BIO_CONNECT *)bio->ptr; |
| 374 | if (bio->num != INVALID_SOCKET) | 374 | if (bio->num != -1) |
| 375 | { | 375 | { |
| 376 | /* Only do a shutdown if things were established */ | 376 | /* Only do a shutdown if things were established */ |
| 377 | if (c->state == BIO_CONN_S_OK) | 377 | if (c->state == BIO_CONN_S_OK) |
| 378 | shutdown(bio->num,2); | 378 | shutdown(bio->num,2); |
| 379 | closesocket(bio->num); | 379 | close(bio->num); |
| 380 | bio->num=INVALID_SOCKET; | 380 | bio->num=-1; |
| 381 | } | 381 | } |
| 382 | } | 382 | } |
| 383 | 383 | ||
| @@ -414,8 +414,8 @@ static int conn_read(BIO *b, char *out, int outl) | |||
| 414 | 414 | ||
| 415 | if (out != NULL) | 415 | if (out != NULL) |
| 416 | { | 416 | { |
| 417 | clear_socket_error(); | 417 | errno = 0; |
| 418 | ret=readsocket(b->num,out,outl); | 418 | ret=read(b->num,out,outl); |
| 419 | BIO_clear_retry_flags(b); | 419 | BIO_clear_retry_flags(b); |
| 420 | if (ret <= 0) | 420 | if (ret <= 0) |
| 421 | { | 421 | { |
| @@ -438,8 +438,8 @@ static int conn_write(BIO *b, const char *in, int inl) | |||
| 438 | if (ret <= 0) return(ret); | 438 | if (ret <= 0) return(ret); |
| 439 | } | 439 | } |
| 440 | 440 | ||
| 441 | clear_socket_error(); | 441 | errno = 0; |
| 442 | ret=writesocket(b->num,in,inl); | 442 | ret=write(b->num,in,inl); |
| 443 | BIO_clear_retry_flags(b); | 443 | BIO_clear_retry_flags(b); |
| 444 | if (ret <= 0) | 444 | if (ret <= 0) |
| 445 | { | 445 | { |
diff --git a/src/lib/libcrypto/bio/bss_dgram.c b/src/lib/libcrypto/bio/bss_dgram.c index f39f94f7fe..d09c0fc33e 100644 --- a/src/lib/libcrypto/bio/bss_dgram.c +++ b/src/lib/libcrypto/bio/bss_dgram.c | |||
| @@ -383,7 +383,7 @@ static int dgram_read(BIO *b, char *out, int outl) | |||
| 383 | 383 | ||
| 384 | if (out != NULL) | 384 | if (out != NULL) |
| 385 | { | 385 | { |
| 386 | clear_socket_error(); | 386 | errno = 0; |
| 387 | memset(&sa.peer, 0x00, sizeof(sa.peer)); | 387 | memset(&sa.peer, 0x00, sizeof(sa.peer)); |
| 388 | dgram_adjust_rcv_timeout(b); | 388 | dgram_adjust_rcv_timeout(b); |
| 389 | ret=recvfrom(b->num,out,outl,0,&sa.peer.sa,(void *)&sa.len); | 389 | ret=recvfrom(b->num,out,outl,0,&sa.peer.sa,(void *)&sa.len); |
| @@ -402,7 +402,7 @@ static int dgram_read(BIO *b, char *out, int outl) | |||
| 402 | if (BIO_dgram_should_retry(ret)) | 402 | if (BIO_dgram_should_retry(ret)) |
| 403 | { | 403 | { |
| 404 | BIO_set_retry_read(b); | 404 | BIO_set_retry_read(b); |
| 405 | data->_errno = get_last_socket_error(); | 405 | data->_errno = errno; |
| 406 | } | 406 | } |
| 407 | } | 407 | } |
| 408 | 408 | ||
| @@ -415,10 +415,10 @@ static int dgram_write(BIO *b, const char *in, int inl) | |||
| 415 | { | 415 | { |
| 416 | int ret; | 416 | int ret; |
| 417 | bio_dgram_data *data = (bio_dgram_data *)b->ptr; | 417 | bio_dgram_data *data = (bio_dgram_data *)b->ptr; |
| 418 | clear_socket_error(); | 418 | errno = 0; |
| 419 | 419 | ||
| 420 | if ( data->connected ) | 420 | if ( data->connected ) |
| 421 | ret=writesocket(b->num,in,inl); | 421 | ret=write(b->num,in,inl); |
| 422 | else | 422 | else |
| 423 | { | 423 | { |
| 424 | int peerlen = sizeof(data->peer); | 424 | int peerlen = sizeof(data->peer); |
| @@ -442,7 +442,7 @@ static int dgram_write(BIO *b, const char *in, int inl) | |||
| 442 | if (BIO_dgram_should_retry(ret)) | 442 | if (BIO_dgram_should_retry(ret)) |
| 443 | { | 443 | { |
| 444 | BIO_set_retry_write(b); | 444 | BIO_set_retry_write(b); |
| 445 | data->_errno = get_last_socket_error(); | 445 | data->_errno = errno; |
| 446 | 446 | ||
| 447 | #if 0 /* higher layers are responsible for querying MTU, if necessary */ | 447 | #if 0 /* higher layers are responsible for querying MTU, if necessary */ |
| 448 | if ( data->_errno == EMSGSIZE) | 448 | if ( data->_errno == EMSGSIZE) |
| @@ -1018,7 +1018,7 @@ static int dgram_sctp_read(BIO *b, char *out, int outl) | |||
| 1018 | 1018 | ||
| 1019 | if (out != NULL) | 1019 | if (out != NULL) |
| 1020 | { | 1020 | { |
| 1021 | clear_socket_error(); | 1021 | errno = 0; |
| 1022 | 1022 | ||
| 1023 | do | 1023 | do |
| 1024 | { | 1024 | { |
| @@ -1180,7 +1180,7 @@ static int dgram_sctp_read(BIO *b, char *out, int outl) | |||
| 1180 | if (BIO_dgram_should_retry(ret)) | 1180 | if (BIO_dgram_should_retry(ret)) |
| 1181 | { | 1181 | { |
| 1182 | BIO_set_retry_read(b); | 1182 | BIO_set_retry_read(b); |
| 1183 | data->_errno = get_last_socket_error(); | 1183 | data->_errno = errno; |
| 1184 | } | 1184 | } |
| 1185 | } | 1185 | } |
| 1186 | 1186 | ||
| @@ -1238,7 +1238,7 @@ static int dgram_sctp_write(BIO *b, const char *in, int inl) | |||
| 1238 | struct sctp_sndrcvinfo *sndrcvinfo; | 1238 | struct sctp_sndrcvinfo *sndrcvinfo; |
| 1239 | #endif | 1239 | #endif |
| 1240 | 1240 | ||
| 1241 | clear_socket_error(); | 1241 | errno = 0; |
| 1242 | 1242 | ||
| 1243 | /* If we're send anything else than application data, | 1243 | /* If we're send anything else than application data, |
| 1244 | * disable all user parameters and flags. | 1244 | * disable all user parameters and flags. |
| @@ -1321,7 +1321,7 @@ static int dgram_sctp_write(BIO *b, const char *in, int inl) | |||
| 1321 | if (BIO_dgram_should_retry(ret)) | 1321 | if (BIO_dgram_should_retry(ret)) |
| 1322 | { | 1322 | { |
| 1323 | BIO_set_retry_write(b); | 1323 | BIO_set_retry_write(b); |
| 1324 | data->_errno = get_last_socket_error(); | 1324 | data->_errno = errno; |
| 1325 | } | 1325 | } |
| 1326 | } | 1326 | } |
| 1327 | return(ret); | 1327 | return(ret); |
| @@ -1596,7 +1596,7 @@ int BIO_dgram_sctp_wait_for_dry(BIO *b) | |||
| 1596 | n = recvmsg(b->num, &msg, MSG_PEEK); | 1596 | n = recvmsg(b->num, &msg, MSG_PEEK); |
| 1597 | if (n <= 0) | 1597 | if (n <= 0) |
| 1598 | { | 1598 | { |
| 1599 | if ((n < 0) && (get_last_socket_error() != EAGAIN) && (get_last_socket_error() != EWOULDBLOCK)) | 1599 | if ((n < 0) && (errno != EAGAIN) && (errno != EWOULDBLOCK)) |
| 1600 | return -1; | 1600 | return -1; |
| 1601 | else | 1601 | else |
| 1602 | return 0; | 1602 | return 0; |
| @@ -1619,7 +1619,7 @@ int BIO_dgram_sctp_wait_for_dry(BIO *b) | |||
| 1619 | n = recvmsg(b->num, &msg, 0); | 1619 | n = recvmsg(b->num, &msg, 0); |
| 1620 | if (n <= 0) | 1620 | if (n <= 0) |
| 1621 | { | 1621 | { |
| 1622 | if ((n < 0) && (get_last_socket_error() != EAGAIN) && (get_last_socket_error() != EWOULDBLOCK)) | 1622 | if ((n < 0) && (errno != EAGAIN) && (errno != EWOULDBLOCK)) |
| 1623 | return -1; | 1623 | return -1; |
| 1624 | else | 1624 | else |
| 1625 | return is_dry; | 1625 | return is_dry; |
| @@ -1686,7 +1686,7 @@ int BIO_dgram_sctp_wait_for_dry(BIO *b) | |||
| 1686 | 1686 | ||
| 1687 | if (n <= 0) | 1687 | if (n <= 0) |
| 1688 | { | 1688 | { |
| 1689 | if ((n < 0) && (get_last_socket_error() != EAGAIN) && (get_last_socket_error() != EWOULDBLOCK)) | 1689 | if ((n < 0) && (errno != EAGAIN) && (errno != EWOULDBLOCK)) |
| 1690 | return -1; | 1690 | return -1; |
| 1691 | else | 1691 | else |
| 1692 | return is_dry; | 1692 | return is_dry; |
| @@ -1773,7 +1773,7 @@ static int BIO_dgram_should_retry(int i) | |||
| 1773 | 1773 | ||
| 1774 | if ((i == 0) || (i == -1)) | 1774 | if ((i == 0) || (i == -1)) |
| 1775 | { | 1775 | { |
| 1776 | err=get_last_socket_error(); | 1776 | err=errno; |
| 1777 | 1777 | ||
| 1778 | #if defined(OPENSSL_SYS_WINDOWS) | 1778 | #if defined(OPENSSL_SYS_WINDOWS) |
| 1779 | /* If the socket return value (i) is -1 | 1779 | /* If the socket return value (i) is -1 |
diff --git a/src/lib/libcrypto/bio/bss_fd.c b/src/lib/libcrypto/bio/bss_fd.c index d1bf85aae1..ab18a56310 100644 --- a/src/lib/libcrypto/bio/bss_fd.c +++ b/src/lib/libcrypto/bio/bss_fd.c | |||
| @@ -147,7 +147,7 @@ static int fd_read(BIO *b, char *out,int outl) | |||
| 147 | 147 | ||
| 148 | if (out != NULL) | 148 | if (out != NULL) |
| 149 | { | 149 | { |
| 150 | clear_sys_error(); | 150 | errno = 0; |
| 151 | ret=UP_read(b->num,out,outl); | 151 | ret=UP_read(b->num,out,outl); |
| 152 | BIO_clear_retry_flags(b); | 152 | BIO_clear_retry_flags(b); |
| 153 | if (ret <= 0) | 153 | if (ret <= 0) |
| @@ -162,7 +162,7 @@ static int fd_read(BIO *b, char *out,int outl) | |||
| 162 | static int fd_write(BIO *b, const char *in, int inl) | 162 | static int fd_write(BIO *b, const char *in, int inl) |
| 163 | { | 163 | { |
| 164 | int ret; | 164 | int ret; |
| 165 | clear_sys_error(); | 165 | errno = 0; |
| 166 | ret=UP_write(b->num,in,inl); | 166 | ret=UP_write(b->num,in,inl); |
| 167 | BIO_clear_retry_flags(b); | 167 | BIO_clear_retry_flags(b); |
| 168 | if (ret <= 0) | 168 | if (ret <= 0) |
| @@ -257,7 +257,7 @@ int BIO_fd_should_retry(int i) | |||
| 257 | 257 | ||
| 258 | if ((i == 0) || (i == -1)) | 258 | if ((i == 0) || (i == -1)) |
| 259 | { | 259 | { |
| 260 | err=get_last_sys_error(); | 260 | err=errno; |
| 261 | 261 | ||
| 262 | #if defined(OPENSSL_SYS_WINDOWS) && 0 /* more microsoft stupidity? perhaps not? Ben 4/1/99 */ | 262 | #if defined(OPENSSL_SYS_WINDOWS) && 0 /* more microsoft stupidity? perhaps not? Ben 4/1/99 */ |
| 263 | if ((i == -1) && (err == 0)) | 263 | if ((i == -1) && (err == 0)) |
diff --git a/src/lib/libcrypto/bio/bss_file.c b/src/lib/libcrypto/bio/bss_file.c index 4a4e747bc7..638572ab7f 100644 --- a/src/lib/libcrypto/bio/bss_file.c +++ b/src/lib/libcrypto/bio/bss_file.c | |||
| @@ -166,7 +166,7 @@ BIO *BIO_new_file(const char *filename, const char *mode) | |||
| 166 | #endif | 166 | #endif |
| 167 | if (file == NULL) | 167 | if (file == NULL) |
| 168 | { | 168 | { |
| 169 | SYSerr(SYS_F_FOPEN,get_last_sys_error()); | 169 | SYSerr(SYS_F_FOPEN, errno); |
| 170 | ERR_add_error_data(5,"fopen('",filename,"','",mode,"')"); | 170 | ERR_add_error_data(5,"fopen('",filename,"','",mode,"')"); |
| 171 | if (errno == ENOENT) | 171 | if (errno == ENOENT) |
| 172 | BIOerr(BIO_F_BIO_NEW_FILE,BIO_R_NO_SUCH_FILE); | 172 | BIOerr(BIO_F_BIO_NEW_FILE,BIO_R_NO_SUCH_FILE); |
| @@ -242,7 +242,7 @@ static int file_read(BIO *b, char *out, int outl) | |||
| 242 | ret=fread(out,1,(int)outl,(FILE *)b->ptr); | 242 | ret=fread(out,1,(int)outl,(FILE *)b->ptr); |
| 243 | if(ret == 0 && (b->flags&BIO_FLAGS_UPLINK)?UP_ferror((FILE *)b->ptr):ferror((FILE *)b->ptr)) | 243 | if(ret == 0 && (b->flags&BIO_FLAGS_UPLINK)?UP_ferror((FILE *)b->ptr):ferror((FILE *)b->ptr)) |
| 244 | { | 244 | { |
| 245 | SYSerr(SYS_F_FREAD,get_last_sys_error()); | 245 | SYSerr(SYS_F_FREAD, errno); |
| 246 | BIOerr(BIO_F_FILE_READ,ERR_R_SYS_LIB); | 246 | BIOerr(BIO_F_FILE_READ,ERR_R_SYS_LIB); |
| 247 | ret=-1; | 247 | ret=-1; |
| 248 | } | 248 | } |
| @@ -395,7 +395,7 @@ static long file_ctrl(BIO *b, int cmd, long num, void *ptr) | |||
| 395 | fp=fopen(ptr,p); | 395 | fp=fopen(ptr,p); |
| 396 | if (fp == NULL) | 396 | if (fp == NULL) |
| 397 | { | 397 | { |
| 398 | SYSerr(SYS_F_FOPEN,get_last_sys_error()); | 398 | SYSerr(SYS_F_FOPEN, errno); |
| 399 | ERR_add_error_data(5,"fopen('",ptr,"','",p,"')"); | 399 | ERR_add_error_data(5,"fopen('",ptr,"','",p,"')"); |
| 400 | BIOerr(BIO_F_FILE_CTRL,ERR_R_SYS_LIB); | 400 | BIOerr(BIO_F_FILE_CTRL,ERR_R_SYS_LIB); |
| 401 | ret=0; | 401 | ret=0; |
diff --git a/src/lib/libcrypto/bio/bss_sock.c b/src/lib/libcrypto/bio/bss_sock.c index 3df31938c1..07e52ec400 100644 --- a/src/lib/libcrypto/bio/bss_sock.c +++ b/src/lib/libcrypto/bio/bss_sock.c | |||
| @@ -138,8 +138,8 @@ static int sock_read(BIO *b, char *out, int outl) | |||
| 138 | 138 | ||
| 139 | if (out != NULL) | 139 | if (out != NULL) |
| 140 | { | 140 | { |
| 141 | clear_socket_error(); | 141 | errno = 0; |
| 142 | ret=readsocket(b->num,out,outl); | 142 | ret=read(b->num,out,outl); |
| 143 | BIO_clear_retry_flags(b); | 143 | BIO_clear_retry_flags(b); |
| 144 | if (ret <= 0) | 144 | if (ret <= 0) |
| 145 | { | 145 | { |
| @@ -154,8 +154,8 @@ static int sock_write(BIO *b, const char *in, int inl) | |||
| 154 | { | 154 | { |
| 155 | int ret; | 155 | int ret; |
| 156 | 156 | ||
| 157 | clear_socket_error(); | 157 | errno = 0; |
| 158 | ret=writesocket(b->num,in,inl); | 158 | ret=write(b->num,in,inl); |
| 159 | BIO_clear_retry_flags(b); | 159 | BIO_clear_retry_flags(b); |
| 160 | if (ret <= 0) | 160 | if (ret <= 0) |
| 161 | { | 161 | { |
| @@ -220,7 +220,7 @@ int BIO_sock_should_retry(int i) | |||
| 220 | 220 | ||
| 221 | if ((i == 0) || (i == -1)) | 221 | if ((i == 0) || (i == -1)) |
| 222 | { | 222 | { |
| 223 | err=get_last_socket_error(); | 223 | err=errno; |
| 224 | 224 | ||
| 225 | #if defined(OPENSSL_SYS_WINDOWS) && 0 /* more microsoft stupidity? perhaps not? Ben 4/1/99 */ | 225 | #if defined(OPENSSL_SYS_WINDOWS) && 0 /* more microsoft stupidity? perhaps not? Ben 4/1/99 */ |
| 226 | if ((i == -1) && (err == 0)) | 226 | if ((i == -1) && (err == 0)) |
diff --git a/src/lib/libcrypto/err/err.c b/src/lib/libcrypto/err/err.c index fcdb244008..0251248baf 100644 --- a/src/lib/libcrypto/err/err.c +++ b/src/lib/libcrypto/err/err.c | |||
| @@ -165,7 +165,7 @@ static ERR_STRING_DATA ERR_str_functs[]= | |||
| 165 | {ERR_PACK(0,SYS_F_CONNECT,0), "connect"}, | 165 | {ERR_PACK(0,SYS_F_CONNECT,0), "connect"}, |
| 166 | {ERR_PACK(0,SYS_F_GETSERVBYNAME,0), "getservbyname"}, | 166 | {ERR_PACK(0,SYS_F_GETSERVBYNAME,0), "getservbyname"}, |
| 167 | {ERR_PACK(0,SYS_F_SOCKET,0), "socket"}, | 167 | {ERR_PACK(0,SYS_F_SOCKET,0), "socket"}, |
| 168 | {ERR_PACK(0,SYS_F_IOCTLSOCKET,0), "ioctlsocket"}, | 168 | {ERR_PACK(0,SYS_F_IOCTLSOCKET,0), "ioctl"}, |
| 169 | {ERR_PACK(0,SYS_F_BIND,0), "bind"}, | 169 | {ERR_PACK(0,SYS_F_BIND,0), "bind"}, |
| 170 | {ERR_PACK(0,SYS_F_LISTEN,0), "listen"}, | 170 | {ERR_PACK(0,SYS_F_LISTEN,0), "listen"}, |
| 171 | {ERR_PACK(0,SYS_F_ACCEPT,0), "accept"}, | 171 | {ERR_PACK(0,SYS_F_ACCEPT,0), "accept"}, |
diff --git a/src/lib/libssl/src/apps/s_client.c b/src/lib/libssl/src/apps/s_client.c index 7559dfc113..f7885ad21d 100644 --- a/src/lib/libssl/src/apps/s_client.c +++ b/src/lib/libssl/src/apps/s_client.c | |||
| @@ -1272,8 +1272,9 @@ re_start: | |||
| 1272 | 1272 | ||
| 1273 | if (init_client(&s,host,port,socket_type,af) == 0) | 1273 | if (init_client(&s,host,port,socket_type,af) == 0) |
| 1274 | { | 1274 | { |
| 1275 | BIO_printf(bio_err,"connect:errno=%d\n",get_last_socket_error()); | 1275 | BIO_printf(bio_err,"connect:errno=%d\n",errno); |
| 1276 | SHUTDOWN(s); | 1276 | shutdown(s, SHUT_RD); |
| 1277 | close(s); | ||
| 1277 | goto end; | 1278 | goto end; |
| 1278 | } | 1279 | } |
| 1279 | BIO_printf(bio_c_out,"CONNECTED(%08X)\n",s); | 1280 | BIO_printf(bio_c_out,"CONNECTED(%08X)\n",s); |
| @@ -1299,8 +1300,9 @@ re_start: | |||
| 1299 | if (getsockname(s, &peer, (void *)&peerlen) < 0) | 1300 | if (getsockname(s, &peer, (void *)&peerlen) < 0) |
| 1300 | { | 1301 | { |
| 1301 | BIO_printf(bio_err, "getsockname:errno=%d\n", | 1302 | BIO_printf(bio_err, "getsockname:errno=%d\n", |
| 1302 | get_last_socket_error()); | 1303 | errno); |
| 1303 | SHUTDOWN(s); | 1304 | shutdown(s, SHUT_RD); |
| 1305 | close(s); | ||
| 1304 | goto end; | 1306 | goto end; |
| 1305 | } | 1307 | } |
| 1306 | 1308 | ||
| @@ -1567,7 +1569,8 @@ SSL_set_tlsext_status_ids(con, ids); | |||
| 1567 | BIO_printf(bio_c_out,"drop connection and then reconnect\n"); | 1569 | BIO_printf(bio_c_out,"drop connection and then reconnect\n"); |
| 1568 | SSL_shutdown(con); | 1570 | SSL_shutdown(con); |
| 1569 | SSL_set_connect_state(con); | 1571 | SSL_set_connect_state(con); |
| 1570 | SHUTDOWN(SSL_get_fd(con)); | 1572 | shutdown(SSL_get_fd(con), SHUT_RD); |
| 1573 | close(SSL_get_fd(con)); | ||
| 1571 | goto re_start; | 1574 | goto re_start; |
| 1572 | } | 1575 | } |
| 1573 | } | 1576 | } |
| @@ -1663,7 +1666,7 @@ SSL_set_tlsext_status_ids(con, ids); | |||
| 1663 | if ( i < 0) | 1666 | if ( i < 0) |
| 1664 | { | 1667 | { |
| 1665 | BIO_printf(bio_err,"bad select %d\n", | 1668 | BIO_printf(bio_err,"bad select %d\n", |
| 1666 | get_last_socket_error()); | 1669 | errno); |
| 1667 | goto shut; | 1670 | goto shut; |
| 1668 | /* goto end; */ | 1671 | /* goto end; */ |
| 1669 | } | 1672 | } |
| @@ -1728,7 +1731,7 @@ SSL_set_tlsext_status_ids(con, ids); | |||
| 1728 | if ((k != 0) || (cbuf_len != 0)) | 1731 | if ((k != 0) || (cbuf_len != 0)) |
| 1729 | { | 1732 | { |
| 1730 | BIO_printf(bio_err,"write:errno=%d\n", | 1733 | BIO_printf(bio_err,"write:errno=%d\n", |
| 1731 | get_last_socket_error()); | 1734 | errno); |
| 1732 | goto shut; | 1735 | goto shut; |
| 1733 | } | 1736 | } |
| 1734 | else | 1737 | else |
| @@ -1812,7 +1815,7 @@ printf("read=%d pending=%d peek=%d\n",k,SSL_pending(con),SSL_peek(con,zbuf,10240 | |||
| 1812 | BIO_printf(bio_c_out,"read X BLOCK\n"); | 1815 | BIO_printf(bio_c_out,"read X BLOCK\n"); |
| 1813 | break; | 1816 | break; |
| 1814 | case SSL_ERROR_SYSCALL: | 1817 | case SSL_ERROR_SYSCALL: |
| 1815 | ret=get_last_socket_error(); | 1818 | ret=errno; |
| 1816 | BIO_printf(bio_err,"read:errno=%d\n",ret); | 1819 | BIO_printf(bio_err,"read:errno=%d\n",ret); |
| 1817 | goto shut; | 1820 | goto shut; |
| 1818 | case SSL_ERROR_ZERO_RETURN: | 1821 | case SSL_ERROR_ZERO_RETURN: |
| @@ -1905,7 +1908,8 @@ shut: | |||
| 1905 | if (in_init) | 1908 | if (in_init) |
| 1906 | print_stuff(bio_c_out,con,full_log); | 1909 | print_stuff(bio_c_out,con,full_log); |
| 1907 | SSL_shutdown(con); | 1910 | SSL_shutdown(con); |
| 1908 | SHUTDOWN(SSL_get_fd(con)); | 1911 | shutdown(SSL_get_fd(con), SHUT_RD); |
| 1912 | close(SSL_get_fd(con)); | ||
| 1909 | end: | 1913 | end: |
| 1910 | if (con != NULL) | 1914 | if (con != NULL) |
| 1911 | { | 1915 | { |
diff --git a/src/lib/libssl/src/apps/s_server.c b/src/lib/libssl/src/apps/s_server.c index a36b1a3ad6..15070a44c1 100644 --- a/src/lib/libssl/src/apps/s_server.c +++ b/src/lib/libssl/src/apps/s_server.c | |||
| @@ -2182,7 +2182,8 @@ static int sv_body(char *hostname, int s, unsigned char *context) | |||
| 2182 | if ((i <= 0) || (buf[0] == 'Q')) | 2182 | if ((i <= 0) || (buf[0] == 'Q')) |
| 2183 | { | 2183 | { |
| 2184 | BIO_printf(bio_s_out,"DONE\n"); | 2184 | BIO_printf(bio_s_out,"DONE\n"); |
| 2185 | SHUTDOWN(s); | 2185 | shutdown(s, SHUT_RD); |
| 2186 | close(s); | ||
| 2186 | close_accept_socket(); | 2187 | close_accept_socket(); |
| 2187 | ret= -11; | 2188 | ret= -11; |
| 2188 | goto err; | 2189 | goto err; |
| @@ -2190,8 +2191,10 @@ static int sv_body(char *hostname, int s, unsigned char *context) | |||
| 2190 | if ((i <= 0) || (buf[0] == 'q')) | 2191 | if ((i <= 0) || (buf[0] == 'q')) |
| 2191 | { | 2192 | { |
| 2192 | BIO_printf(bio_s_out,"DONE\n"); | 2193 | BIO_printf(bio_s_out,"DONE\n"); |
| 2193 | if (SSL_version(con) != DTLS1_VERSION) | 2194 | if (SSL_version(con) != DTLS1_VERSION) { |
| 2194 | SHUTDOWN(s); | 2195 | shutdown(s, SHUT_RD); |
| 2196 | close(s); | ||
| 2197 | } | ||
| 2195 | /* close_accept_socket(); | 2198 | /* close_accept_socket(); |
| 2196 | ret= -11;*/ | 2199 | ret= -11;*/ |
| 2197 | goto err; | 2200 | goto err; |
| @@ -2376,7 +2379,8 @@ static void close_accept_socket(void) | |||
| 2376 | BIO_printf(bio_err,"shutdown accept socket\n"); | 2379 | BIO_printf(bio_err,"shutdown accept socket\n"); |
| 2377 | if (accept_socket >= 0) | 2380 | if (accept_socket >= 0) |
| 2378 | { | 2381 | { |
| 2379 | SHUTDOWN2(accept_socket); | 2382 | shutdown(accept_socket, SHUT_RDWR); |
| 2383 | close(accept_socket); | ||
| 2380 | } | 2384 | } |
| 2381 | } | 2385 | } |
| 2382 | 2386 | ||
diff --git a/src/lib/libssl/src/apps/s_socket.c b/src/lib/libssl/src/apps/s_socket.c index 24880a9a08..8c4421a930 100644 --- a/src/lib/libssl/src/apps/s_socket.c +++ b/src/lib/libssl/src/apps/s_socket.c | |||
| @@ -258,7 +258,7 @@ int init_client(int *sock, char *host, char *port, int type, int af) | |||
| 258 | for (ai = ai_top; ai != NULL; ai = ai->ai_next) | 258 | for (ai = ai_top; ai != NULL; ai = ai->ai_next) |
| 259 | { | 259 | { |
| 260 | s=socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol); | 260 | s=socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol); |
| 261 | if (s == INVALID_SOCKET) { continue; } | 261 | if (s == -1) { continue; } |
| 262 | #ifndef OPENSSL_SYS_MPE | 262 | #ifndef OPENSSL_SYS_MPE |
| 263 | if (type == SOCK_STREAM) | 263 | if (type == SOCK_STREAM) |
| 264 | { | 264 | { |
| @@ -299,7 +299,8 @@ int do_server(int port, int type, int *ret, int (*cb)(char *hostname, int s, uns | |||
| 299 | { | 299 | { |
| 300 | if (do_accept(accept_socket,&sock,&name) == 0) | 300 | if (do_accept(accept_socket,&sock,&name) == 0) |
| 301 | { | 301 | { |
| 302 | SHUTDOWN(accept_socket); | 302 | shutdown(accept_socket, SHUT_RD); |
| 303 | close(accept_socket); | ||
| 303 | return(0); | 304 | return(0); |
| 304 | } | 305 | } |
| 305 | } | 306 | } |
| @@ -307,11 +308,14 @@ int do_server(int port, int type, int *ret, int (*cb)(char *hostname, int s, uns | |||
| 307 | sock = accept_socket; | 308 | sock = accept_socket; |
| 308 | i=(*cb)(name,sock, context); | 309 | i=(*cb)(name,sock, context); |
| 309 | if (name != NULL) OPENSSL_free(name); | 310 | if (name != NULL) OPENSSL_free(name); |
| 310 | if (type==SOCK_STREAM) | 311 | if (type==SOCK_STREAM) { |
| 311 | SHUTDOWN2(sock); | 312 | shutdown(sock, SHUT_RDWR); |
| 313 | close(sock); | ||
| 314 | } | ||
| 312 | if (i < 0) | 315 | if (i < 0) |
| 313 | { | 316 | { |
| 314 | SHUTDOWN2(accept_socket); | 317 | shutdown(accept_socket, SHUT_RDWR); |
| 318 | close(accept_socket); | ||
| 315 | return(i); | 319 | return(i); |
| 316 | } | 320 | } |
| 317 | } | 321 | } |
| @@ -343,7 +347,7 @@ static int init_server_long(int *sock, int port, char *ip, int type) | |||
| 343 | else /* type == SOCK_DGRAM */ | 347 | else /* type == SOCK_DGRAM */ |
| 344 | s=socket(AF_INET, SOCK_DGRAM,IPPROTO_UDP); | 348 | s=socket(AF_INET, SOCK_DGRAM,IPPROTO_UDP); |
| 345 | 349 | ||
| 346 | if (s == INVALID_SOCKET) goto err; | 350 | if (s == -1) goto err; |
| 347 | #if defined SOL_SOCKET && defined SO_REUSEADDR | 351 | #if defined SOL_SOCKET && defined SO_REUSEADDR |
| 348 | { | 352 | { |
| 349 | int j = 1; | 353 | int j = 1; |
| @@ -365,7 +369,8 @@ static int init_server_long(int *sock, int port, char *ip, int type) | |||
| 365 | err: | 369 | err: |
| 366 | if ((ret == 0) && (s != -1)) | 370 | if ((ret == 0) && (s != -1)) |
| 367 | { | 371 | { |
| 368 | SHUTDOWN(s); | 372 | shutdown(s, SHUT_RD); |
| 373 | close(s); | ||
| 369 | } | 374 | } |
| 370 | return(ret); | 375 | return(ret); |
| 371 | } | 376 | } |
| @@ -397,7 +402,7 @@ redoit: | |||
| 397 | * have a cast then you can either go for (int *) or (void *). | 402 | * have a cast then you can either go for (int *) or (void *). |
| 398 | */ | 403 | */ |
| 399 | ret=accept(acc_sock,(struct sockaddr *)&from,(void *)&len); | 404 | ret=accept(acc_sock,(struct sockaddr *)&from,(void *)&len); |
| 400 | if (ret == INVALID_SOCKET) | 405 | if (ret == -1) |
| 401 | { | 406 | { |
| 402 | #if defined(OPENSSL_SYS_WINDOWS) || (defined(OPENSSL_SYS_NETWARE) && !defined(NETWARE_BSDSOCK)) | 407 | #if defined(OPENSSL_SYS_WINDOWS) || (defined(OPENSSL_SYS_NETWARE) && !defined(NETWARE_BSDSOCK)) |
| 403 | int i; | 408 | int i; |
diff --git a/src/lib/libssl/src/apps/s_time.c b/src/lib/libssl/src/apps/s_time.c index 6d78afefd2..8a5e0761f7 100644 --- a/src/lib/libssl/src/apps/s_time.c +++ b/src/lib/libssl/src/apps/s_time.c | |||
| @@ -88,9 +88,6 @@ | |||
| 88 | #undef PROG | 88 | #undef PROG |
| 89 | #define PROG s_time_main | 89 | #define PROG s_time_main |
| 90 | 90 | ||
| 91 | #undef ioctl | ||
| 92 | #define ioctl ioctlsocket | ||
| 93 | |||
| 94 | #define SSL_CONNECT_NAME "localhost:4433" | 91 | #define SSL_CONNECT_NAME "localhost:4433" |
| 95 | 92 | ||
| 96 | /*#define TEST_CERT "client.pem" */ /* no default cert. */ | 93 | /*#define TEST_CERT "client.pem" */ /* no default cert. */ |
| @@ -424,7 +421,8 @@ int MAIN(int argc, char **argv) | |||
| 424 | #else | 421 | #else |
| 425 | SSL_shutdown(scon); | 422 | SSL_shutdown(scon); |
| 426 | #endif | 423 | #endif |
| 427 | SHUTDOWN2(SSL_get_fd(scon)); | 424 | shutdown(SSL_get_fd(scon), SHUT_RDWR); |
| 425 | close(SSL_get_fd(scon)); | ||
| 428 | 426 | ||
| 429 | nConn += 1; | 427 | nConn += 1; |
| 430 | if (SSL_session_reused(scon)) | 428 | if (SSL_session_reused(scon)) |
| @@ -478,7 +476,8 @@ next: | |||
| 478 | #else | 476 | #else |
| 479 | SSL_shutdown(scon); | 477 | SSL_shutdown(scon); |
| 480 | #endif | 478 | #endif |
| 481 | SHUTDOWN2(SSL_get_fd(scon)); | 479 | shutdown(SSL_get_fd(scon), SHUT_RDWR); |
| 480 | close(SSL_get_fd(scon)); | ||
| 482 | 481 | ||
| 483 | nConn = 0; | 482 | nConn = 0; |
| 484 | totalTime = 0.0; | 483 | totalTime = 0.0; |
| @@ -517,7 +516,8 @@ next: | |||
| 517 | #else | 516 | #else |
| 518 | SSL_shutdown(scon); | 517 | SSL_shutdown(scon); |
| 519 | #endif | 518 | #endif |
| 520 | SHUTDOWN2(SSL_get_fd(scon)); | 519 | shutdown(SSL_get_fd(scon), SHUT_RDWR); |
| 520 | close(SSL_get_fd(scon)); | ||
| 521 | 521 | ||
| 522 | nConn += 1; | 522 | nConn += 1; |
| 523 | if (SSL_session_reused(scon)) | 523 | if (SSL_session_reused(scon)) |
diff --git a/src/lib/libssl/src/crypto/bio/b_sock.c b/src/lib/libssl/src/crypto/bio/b_sock.c index 41f958be71..779acbaaf5 100644 --- a/src/lib/libssl/src/crypto/bio/b_sock.c +++ b/src/lib/libssl/src/crypto/bio/b_sock.c | |||
| @@ -221,7 +221,7 @@ int BIO_get_port(const char *str, unsigned short *port_ptr) | |||
| 221 | #endif | 221 | #endif |
| 222 | else | 222 | else |
| 223 | { | 223 | { |
| 224 | SYSerr(SYS_F_GETSERVBYNAME,get_last_socket_error()); | 224 | SYSerr(SYS_F_GETSERVBYNAME,errno); |
| 225 | ERR_add_error_data(3,"service='",str,"'"); | 225 | ERR_add_error_data(3,"service='",str,"'"); |
| 226 | return(0); | 226 | return(0); |
| 227 | } | 227 | } |
| @@ -549,7 +549,7 @@ int BIO_socket_ioctl(int fd, long type, void *arg) | |||
| 549 | int i; | 549 | int i; |
| 550 | 550 | ||
| 551 | #ifdef __DJGPP__ | 551 | #ifdef __DJGPP__ |
| 552 | i=ioctlsocket(fd,type,(char *)arg); | 552 | i=ioctl(fd,type,(char *)arg); |
| 553 | #else | 553 | #else |
| 554 | # if defined(OPENSSL_SYS_VMS) | 554 | # if defined(OPENSSL_SYS_VMS) |
| 555 | /* 2011-02-18 SMS. | 555 | /* 2011-02-18 SMS. |
| @@ -574,10 +574,10 @@ int BIO_socket_ioctl(int fd, long type, void *arg) | |||
| 574 | # define ARG arg | 574 | # define ARG arg |
| 575 | # endif /* defined(OPENSSL_SYS_VMS) [else] */ | 575 | # endif /* defined(OPENSSL_SYS_VMS) [else] */ |
| 576 | 576 | ||
| 577 | i=ioctlsocket(fd,type,ARG); | 577 | i=ioctl(fd,type,ARG); |
| 578 | #endif /* __DJGPP__ */ | 578 | #endif /* __DJGPP__ */ |
| 579 | if (i < 0) | 579 | if (i < 0) |
| 580 | SYSerr(SYS_F_IOCTLSOCKET,get_last_socket_error()); | 580 | SYSerr(SYS_F_IOCTLSOCKET,errno); |
| 581 | return(i); | 581 | return(i); |
| 582 | } | 582 | } |
| 583 | #endif /* __VMS_VER */ | 583 | #endif /* __VMS_VER */ |
| @@ -629,7 +629,7 @@ int BIO_get_accept_socket(char *host, int bind_mode) | |||
| 629 | struct sockaddr_in6 sa_in6; | 629 | struct sockaddr_in6 sa_in6; |
| 630 | #endif | 630 | #endif |
| 631 | } server,client; | 631 | } server,client; |
| 632 | int s=INVALID_SOCKET,cs,addrlen; | 632 | int s=-1,cs,addrlen; |
| 633 | unsigned char ip[4]; | 633 | unsigned char ip[4]; |
| 634 | unsigned short port; | 634 | unsigned short port; |
| 635 | char *str=NULL,*e; | 635 | char *str=NULL,*e; |
| @@ -637,9 +637,9 @@ int BIO_get_accept_socket(char *host, int bind_mode) | |||
| 637 | unsigned long l; | 637 | unsigned long l; |
| 638 | int err_num; | 638 | int err_num; |
| 639 | 639 | ||
| 640 | if (BIO_sock_init() != 1) return(INVALID_SOCKET); | 640 | if (BIO_sock_init() != 1) return(-1); |
| 641 | 641 | ||
| 642 | if ((str=BUF_strdup(host)) == NULL) return(INVALID_SOCKET); | 642 | if ((str=BUF_strdup(host)) == NULL) return(-1); |
| 643 | 643 | ||
| 644 | h=p=NULL; | 644 | h=p=NULL; |
| 645 | h=str; | 645 | h=str; |
| @@ -736,9 +736,9 @@ int BIO_get_accept_socket(char *host, int bind_mode) | |||
| 736 | 736 | ||
| 737 | again: | 737 | again: |
| 738 | s=socket(server.sa.sa_family,SOCK_STREAM,SOCKET_PROTOCOL); | 738 | s=socket(server.sa.sa_family,SOCK_STREAM,SOCKET_PROTOCOL); |
| 739 | if (s == INVALID_SOCKET) | 739 | if (s == -1) |
| 740 | { | 740 | { |
| 741 | SYSerr(SYS_F_SOCKET,get_last_socket_error()); | 741 | SYSerr(SYS_F_SOCKET,errno); |
| 742 | ERR_add_error_data(3,"port='",host,"'"); | 742 | ERR_add_error_data(3,"port='",host,"'"); |
| 743 | BIOerr(BIO_F_BIO_GET_ACCEPT_SOCKET,BIO_R_UNABLE_TO_CREATE_SOCKET); | 743 | BIOerr(BIO_F_BIO_GET_ACCEPT_SOCKET,BIO_R_UNABLE_TO_CREATE_SOCKET); |
| 744 | goto err; | 744 | goto err; |
| @@ -756,7 +756,7 @@ again: | |||
| 756 | if (bind(s,&server.sa,addrlen) == -1) | 756 | if (bind(s,&server.sa,addrlen) == -1) |
| 757 | { | 757 | { |
| 758 | #ifdef SO_REUSEADDR | 758 | #ifdef SO_REUSEADDR |
| 759 | err_num=get_last_socket_error(); | 759 | err_num=errno; |
| 760 | if ((bind_mode == BIO_BIND_REUSEADDR_IF_UNUSED) && | 760 | if ((bind_mode == BIO_BIND_REUSEADDR_IF_UNUSED) && |
| 761 | #ifdef OPENSSL_SYS_WINDOWS | 761 | #ifdef OPENSSL_SYS_WINDOWS |
| 762 | /* Some versions of Windows define EADDRINUSE to | 762 | /* Some versions of Windows define EADDRINUSE to |
| @@ -785,15 +785,15 @@ again: | |||
| 785 | else goto err; | 785 | else goto err; |
| 786 | } | 786 | } |
| 787 | cs=socket(client.sa.sa_family,SOCK_STREAM,SOCKET_PROTOCOL); | 787 | cs=socket(client.sa.sa_family,SOCK_STREAM,SOCKET_PROTOCOL); |
| 788 | if (cs != INVALID_SOCKET) | 788 | if (cs != -1) |
| 789 | { | 789 | { |
| 790 | int ii; | 790 | int ii; |
| 791 | ii=connect(cs,&client.sa,addrlen); | 791 | ii=connect(cs,&client.sa,addrlen); |
| 792 | closesocket(cs); | 792 | close(cs); |
| 793 | if (ii == INVALID_SOCKET) | 793 | if (ii == -1) |
| 794 | { | 794 | { |
| 795 | bind_mode=BIO_BIND_REUSEADDR; | 795 | bind_mode=BIO_BIND_REUSEADDR; |
| 796 | closesocket(s); | 796 | close(s); |
| 797 | goto again; | 797 | goto again; |
| 798 | } | 798 | } |
| 799 | /* else error */ | 799 | /* else error */ |
| @@ -808,7 +808,7 @@ again: | |||
| 808 | } | 808 | } |
| 809 | if (listen(s,MAX_LISTEN) == -1) | 809 | if (listen(s,MAX_LISTEN) == -1) |
| 810 | { | 810 | { |
| 811 | SYSerr(SYS_F_BIND,get_last_socket_error()); | 811 | SYSerr(SYS_F_BIND,errno); |
| 812 | ERR_add_error_data(3,"port='",host,"'"); | 812 | ERR_add_error_data(3,"port='",host,"'"); |
| 813 | BIOerr(BIO_F_BIO_GET_ACCEPT_SOCKET,BIO_R_UNABLE_TO_LISTEN_SOCKET); | 813 | BIOerr(BIO_F_BIO_GET_ACCEPT_SOCKET,BIO_R_UNABLE_TO_LISTEN_SOCKET); |
| 814 | goto err; | 814 | goto err; |
| @@ -816,17 +816,17 @@ again: | |||
| 816 | ret=1; | 816 | ret=1; |
| 817 | err: | 817 | err: |
| 818 | if (str != NULL) OPENSSL_free(str); | 818 | if (str != NULL) OPENSSL_free(str); |
| 819 | if ((ret == 0) && (s != INVALID_SOCKET)) | 819 | if ((ret == 0) && (s != -1)) |
| 820 | { | 820 | { |
| 821 | closesocket(s); | 821 | close(s); |
| 822 | s= INVALID_SOCKET; | 822 | s= -1; |
| 823 | } | 823 | } |
| 824 | return(s); | 824 | return(s); |
| 825 | } | 825 | } |
| 826 | 826 | ||
| 827 | int BIO_accept(int sock, char **addr) | 827 | int BIO_accept(int sock, char **addr) |
| 828 | { | 828 | { |
| 829 | int ret=INVALID_SOCKET; | 829 | int ret=-1; |
| 830 | unsigned long l; | 830 | unsigned long l; |
| 831 | unsigned short port; | 831 | unsigned short port; |
| 832 | char *p; | 832 | char *p; |
| @@ -873,10 +873,10 @@ int BIO_accept(int sock, char **addr) | |||
| 873 | sa.len.i = (int)sa.len.s; | 873 | sa.len.i = (int)sa.len.s; |
| 874 | /* use sa.len.i from this point */ | 874 | /* use sa.len.i from this point */ |
| 875 | } | 875 | } |
| 876 | if (ret == INVALID_SOCKET) | 876 | if (ret == -1) |
| 877 | { | 877 | { |
| 878 | if(BIO_sock_should_retry(ret)) return -2; | 878 | if(BIO_sock_should_retry(ret)) return -2; |
| 879 | SYSerr(SYS_F_ACCEPT,get_last_socket_error()); | 879 | SYSerr(SYS_F_ACCEPT,errno); |
| 880 | BIOerr(BIO_F_BIO_ACCEPT,BIO_R_ACCEPT_ERROR); | 880 | BIOerr(BIO_F_BIO_ACCEPT,BIO_R_ACCEPT_ERROR); |
| 881 | goto end; | 881 | goto end; |
| 882 | } | 882 | } |
diff --git a/src/lib/libssl/src/crypto/bio/bss_acpt.c b/src/lib/libssl/src/crypto/bio/bss_acpt.c index 5d49e1a72b..5507a53a2f 100644 --- a/src/lib/libssl/src/crypto/bio/bss_acpt.c +++ b/src/lib/libssl/src/crypto/bio/bss_acpt.c | |||
| @@ -131,7 +131,7 @@ static int acpt_new(BIO *bi) | |||
| 131 | BIO_ACCEPT *ba; | 131 | BIO_ACCEPT *ba; |
| 132 | 132 | ||
| 133 | bi->init=0; | 133 | bi->init=0; |
| 134 | bi->num=INVALID_SOCKET; | 134 | bi->num=-1; |
| 135 | bi->flags=0; | 135 | bi->flags=0; |
| 136 | if ((ba=BIO_ACCEPT_new()) == NULL) | 136 | if ((ba=BIO_ACCEPT_new()) == NULL) |
| 137 | return(0); | 137 | return(0); |
| @@ -149,7 +149,7 @@ static BIO_ACCEPT *BIO_ACCEPT_new(void) | |||
| 149 | return(NULL); | 149 | return(NULL); |
| 150 | 150 | ||
| 151 | memset(ret,0,sizeof(BIO_ACCEPT)); | 151 | memset(ret,0,sizeof(BIO_ACCEPT)); |
| 152 | ret->accept_sock=INVALID_SOCKET; | 152 | ret->accept_sock=-1; |
| 153 | ret->bind_mode=BIO_BIND_NORMAL; | 153 | ret->bind_mode=BIO_BIND_NORMAL; |
| 154 | return(ret); | 154 | return(ret); |
| 155 | } | 155 | } |
| @@ -170,12 +170,12 @@ static void acpt_close_socket(BIO *bio) | |||
| 170 | BIO_ACCEPT *c; | 170 | BIO_ACCEPT *c; |
| 171 | 171 | ||
| 172 | c=(BIO_ACCEPT *)bio->ptr; | 172 | c=(BIO_ACCEPT *)bio->ptr; |
| 173 | if (c->accept_sock != INVALID_SOCKET) | 173 | if (c->accept_sock != -1) |
| 174 | { | 174 | { |
| 175 | shutdown(c->accept_sock,2); | 175 | shutdown(c->accept_sock,2); |
| 176 | closesocket(c->accept_sock); | 176 | close(c->accept_sock); |
| 177 | c->accept_sock=INVALID_SOCKET; | 177 | c->accept_sock=-1; |
| 178 | bio->num=INVALID_SOCKET; | 178 | bio->num=-1; |
| 179 | } | 179 | } |
| 180 | } | 180 | } |
| 181 | 181 | ||
| @@ -213,14 +213,14 @@ again: | |||
| 213 | return(-1); | 213 | return(-1); |
| 214 | } | 214 | } |
| 215 | s=BIO_get_accept_socket(c->param_addr,c->bind_mode); | 215 | s=BIO_get_accept_socket(c->param_addr,c->bind_mode); |
| 216 | if (s == INVALID_SOCKET) | 216 | if (s == -1) |
| 217 | return(-1); | 217 | return(-1); |
| 218 | 218 | ||
| 219 | if (c->accept_nbio) | 219 | if (c->accept_nbio) |
| 220 | { | 220 | { |
| 221 | if (!BIO_socket_nbio(s,1)) | 221 | if (!BIO_socket_nbio(s,1)) |
| 222 | { | 222 | { |
| 223 | closesocket(s); | 223 | close(s); |
| 224 | BIOerr(BIO_F_ACPT_STATE,BIO_R_ERROR_SETTING_NBIO_ON_ACCEPT_SOCKET); | 224 | BIOerr(BIO_F_ACPT_STATE,BIO_R_ERROR_SETTING_NBIO_ON_ACCEPT_SOCKET); |
| 225 | return(-1); | 225 | return(-1); |
| 226 | } | 226 | } |
| @@ -282,7 +282,7 @@ err: | |||
| 282 | if (bio != NULL) | 282 | if (bio != NULL) |
| 283 | BIO_free(bio); | 283 | BIO_free(bio); |
| 284 | else if (s >= 0) | 284 | else if (s >= 0) |
| 285 | closesocket(s); | 285 | close(s); |
| 286 | return(0); | 286 | return(0); |
| 287 | /* break; */ | 287 | /* break; */ |
| 288 | case ACPT_S_OK: | 288 | case ACPT_S_OK: |
diff --git a/src/lib/libssl/src/crypto/bio/bss_conn.c b/src/lib/libssl/src/crypto/bio/bss_conn.c index c14727855b..bdf540030c 100644 --- a/src/lib/libssl/src/crypto/bio/bss_conn.c +++ b/src/lib/libssl/src/crypto/bio/bss_conn.c | |||
| @@ -210,9 +210,9 @@ static int conn_state(BIO *b, BIO_CONNECT *c) | |||
| 210 | c->state=BIO_CONN_S_CREATE_SOCKET; | 210 | c->state=BIO_CONN_S_CREATE_SOCKET; |
| 211 | 211 | ||
| 212 | ret=socket(AF_INET,SOCK_STREAM,SOCKET_PROTOCOL); | 212 | ret=socket(AF_INET,SOCK_STREAM,SOCKET_PROTOCOL); |
| 213 | if (ret == INVALID_SOCKET) | 213 | if (ret == -1) |
| 214 | { | 214 | { |
| 215 | SYSerr(SYS_F_SOCKET,get_last_socket_error()); | 215 | SYSerr(SYS_F_SOCKET,errno); |
| 216 | ERR_add_error_data(4,"host=",c->param_hostname, | 216 | ERR_add_error_data(4,"host=",c->param_hostname, |
| 217 | ":",c->param_port); | 217 | ":",c->param_port); |
| 218 | BIOerr(BIO_F_CONN_STATE,BIO_R_UNABLE_TO_CREATE_SOCKET); | 218 | BIOerr(BIO_F_CONN_STATE,BIO_R_UNABLE_TO_CREATE_SOCKET); |
| @@ -241,7 +241,7 @@ static int conn_state(BIO *b, BIO_CONNECT *c) | |||
| 241 | i=setsockopt(b->num,SOL_SOCKET,SO_KEEPALIVE,(char *)&i,sizeof(i)); | 241 | i=setsockopt(b->num,SOL_SOCKET,SO_KEEPALIVE,(char *)&i,sizeof(i)); |
| 242 | if (i < 0) | 242 | if (i < 0) |
| 243 | { | 243 | { |
| 244 | SYSerr(SYS_F_SOCKET,get_last_socket_error()); | 244 | SYSerr(SYS_F_SOCKET,errno); |
| 245 | ERR_add_error_data(4,"host=",c->param_hostname, | 245 | ERR_add_error_data(4,"host=",c->param_hostname, |
| 246 | ":",c->param_port); | 246 | ":",c->param_port); |
| 247 | BIOerr(BIO_F_CONN_STATE,BIO_R_KEEPALIVE); | 247 | BIOerr(BIO_F_CONN_STATE,BIO_R_KEEPALIVE); |
| @@ -266,7 +266,7 @@ static int conn_state(BIO *b, BIO_CONNECT *c) | |||
| 266 | } | 266 | } |
| 267 | else | 267 | else |
| 268 | { | 268 | { |
| 269 | SYSerr(SYS_F_CONNECT,get_last_socket_error()); | 269 | SYSerr(SYS_F_CONNECT,errno); |
| 270 | ERR_add_error_data(4,"host=", | 270 | ERR_add_error_data(4,"host=", |
| 271 | c->param_hostname, | 271 | c->param_hostname, |
| 272 | ":",c->param_port); | 272 | ":",c->param_port); |
| @@ -358,7 +358,7 @@ BIO_METHOD *BIO_s_connect(void) | |||
| 358 | static int conn_new(BIO *bi) | 358 | static int conn_new(BIO *bi) |
| 359 | { | 359 | { |
| 360 | bi->init=0; | 360 | bi->init=0; |
| 361 | bi->num=INVALID_SOCKET; | 361 | bi->num=-1; |
| 362 | bi->flags=0; | 362 | bi->flags=0; |
| 363 | if ((bi->ptr=(char *)BIO_CONNECT_new()) == NULL) | 363 | if ((bi->ptr=(char *)BIO_CONNECT_new()) == NULL) |
| 364 | return(0); | 364 | return(0); |
| @@ -371,13 +371,13 @@ static void conn_close_socket(BIO *bio) | |||
| 371 | BIO_CONNECT *c; | 371 | BIO_CONNECT *c; |
| 372 | 372 | ||
| 373 | c=(BIO_CONNECT *)bio->ptr; | 373 | c=(BIO_CONNECT *)bio->ptr; |
| 374 | if (bio->num != INVALID_SOCKET) | 374 | if (bio->num != -1) |
| 375 | { | 375 | { |
| 376 | /* Only do a shutdown if things were established */ | 376 | /* Only do a shutdown if things were established */ |
| 377 | if (c->state == BIO_CONN_S_OK) | 377 | if (c->state == BIO_CONN_S_OK) |
| 378 | shutdown(bio->num,2); | 378 | shutdown(bio->num,2); |
| 379 | closesocket(bio->num); | 379 | close(bio->num); |
| 380 | bio->num=INVALID_SOCKET; | 380 | bio->num=-1; |
| 381 | } | 381 | } |
| 382 | } | 382 | } |
| 383 | 383 | ||
| @@ -414,8 +414,8 @@ static int conn_read(BIO *b, char *out, int outl) | |||
| 414 | 414 | ||
| 415 | if (out != NULL) | 415 | if (out != NULL) |
| 416 | { | 416 | { |
| 417 | clear_socket_error(); | 417 | errno = 0; |
| 418 | ret=readsocket(b->num,out,outl); | 418 | ret=read(b->num,out,outl); |
| 419 | BIO_clear_retry_flags(b); | 419 | BIO_clear_retry_flags(b); |
| 420 | if (ret <= 0) | 420 | if (ret <= 0) |
| 421 | { | 421 | { |
| @@ -438,8 +438,8 @@ static int conn_write(BIO *b, const char *in, int inl) | |||
| 438 | if (ret <= 0) return(ret); | 438 | if (ret <= 0) return(ret); |
| 439 | } | 439 | } |
| 440 | 440 | ||
| 441 | clear_socket_error(); | 441 | errno = 0; |
| 442 | ret=writesocket(b->num,in,inl); | 442 | ret=write(b->num,in,inl); |
| 443 | BIO_clear_retry_flags(b); | 443 | BIO_clear_retry_flags(b); |
| 444 | if (ret <= 0) | 444 | if (ret <= 0) |
| 445 | { | 445 | { |
diff --git a/src/lib/libssl/src/crypto/bio/bss_dgram.c b/src/lib/libssl/src/crypto/bio/bss_dgram.c index f39f94f7fe..d09c0fc33e 100644 --- a/src/lib/libssl/src/crypto/bio/bss_dgram.c +++ b/src/lib/libssl/src/crypto/bio/bss_dgram.c | |||
| @@ -383,7 +383,7 @@ static int dgram_read(BIO *b, char *out, int outl) | |||
| 383 | 383 | ||
| 384 | if (out != NULL) | 384 | if (out != NULL) |
| 385 | { | 385 | { |
| 386 | clear_socket_error(); | 386 | errno = 0; |
| 387 | memset(&sa.peer, 0x00, sizeof(sa.peer)); | 387 | memset(&sa.peer, 0x00, sizeof(sa.peer)); |
| 388 | dgram_adjust_rcv_timeout(b); | 388 | dgram_adjust_rcv_timeout(b); |
| 389 | ret=recvfrom(b->num,out,outl,0,&sa.peer.sa,(void *)&sa.len); | 389 | ret=recvfrom(b->num,out,outl,0,&sa.peer.sa,(void *)&sa.len); |
| @@ -402,7 +402,7 @@ static int dgram_read(BIO *b, char *out, int outl) | |||
| 402 | if (BIO_dgram_should_retry(ret)) | 402 | if (BIO_dgram_should_retry(ret)) |
| 403 | { | 403 | { |
| 404 | BIO_set_retry_read(b); | 404 | BIO_set_retry_read(b); |
| 405 | data->_errno = get_last_socket_error(); | 405 | data->_errno = errno; |
| 406 | } | 406 | } |
| 407 | } | 407 | } |
| 408 | 408 | ||
| @@ -415,10 +415,10 @@ static int dgram_write(BIO *b, const char *in, int inl) | |||
| 415 | { | 415 | { |
| 416 | int ret; | 416 | int ret; |
| 417 | bio_dgram_data *data = (bio_dgram_data *)b->ptr; | 417 | bio_dgram_data *data = (bio_dgram_data *)b->ptr; |
| 418 | clear_socket_error(); | 418 | errno = 0; |
| 419 | 419 | ||
| 420 | if ( data->connected ) | 420 | if ( data->connected ) |
| 421 | ret=writesocket(b->num,in,inl); | 421 | ret=write(b->num,in,inl); |
| 422 | else | 422 | else |
| 423 | { | 423 | { |
| 424 | int peerlen = sizeof(data->peer); | 424 | int peerlen = sizeof(data->peer); |
| @@ -442,7 +442,7 @@ static int dgram_write(BIO *b, const char *in, int inl) | |||
| 442 | if (BIO_dgram_should_retry(ret)) | 442 | if (BIO_dgram_should_retry(ret)) |
| 443 | { | 443 | { |
| 444 | BIO_set_retry_write(b); | 444 | BIO_set_retry_write(b); |
| 445 | data->_errno = get_last_socket_error(); | 445 | data->_errno = errno; |
| 446 | 446 | ||
| 447 | #if 0 /* higher layers are responsible for querying MTU, if necessary */ | 447 | #if 0 /* higher layers are responsible for querying MTU, if necessary */ |
| 448 | if ( data->_errno == EMSGSIZE) | 448 | if ( data->_errno == EMSGSIZE) |
| @@ -1018,7 +1018,7 @@ static int dgram_sctp_read(BIO *b, char *out, int outl) | |||
| 1018 | 1018 | ||
| 1019 | if (out != NULL) | 1019 | if (out != NULL) |
| 1020 | { | 1020 | { |
| 1021 | clear_socket_error(); | 1021 | errno = 0; |
| 1022 | 1022 | ||
| 1023 | do | 1023 | do |
| 1024 | { | 1024 | { |
| @@ -1180,7 +1180,7 @@ static int dgram_sctp_read(BIO *b, char *out, int outl) | |||
| 1180 | if (BIO_dgram_should_retry(ret)) | 1180 | if (BIO_dgram_should_retry(ret)) |
| 1181 | { | 1181 | { |
| 1182 | BIO_set_retry_read(b); | 1182 | BIO_set_retry_read(b); |
| 1183 | data->_errno = get_last_socket_error(); | 1183 | data->_errno = errno; |
| 1184 | } | 1184 | } |
| 1185 | } | 1185 | } |
| 1186 | 1186 | ||
| @@ -1238,7 +1238,7 @@ static int dgram_sctp_write(BIO *b, const char *in, int inl) | |||
| 1238 | struct sctp_sndrcvinfo *sndrcvinfo; | 1238 | struct sctp_sndrcvinfo *sndrcvinfo; |
| 1239 | #endif | 1239 | #endif |
| 1240 | 1240 | ||
| 1241 | clear_socket_error(); | 1241 | errno = 0; |
| 1242 | 1242 | ||
| 1243 | /* If we're send anything else than application data, | 1243 | /* If we're send anything else than application data, |
| 1244 | * disable all user parameters and flags. | 1244 | * disable all user parameters and flags. |
| @@ -1321,7 +1321,7 @@ static int dgram_sctp_write(BIO *b, const char *in, int inl) | |||
| 1321 | if (BIO_dgram_should_retry(ret)) | 1321 | if (BIO_dgram_should_retry(ret)) |
| 1322 | { | 1322 | { |
| 1323 | BIO_set_retry_write(b); | 1323 | BIO_set_retry_write(b); |
| 1324 | data->_errno = get_last_socket_error(); | 1324 | data->_errno = errno; |
| 1325 | } | 1325 | } |
| 1326 | } | 1326 | } |
| 1327 | return(ret); | 1327 | return(ret); |
| @@ -1596,7 +1596,7 @@ int BIO_dgram_sctp_wait_for_dry(BIO *b) | |||
| 1596 | n = recvmsg(b->num, &msg, MSG_PEEK); | 1596 | n = recvmsg(b->num, &msg, MSG_PEEK); |
| 1597 | if (n <= 0) | 1597 | if (n <= 0) |
| 1598 | { | 1598 | { |
| 1599 | if ((n < 0) && (get_last_socket_error() != EAGAIN) && (get_last_socket_error() != EWOULDBLOCK)) | 1599 | if ((n < 0) && (errno != EAGAIN) && (errno != EWOULDBLOCK)) |
| 1600 | return -1; | 1600 | return -1; |
| 1601 | else | 1601 | else |
| 1602 | return 0; | 1602 | return 0; |
| @@ -1619,7 +1619,7 @@ int BIO_dgram_sctp_wait_for_dry(BIO *b) | |||
| 1619 | n = recvmsg(b->num, &msg, 0); | 1619 | n = recvmsg(b->num, &msg, 0); |
| 1620 | if (n <= 0) | 1620 | if (n <= 0) |
| 1621 | { | 1621 | { |
| 1622 | if ((n < 0) && (get_last_socket_error() != EAGAIN) && (get_last_socket_error() != EWOULDBLOCK)) | 1622 | if ((n < 0) && (errno != EAGAIN) && (errno != EWOULDBLOCK)) |
| 1623 | return -1; | 1623 | return -1; |
| 1624 | else | 1624 | else |
| 1625 | return is_dry; | 1625 | return is_dry; |
| @@ -1686,7 +1686,7 @@ int BIO_dgram_sctp_wait_for_dry(BIO *b) | |||
| 1686 | 1686 | ||
| 1687 | if (n <= 0) | 1687 | if (n <= 0) |
| 1688 | { | 1688 | { |
| 1689 | if ((n < 0) && (get_last_socket_error() != EAGAIN) && (get_last_socket_error() != EWOULDBLOCK)) | 1689 | if ((n < 0) && (errno != EAGAIN) && (errno != EWOULDBLOCK)) |
| 1690 | return -1; | 1690 | return -1; |
| 1691 | else | 1691 | else |
| 1692 | return is_dry; | 1692 | return is_dry; |
| @@ -1773,7 +1773,7 @@ static int BIO_dgram_should_retry(int i) | |||
| 1773 | 1773 | ||
| 1774 | if ((i == 0) || (i == -1)) | 1774 | if ((i == 0) || (i == -1)) |
| 1775 | { | 1775 | { |
| 1776 | err=get_last_socket_error(); | 1776 | err=errno; |
| 1777 | 1777 | ||
| 1778 | #if defined(OPENSSL_SYS_WINDOWS) | 1778 | #if defined(OPENSSL_SYS_WINDOWS) |
| 1779 | /* If the socket return value (i) is -1 | 1779 | /* If the socket return value (i) is -1 |
diff --git a/src/lib/libssl/src/crypto/bio/bss_fd.c b/src/lib/libssl/src/crypto/bio/bss_fd.c index d1bf85aae1..ab18a56310 100644 --- a/src/lib/libssl/src/crypto/bio/bss_fd.c +++ b/src/lib/libssl/src/crypto/bio/bss_fd.c | |||
| @@ -147,7 +147,7 @@ static int fd_read(BIO *b, char *out,int outl) | |||
| 147 | 147 | ||
| 148 | if (out != NULL) | 148 | if (out != NULL) |
| 149 | { | 149 | { |
| 150 | clear_sys_error(); | 150 | errno = 0; |
| 151 | ret=UP_read(b->num,out,outl); | 151 | ret=UP_read(b->num,out,outl); |
| 152 | BIO_clear_retry_flags(b); | 152 | BIO_clear_retry_flags(b); |
| 153 | if (ret <= 0) | 153 | if (ret <= 0) |
| @@ -162,7 +162,7 @@ static int fd_read(BIO *b, char *out,int outl) | |||
| 162 | static int fd_write(BIO *b, const char *in, int inl) | 162 | static int fd_write(BIO *b, const char *in, int inl) |
| 163 | { | 163 | { |
| 164 | int ret; | 164 | int ret; |
| 165 | clear_sys_error(); | 165 | errno = 0; |
| 166 | ret=UP_write(b->num,in,inl); | 166 | ret=UP_write(b->num,in,inl); |
| 167 | BIO_clear_retry_flags(b); | 167 | BIO_clear_retry_flags(b); |
| 168 | if (ret <= 0) | 168 | if (ret <= 0) |
| @@ -257,7 +257,7 @@ int BIO_fd_should_retry(int i) | |||
| 257 | 257 | ||
| 258 | if ((i == 0) || (i == -1)) | 258 | if ((i == 0) || (i == -1)) |
| 259 | { | 259 | { |
| 260 | err=get_last_sys_error(); | 260 | err=errno; |
| 261 | 261 | ||
| 262 | #if defined(OPENSSL_SYS_WINDOWS) && 0 /* more microsoft stupidity? perhaps not? Ben 4/1/99 */ | 262 | #if defined(OPENSSL_SYS_WINDOWS) && 0 /* more microsoft stupidity? perhaps not? Ben 4/1/99 */ |
| 263 | if ((i == -1) && (err == 0)) | 263 | if ((i == -1) && (err == 0)) |
diff --git a/src/lib/libssl/src/crypto/bio/bss_file.c b/src/lib/libssl/src/crypto/bio/bss_file.c index 4a4e747bc7..638572ab7f 100644 --- a/src/lib/libssl/src/crypto/bio/bss_file.c +++ b/src/lib/libssl/src/crypto/bio/bss_file.c | |||
| @@ -166,7 +166,7 @@ BIO *BIO_new_file(const char *filename, const char *mode) | |||
| 166 | #endif | 166 | #endif |
| 167 | if (file == NULL) | 167 | if (file == NULL) |
| 168 | { | 168 | { |
| 169 | SYSerr(SYS_F_FOPEN,get_last_sys_error()); | 169 | SYSerr(SYS_F_FOPEN, errno); |
| 170 | ERR_add_error_data(5,"fopen('",filename,"','",mode,"')"); | 170 | ERR_add_error_data(5,"fopen('",filename,"','",mode,"')"); |
| 171 | if (errno == ENOENT) | 171 | if (errno == ENOENT) |
| 172 | BIOerr(BIO_F_BIO_NEW_FILE,BIO_R_NO_SUCH_FILE); | 172 | BIOerr(BIO_F_BIO_NEW_FILE,BIO_R_NO_SUCH_FILE); |
| @@ -242,7 +242,7 @@ static int file_read(BIO *b, char *out, int outl) | |||
| 242 | ret=fread(out,1,(int)outl,(FILE *)b->ptr); | 242 | ret=fread(out,1,(int)outl,(FILE *)b->ptr); |
| 243 | if(ret == 0 && (b->flags&BIO_FLAGS_UPLINK)?UP_ferror((FILE *)b->ptr):ferror((FILE *)b->ptr)) | 243 | if(ret == 0 && (b->flags&BIO_FLAGS_UPLINK)?UP_ferror((FILE *)b->ptr):ferror((FILE *)b->ptr)) |
| 244 | { | 244 | { |
| 245 | SYSerr(SYS_F_FREAD,get_last_sys_error()); | 245 | SYSerr(SYS_F_FREAD, errno); |
| 246 | BIOerr(BIO_F_FILE_READ,ERR_R_SYS_LIB); | 246 | BIOerr(BIO_F_FILE_READ,ERR_R_SYS_LIB); |
| 247 | ret=-1; | 247 | ret=-1; |
| 248 | } | 248 | } |
| @@ -395,7 +395,7 @@ static long file_ctrl(BIO *b, int cmd, long num, void *ptr) | |||
| 395 | fp=fopen(ptr,p); | 395 | fp=fopen(ptr,p); |
| 396 | if (fp == NULL) | 396 | if (fp == NULL) |
| 397 | { | 397 | { |
| 398 | SYSerr(SYS_F_FOPEN,get_last_sys_error()); | 398 | SYSerr(SYS_F_FOPEN, errno); |
| 399 | ERR_add_error_data(5,"fopen('",ptr,"','",p,"')"); | 399 | ERR_add_error_data(5,"fopen('",ptr,"','",p,"')"); |
| 400 | BIOerr(BIO_F_FILE_CTRL,ERR_R_SYS_LIB); | 400 | BIOerr(BIO_F_FILE_CTRL,ERR_R_SYS_LIB); |
| 401 | ret=0; | 401 | ret=0; |
diff --git a/src/lib/libssl/src/crypto/bio/bss_sock.c b/src/lib/libssl/src/crypto/bio/bss_sock.c index 3df31938c1..07e52ec400 100644 --- a/src/lib/libssl/src/crypto/bio/bss_sock.c +++ b/src/lib/libssl/src/crypto/bio/bss_sock.c | |||
| @@ -138,8 +138,8 @@ static int sock_read(BIO *b, char *out, int outl) | |||
| 138 | 138 | ||
| 139 | if (out != NULL) | 139 | if (out != NULL) |
| 140 | { | 140 | { |
| 141 | clear_socket_error(); | 141 | errno = 0; |
| 142 | ret=readsocket(b->num,out,outl); | 142 | ret=read(b->num,out,outl); |
| 143 | BIO_clear_retry_flags(b); | 143 | BIO_clear_retry_flags(b); |
| 144 | if (ret <= 0) | 144 | if (ret <= 0) |
| 145 | { | 145 | { |
| @@ -154,8 +154,8 @@ static int sock_write(BIO *b, const char *in, int inl) | |||
| 154 | { | 154 | { |
| 155 | int ret; | 155 | int ret; |
| 156 | 156 | ||
| 157 | clear_socket_error(); | 157 | errno = 0; |
| 158 | ret=writesocket(b->num,in,inl); | 158 | ret=write(b->num,in,inl); |
| 159 | BIO_clear_retry_flags(b); | 159 | BIO_clear_retry_flags(b); |
| 160 | if (ret <= 0) | 160 | if (ret <= 0) |
| 161 | { | 161 | { |
| @@ -220,7 +220,7 @@ int BIO_sock_should_retry(int i) | |||
| 220 | 220 | ||
| 221 | if ((i == 0) || (i == -1)) | 221 | if ((i == 0) || (i == -1)) |
| 222 | { | 222 | { |
| 223 | err=get_last_socket_error(); | 223 | err=errno; |
| 224 | 224 | ||
| 225 | #if defined(OPENSSL_SYS_WINDOWS) && 0 /* more microsoft stupidity? perhaps not? Ben 4/1/99 */ | 225 | #if defined(OPENSSL_SYS_WINDOWS) && 0 /* more microsoft stupidity? perhaps not? Ben 4/1/99 */ |
| 226 | if ((i == -1) && (err == 0)) | 226 | if ((i == -1) && (err == 0)) |
diff --git a/src/lib/libssl/src/crypto/err/err.c b/src/lib/libssl/src/crypto/err/err.c index fcdb244008..0251248baf 100644 --- a/src/lib/libssl/src/crypto/err/err.c +++ b/src/lib/libssl/src/crypto/err/err.c | |||
| @@ -165,7 +165,7 @@ static ERR_STRING_DATA ERR_str_functs[]= | |||
| 165 | {ERR_PACK(0,SYS_F_CONNECT,0), "connect"}, | 165 | {ERR_PACK(0,SYS_F_CONNECT,0), "connect"}, |
| 166 | {ERR_PACK(0,SYS_F_GETSERVBYNAME,0), "getservbyname"}, | 166 | {ERR_PACK(0,SYS_F_GETSERVBYNAME,0), "getservbyname"}, |
| 167 | {ERR_PACK(0,SYS_F_SOCKET,0), "socket"}, | 167 | {ERR_PACK(0,SYS_F_SOCKET,0), "socket"}, |
| 168 | {ERR_PACK(0,SYS_F_IOCTLSOCKET,0), "ioctlsocket"}, | 168 | {ERR_PACK(0,SYS_F_IOCTLSOCKET,0), "ioctl"}, |
| 169 | {ERR_PACK(0,SYS_F_BIND,0), "bind"}, | 169 | {ERR_PACK(0,SYS_F_BIND,0), "bind"}, |
| 170 | {ERR_PACK(0,SYS_F_LISTEN,0), "listen"}, | 170 | {ERR_PACK(0,SYS_F_LISTEN,0), "listen"}, |
| 171 | {ERR_PACK(0,SYS_F_ACCEPT,0), "accept"}, | 171 | {ERR_PACK(0,SYS_F_ACCEPT,0), "accept"}, |
diff --git a/src/lib/libssl/src/e_os.h b/src/lib/libssl/src/e_os.h index 8c87b7aa96..047aa2a94d 100644 --- a/src/lib/libssl/src/e_os.h +++ b/src/lib/libssl/src/e_os.h | |||
| @@ -88,15 +88,6 @@ extern "C" { | |||
| 88 | #define DEVRANDOM_EGD "/var/run/egd-pool","/dev/egd-pool","/etc/egd-pool","/etc/entropy" | 88 | #define DEVRANDOM_EGD "/var/run/egd-pool","/dev/egd-pool","/etc/egd-pool","/etc/entropy" |
| 89 | #endif | 89 | #endif |
| 90 | 90 | ||
| 91 | #define get_last_sys_error() errno | ||
| 92 | #define clear_sys_error() errno=0 | ||
| 93 | #define get_last_socket_error() errno | ||
| 94 | #define clear_socket_error() errno=0 | ||
| 95 | #define ioctlsocket(a,b,c) ioctl(a,b,c) | ||
| 96 | #define closesocket(s) close(s) | ||
| 97 | #define readsocket(s,b,n) read((s),(b),(n)) | ||
| 98 | #define writesocket(s,b,n) write((s),(b),(n)) | ||
| 99 | |||
| 100 | # include <unistd.h> | 91 | # include <unistd.h> |
| 101 | # include <sys/types.h> | 92 | # include <sys/types.h> |
| 102 | # define OPENSSL_CONF "openssl.cnf" | 93 | # define OPENSSL_CONF "openssl.cnf" |
| @@ -104,26 +95,15 @@ extern "C" { | |||
| 104 | # define RFILE ".rnd" | 95 | # define RFILE ".rnd" |
| 105 | # define LIST_SEPARATOR_CHAR ':' | 96 | # define LIST_SEPARATOR_CHAR ':' |
| 106 | # define EXIT(n) exit(n) | 97 | # define EXIT(n) exit(n) |
| 107 | # define SSLeay_getpid() getpid() | ||
| 108 | 98 | ||
| 109 | 99 | ||
| 110 | #ifdef USE_SOCKETS | 100 | #ifdef USE_SOCKETS |
| 111 | # include <sys/param.h> | 101 | # include <sys/param.h> |
| 112 | # include <sys/time.h> /* Needed under linux for FD_XXX */ | 102 | # include <sys/time.h> /* Needed under linux for FD_XXX */ |
| 113 | # include <netdb.h> | 103 | # include <netdb.h> |
| 114 | # include <sys/socket.h> | 104 | # include <sys/socket.h> |
| 115 | # ifdef FILIO_H | 105 | # include <netinet/in.h> |
| 116 | # include <sys/filio.h> /* Added for FIONBIO under unixware */ | 106 | # include <sys/ioctl.h> |
| 117 | # endif | ||
| 118 | # include <netinet/in.h> | ||
| 119 | # include <sys/ioctl.h> | ||
| 120 | # define SSLeay_Read(a,b,c) read((a),(b),(c)) | ||
| 121 | # define SSLeay_Write(a,b,c) write((a),(b),(c)) | ||
| 122 | # define SHUTDOWN(fd) { shutdown((fd),0); closesocket((fd)); } | ||
| 123 | # define SHUTDOWN2(fd) { shutdown((fd),2); closesocket((fd)); } | ||
| 124 | # ifndef INVALID_SOCKET | ||
| 125 | # define INVALID_SOCKET (-1) | ||
| 126 | # endif /* INVALID_SOCKET */ | ||
| 127 | #endif | 107 | #endif |
| 128 | 108 | ||
| 129 | /* Some IPv6 implementations are broken, disable them in known bad | 109 | /* Some IPv6 implementations are broken, disable them in known bad |
