diff options
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libcrypto/bio/b_sock.c | 43 | ||||
| -rw-r--r-- | src/lib/libssl/src/crypto/bio/b_sock.c | 43 |
2 files changed, 6 insertions, 80 deletions
diff --git a/src/lib/libcrypto/bio/b_sock.c b/src/lib/libcrypto/bio/b_sock.c index c7a10ca348..a2845e325e 100644 --- a/src/lib/libcrypto/bio/b_sock.c +++ b/src/lib/libcrypto/bio/b_sock.c | |||
| @@ -68,7 +68,6 @@ | |||
| 68 | #include <unistd.h> | 68 | #include <unistd.h> |
| 69 | 69 | ||
| 70 | #include <openssl/bio.h> | 70 | #include <openssl/bio.h> |
| 71 | #include <openssl/dso.h> | ||
| 72 | 71 | ||
| 73 | #include "cryptlib.h" | 72 | #include "cryptlib.h" |
| 74 | 73 | ||
| @@ -306,26 +305,8 @@ BIO_get_accept_socket(char *host, int bind_mode) | |||
| 306 | 305 | ||
| 307 | #ifdef EAI_FAMILY | 306 | #ifdef EAI_FAMILY |
| 308 | do { | 307 | do { |
| 309 | static union { | ||
| 310 | void *p; | ||
| 311 | int (*f)(const char *, const char *, | ||
| 312 | const struct addrinfo *, | ||
| 313 | struct addrinfo **); | ||
| 314 | } p_getaddrinfo = {NULL}; | ||
| 315 | static union { | ||
| 316 | void *p; | ||
| 317 | void (*f)(struct addrinfo *); | ||
| 318 | } p_freeaddrinfo = {NULL}; | ||
| 319 | struct addrinfo *res, hint; | 308 | struct addrinfo *res, hint; |
| 320 | 309 | ||
| 321 | if (p_getaddrinfo.p == NULL) { | ||
| 322 | if ((p_getaddrinfo.p = DSO_global_lookup("getaddrinfo"))==NULL || | ||
| 323 | (p_freeaddrinfo.p = DSO_global_lookup("freeaddrinfo"))==NULL) | ||
| 324 | p_getaddrinfo.p = (void*) - 1; | ||
| 325 | } | ||
| 326 | if (p_getaddrinfo.p == (void *) - 1) | ||
| 327 | break; | ||
| 328 | |||
| 329 | /* '::port' enforces IPv6 wildcard listener. Some OSes, | 310 | /* '::port' enforces IPv6 wildcard listener. Some OSes, |
| 330 | * e.g. Solaris, default to IPv6 without any hint. Also | 311 | * e.g. Solaris, default to IPv6 without any hint. Also |
| 331 | * note that commonly IPv6 wildchard socket can service | 312 | * note that commonly IPv6 wildchard socket can service |
| @@ -343,14 +324,14 @@ BIO_get_accept_socket(char *host, int bind_mode) | |||
| 343 | } | 324 | } |
| 344 | } | 325 | } |
| 345 | 326 | ||
| 346 | if ((*p_getaddrinfo.f)(h, p, &hint, &res)) | 327 | if (getaddrinfo(h, p, &hint, &res)) |
| 347 | break; | 328 | break; |
| 348 | 329 | ||
| 349 | addrlen = res->ai_addrlen <= sizeof(server) ? | 330 | addrlen = res->ai_addrlen <= sizeof(server) ? |
| 350 | res->ai_addrlen : sizeof(server); | 331 | res->ai_addrlen : sizeof(server); |
| 351 | memcpy(&server, res->ai_addr, addrlen); | 332 | memcpy(&server, res->ai_addr, addrlen); |
| 352 | 333 | ||
| 353 | (*p_freeaddrinfo.f)(res); | 334 | freeaddrinfo(res); |
| 354 | goto again; | 335 | goto again; |
| 355 | } while (0); | 336 | } while (0); |
| 356 | #endif | 337 | #endif |
| @@ -478,26 +459,8 @@ BIO_accept(int sock, char **addr) | |||
| 478 | do { | 459 | do { |
| 479 | char h[NI_MAXHOST], s[NI_MAXSERV]; | 460 | char h[NI_MAXHOST], s[NI_MAXSERV]; |
| 480 | size_t nl; | 461 | size_t nl; |
| 481 | static union { | ||
| 482 | void *p; | ||
| 483 | int (*f)(const struct sockaddr *, | ||
| 484 | socklen_t, char *, size_t, | ||
| 485 | char *, size_t, int); | ||
| 486 | } p_getnameinfo = {NULL}; | ||
| 487 | /* 2nd argument to getnameinfo is specified to | ||
| 488 | * be socklen_t. Unfortunately there is a number | ||
| 489 | * of environments where socklen_t is not defined. | ||
| 490 | * As it's passed by value, it's safe to pass it | ||
| 491 | * as size_t... <appro> */ | ||
| 492 | |||
| 493 | if (p_getnameinfo.p == NULL) { | ||
| 494 | if ((p_getnameinfo.p = DSO_global_lookup("getnameinfo")) == NULL) | ||
| 495 | p_getnameinfo.p = (void*) - 1; | ||
| 496 | } | ||
| 497 | if (p_getnameinfo.p == (void *) - 1) | ||
| 498 | break; | ||
| 499 | 462 | ||
| 500 | if ((*p_getnameinfo.f)(&sa.from.sa, sa.len, h, sizeof(h), | 463 | if (getnameinfo(&sa.from.sa, sa.len, h, sizeof(h), |
| 501 | s, sizeof(s), NI_NUMERICHOST|NI_NUMERICSERV)) | 464 | s, sizeof(s), NI_NUMERICHOST|NI_NUMERICSERV)) |
| 502 | break; | 465 | break; |
| 503 | nl = strlen(h) + strlen(s) + 2; | 466 | nl = strlen(h) + strlen(s) + 2; |
diff --git a/src/lib/libssl/src/crypto/bio/b_sock.c b/src/lib/libssl/src/crypto/bio/b_sock.c index c7a10ca348..a2845e325e 100644 --- a/src/lib/libssl/src/crypto/bio/b_sock.c +++ b/src/lib/libssl/src/crypto/bio/b_sock.c | |||
| @@ -68,7 +68,6 @@ | |||
| 68 | #include <unistd.h> | 68 | #include <unistd.h> |
| 69 | 69 | ||
| 70 | #include <openssl/bio.h> | 70 | #include <openssl/bio.h> |
| 71 | #include <openssl/dso.h> | ||
| 72 | 71 | ||
| 73 | #include "cryptlib.h" | 72 | #include "cryptlib.h" |
| 74 | 73 | ||
| @@ -306,26 +305,8 @@ BIO_get_accept_socket(char *host, int bind_mode) | |||
| 306 | 305 | ||
| 307 | #ifdef EAI_FAMILY | 306 | #ifdef EAI_FAMILY |
| 308 | do { | 307 | do { |
| 309 | static union { | ||
| 310 | void *p; | ||
| 311 | int (*f)(const char *, const char *, | ||
| 312 | const struct addrinfo *, | ||
| 313 | struct addrinfo **); | ||
| 314 | } p_getaddrinfo = {NULL}; | ||
| 315 | static union { | ||
| 316 | void *p; | ||
| 317 | void (*f)(struct addrinfo *); | ||
| 318 | } p_freeaddrinfo = {NULL}; | ||
| 319 | struct addrinfo *res, hint; | 308 | struct addrinfo *res, hint; |
| 320 | 309 | ||
| 321 | if (p_getaddrinfo.p == NULL) { | ||
| 322 | if ((p_getaddrinfo.p = DSO_global_lookup("getaddrinfo"))==NULL || | ||
| 323 | (p_freeaddrinfo.p = DSO_global_lookup("freeaddrinfo"))==NULL) | ||
| 324 | p_getaddrinfo.p = (void*) - 1; | ||
| 325 | } | ||
| 326 | if (p_getaddrinfo.p == (void *) - 1) | ||
| 327 | break; | ||
| 328 | |||
| 329 | /* '::port' enforces IPv6 wildcard listener. Some OSes, | 310 | /* '::port' enforces IPv6 wildcard listener. Some OSes, |
| 330 | * e.g. Solaris, default to IPv6 without any hint. Also | 311 | * e.g. Solaris, default to IPv6 without any hint. Also |
| 331 | * note that commonly IPv6 wildchard socket can service | 312 | * note that commonly IPv6 wildchard socket can service |
| @@ -343,14 +324,14 @@ BIO_get_accept_socket(char *host, int bind_mode) | |||
| 343 | } | 324 | } |
| 344 | } | 325 | } |
| 345 | 326 | ||
| 346 | if ((*p_getaddrinfo.f)(h, p, &hint, &res)) | 327 | if (getaddrinfo(h, p, &hint, &res)) |
| 347 | break; | 328 | break; |
| 348 | 329 | ||
| 349 | addrlen = res->ai_addrlen <= sizeof(server) ? | 330 | addrlen = res->ai_addrlen <= sizeof(server) ? |
| 350 | res->ai_addrlen : sizeof(server); | 331 | res->ai_addrlen : sizeof(server); |
| 351 | memcpy(&server, res->ai_addr, addrlen); | 332 | memcpy(&server, res->ai_addr, addrlen); |
| 352 | 333 | ||
| 353 | (*p_freeaddrinfo.f)(res); | 334 | freeaddrinfo(res); |
| 354 | goto again; | 335 | goto again; |
| 355 | } while (0); | 336 | } while (0); |
| 356 | #endif | 337 | #endif |
| @@ -478,26 +459,8 @@ BIO_accept(int sock, char **addr) | |||
| 478 | do { | 459 | do { |
| 479 | char h[NI_MAXHOST], s[NI_MAXSERV]; | 460 | char h[NI_MAXHOST], s[NI_MAXSERV]; |
| 480 | size_t nl; | 461 | size_t nl; |
| 481 | static union { | ||
| 482 | void *p; | ||
| 483 | int (*f)(const struct sockaddr *, | ||
| 484 | socklen_t, char *, size_t, | ||
| 485 | char *, size_t, int); | ||
| 486 | } p_getnameinfo = {NULL}; | ||
| 487 | /* 2nd argument to getnameinfo is specified to | ||
| 488 | * be socklen_t. Unfortunately there is a number | ||
| 489 | * of environments where socklen_t is not defined. | ||
| 490 | * As it's passed by value, it's safe to pass it | ||
| 491 | * as size_t... <appro> */ | ||
| 492 | |||
| 493 | if (p_getnameinfo.p == NULL) { | ||
| 494 | if ((p_getnameinfo.p = DSO_global_lookup("getnameinfo")) == NULL) | ||
| 495 | p_getnameinfo.p = (void*) - 1; | ||
| 496 | } | ||
| 497 | if (p_getnameinfo.p == (void *) - 1) | ||
| 498 | break; | ||
| 499 | 462 | ||
| 500 | if ((*p_getnameinfo.f)(&sa.from.sa, sa.len, h, sizeof(h), | 463 | if (getnameinfo(&sa.from.sa, sa.len, h, sizeof(h), |
| 501 | s, sizeof(s), NI_NUMERICHOST|NI_NUMERICSERV)) | 464 | s, sizeof(s), NI_NUMERICHOST|NI_NUMERICSERV)) |
| 502 | break; | 465 | break; |
| 503 | nl = strlen(h) + strlen(s) + 2; | 466 | nl = strlen(h) + strlen(s) + 2; |
