Skip to content

apply openssl-1.0.2a-ipv6-apps.patch #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 1.0.2-chacha
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions apps/s_apps.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ typedef fd_mask fd_set;
#define PORT_STR "4433"
#define PROTOCOL "tcp"

int do_server(int port, int type, int *ret,
int do_server(char *port, int type, int *ret,
int (*cb) (char *hostname, int s, int stype,
unsigned char *context), unsigned char *context,
int naccept);
Expand All @@ -167,11 +167,10 @@ int ssl_print_point_formats(BIO *out, SSL *s);
int ssl_print_curves(BIO *out, SSL *s, int noshared);
#endif
int ssl_print_tmp_key(BIO *out, SSL *s);
int init_client(int *sock, char *server, int port, int type);
int init_client(int *sock, char *server, char *port, int type);
int should_retry(int i);
int extract_port(char *str, short *port_ptr);
int extract_host_port(char *str, char **host_ptr, unsigned char *ip,
short *p);
int extract_host_port(char *str, char **host_ptr, char **port_ptr);

long MS_CALLBACK bio_dump_callback(BIO *bio, int cmd, const char *argp,
int argi, long argl, long ret);
Expand Down
12 changes: 5 additions & 7 deletions apps/s_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ int MAIN(int argc, char **argv)
int cbuf_len, cbuf_off;
int sbuf_len, sbuf_off;
fd_set readfds, writefds;
short port = PORT;
char *port_str = PORT_STR;
char *http_proxy_str = NULL, *connect_str = NULL;
int full_log = 1;
char *host = SSL_HOST_NAME;
Expand Down Expand Up @@ -803,9 +803,7 @@ int MAIN(int argc, char **argv)
} else if (strcmp(*argv, "-port") == 0) {
if (--argc < 1)
goto bad;
port = atoi(*(++argv));
if (port == 0)
goto bad;
port_str = *(++argv);
} else if (strcmp(*argv, "-connect") == 0) {
if (--argc < 1)
goto bad;
Expand Down Expand Up @@ -1156,10 +1154,10 @@ int MAIN(int argc, char **argv)
}

if (http_proxy_str) {
if (!extract_host_port(http_proxy_str, &host, NULL, &port))
if (!extract_host_port(http_proxy_str, &host, &port_str))
goto bad;
} else if (connect_str) {
if (!extract_host_port(connect_str, &host, NULL, &port))
if (!extract_host_port(connect_str, &host, &port_str))
goto bad;
}

Expand Down Expand Up @@ -1456,7 +1454,7 @@ int MAIN(int argc, char **argv)

re_start:

if (init_client(&s, host, port, socket_type) == 0) {
if (init_client(&s, host, port_str, socket_type) == 0) {
BIO_printf(bio_err, "connect:errno=%d\n", get_last_socket_error());
SHUTDOWN(s);
goto end;
Expand Down
11 changes: 6 additions & 5 deletions apps/s_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -1093,7 +1093,7 @@ int MAIN(int argc, char *argv[])
{
X509_VERIFY_PARAM *vpm = NULL;
int badarg = 0;
short port = PORT;
char *port_str = PORT_STR;
char *CApath = NULL, *CAfile = NULL;
char *chCApath = NULL, *chCAfile = NULL;
char *vfyCApath = NULL, *vfyCAfile = NULL;
Expand Down Expand Up @@ -1180,7 +1180,8 @@ int MAIN(int argc, char *argv[])
if ((strcmp(*argv, "-port") == 0) || (strcmp(*argv, "-accept") == 0)) {
if (--argc < 1)
goto bad;
if (!extract_port(*(++argv), &port))
port_str = *(++argv);
if (port_str == NULL || *port_str == '\0')
goto bad;
} else if (strcmp(*argv, "-naccept") == 0) {
if (--argc < 1)
Expand Down Expand Up @@ -2056,13 +2057,13 @@ int MAIN(int argc, char *argv[])
BIO_printf(bio_s_out, "ACCEPT\n");
(void)BIO_flush(bio_s_out);
if (rev)
do_server(port, socket_type, &accept_socket, rev_body, context,
do_server(port_str, socket_type, &accept_socket, rev_body, context,
naccept);
else if (www)
do_server(port, socket_type, &accept_socket, www_body, context,
do_server(port_str, socket_type, &accept_socket, www_body, context,
naccept);
else
do_server(port, socket_type, &accept_socket, sv_body, context,
do_server(port_str, socket_type, &accept_socket, sv_body, context,
naccept);
print_stats(bio_s_out, ctx);
ret = 0;
Expand Down
Loading