initialize winsock earlier in openssl(1)
This allows commands like ocsp to work properly since we no longer initialize Winsock as a side-effect of doing a BIO_gethostbyname.
This commit is contained in:
parent
031f0aaa8f
commit
f7e4e4a266
44
patches/win_bio_sock_init.diff
Normal file
44
patches/win_bio_sock_init.diff
Normal file
@ -0,0 +1,44 @@
|
||||
diff --git a/src/usr.bin/openssl/openssl.c b/src/usr.bin/openssl/openssl.c
|
||||
index e7dd11c..cfd4593 100644
|
||||
--- a/src/usr.bin/openssl/openssl.c
|
||||
+++ b/src/usr.bin/openssl/openssl.c
|
||||
@@ -253,6 +253,11 @@ main(int argc, char **argv)
|
||||
arg.data = NULL;
|
||||
arg.count = 0;
|
||||
|
||||
+ if (BIO_sock_init() != 1) {
|
||||
+ fprintf(stderr, "BIO_sock_init failed\n");
|
||||
+ exit(1);
|
||||
+ }
|
||||
+
|
||||
bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
|
||||
if (bio_err == NULL) {
|
||||
fprintf(stderr, "openssl: failed to initialise bio_err\n");
|
||||
diff --git a/src/usr.bin/openssl/s_socket.c b/src/usr.bin/openssl/s_socket.c
|
||||
index 3b96b1a..2ce31eb 100644
|
||||
--- a/src/usr.bin/openssl/s_socket.c
|
||||
+++ b/src/usr.bin/openssl/s_socket.c
|
||||
@@ -85,11 +85,6 @@ init_client(int *sock, char *host, char *port, int type, int af)
|
||||
struct addrinfo hints, *ai_top, *ai;
|
||||
int i, s;
|
||||
|
||||
- if (BIO_sock_init() != 1) {
|
||||
- BIO_printf(bio_err, "BIO_sock_init failed\n");
|
||||
- return (0);
|
||||
- }
|
||||
-
|
||||
memset(&hints, '\0', sizeof(hints));
|
||||
hints.ai_family = af;
|
||||
hints.ai_socktype = type;
|
||||
@@ -181,11 +176,6 @@ init_server_long(int *sock, int port, char *ip, int type)
|
||||
struct sockaddr_in server;
|
||||
int s = -1;
|
||||
|
||||
- if (BIO_sock_init() != 1) {
|
||||
- BIO_printf(bio_err, "BIO_sock_init failed\n");
|
||||
- return (0);
|
||||
- }
|
||||
-
|
||||
memset((char *) &server, 0, sizeof(server));
|
||||
server.sin_family = AF_INET;
|
||||
server.sin_port = htons((unsigned short) port);
|
20
update.sh
20
update.sh
@ -18,15 +18,15 @@ fi
|
||||
git pull --rebase)
|
||||
|
||||
# setup source paths
|
||||
dir=`pwd`
|
||||
libc_src=$dir/openbsd/src/lib/libc
|
||||
libc_regress=$dir/openbsd/src/regress/lib/libc
|
||||
libcrypto_src=$dir/openbsd/src/lib/libcrypto
|
||||
libcrypto_regress=$dir/openbsd/src/regress/lib/libcrypto
|
||||
libssl_src=$dir/openbsd/src/lib/libssl
|
||||
libssl_regress=$dir/openbsd/src/regress/lib/libssl
|
||||
libtls_src=$dir/openbsd/src/lib/libtls
|
||||
openssl_app_src=$dir/openbsd/src/usr.bin/openssl
|
||||
CWD=`pwd`
|
||||
libc_src=$CWD/openbsd/src/lib/libc
|
||||
libc_regress=$CWD/openbsd/src/regress/lib/libc
|
||||
libcrypto_src=$CWD/openbsd/src/lib/libcrypto
|
||||
libcrypto_regress=$CWD/openbsd/src/regress/lib/libcrypto
|
||||
libssl_src=$CWD/openbsd/src/lib/libssl
|
||||
libssl_regress=$CWD/openbsd/src/regress/lib/libssl
|
||||
libtls_src=$CWD/openbsd/src/lib/libtls
|
||||
openssl_app_src=$CWD/openbsd/src/usr.bin/openssl
|
||||
|
||||
# load library versions
|
||||
source $libcrypto_src/crypto/shlib_version
|
||||
@ -184,6 +184,8 @@ for i in `awk '/SOURCES|HEADERS/ { print $3 }' apps/Makefile.am` ; do
|
||||
$CP $openssl_app_src/$i apps
|
||||
fi
|
||||
done
|
||||
# patch for openssl(1) oscp on windows
|
||||
(cd apps; patch -p5 < $CWD/patches/win_bio_sock_init.diff)
|
||||
|
||||
# copy libssl source
|
||||
echo "copying libssl source"
|
||||
|
Loading…
x
Reference in New Issue
Block a user