From 4ba1aa393b428f0b415ef3a9a463b0a316c1a6f5 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Wed, 27 Jan 2010 14:05:39 +0000 Subject: [PATCH] typo --- CHANGES | 2 +- apps/s_server.c | 23 +++++++++++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index d6d863a447..a08a986799 100644 --- a/CHANGES +++ b/CHANGES @@ -884,7 +884,7 @@ Changes between 0.9.8l (?) and 0.9.8m (?) [xx XXX xxxx] - *) The code that handled flusing of data in SSL/TLS originally used the + *) The code that handled flushing of data in SSL/TLS originally used the BIO_CTRL_INFO ctrl to see if any data was pending first. This caused the problem outlined in PR#1949. The fix suggested there however can trigger problems with buggy BIO_CTRL_WPENDING (e.g. some versions diff --git a/apps/s_server.c b/apps/s_server.c index 6de433299c..af1c5630d3 100644 --- a/apps/s_server.c +++ b/apps/s_server.c @@ -2397,7 +2397,6 @@ static int www_body(char *hostname, int s, unsigned char *context) goto end; } - /* else we have data */ if ( ((www == 1) && (strncmp("GET ",buf,4) == 0)) || ((www == 2) && (strncmp("GET /stats ",buf,10) == 0))) { @@ -2406,6 +2405,25 @@ static int www_body(char *hostname, int s, unsigned char *context) STACK_OF(SSL_CIPHER) *sk; static const char *space=" "; + if(strncmp("GET /reneg ",buf,10) == 0) + { + for (;;) + { +fprintf(stderr, "Line: %s\n", buf); + i=BIO_gets(io,buf,bufsize-1); + if (i <= 0) + goto end; + if (buf[0] == '\r' || buf[0] == '\n') + break; + } + sleep(1); + SSL_renegotiate(con); + i=SSL_do_handshake(con); + SSL_renegotiate(con); + i=SSL_do_handshake(con); + printf("SSL_do_handshake -> %d\n",i); + } + BIO_puts(io,"HTTP/1.0 200 ok\r\nContent-type: text/html\r\n\r\n"); BIO_puts(io,"\n"); BIO_puts(io,"
\n");
@@ -2417,6 +2435,7 @@ static int www_body(char *hostname, int s, unsigned char *context)
 				BIO_write(io," ",1);
 				}
 			BIO_puts(io,"\n");
+			BIO_printf(io, "Secure Renegotiation IS%s supported\n", SSL_get_secure_renegotiation_support(con) ? "" : " NOT");
 
 			/* The following is evil and should not really
 			 * be done */
@@ -2640,7 +2659,7 @@ end:
 #endif
 
 err:
-
+ERR_print_errors(bio_err);
 	if (ret >= 0)
 		BIO_printf(bio_s_out,"ACCEPT\n");
 
-- 
2.25.1