=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/openssl/s_time.c,v retrieving revision 1.10 retrieving revision 1.11 diff -c -r1.10 -r1.11 *** src/usr.bin/openssl/s_time.c 2015/09/10 06:36:45 1.10 --- src/usr.bin/openssl/s_time.c 2015/09/11 02:08:34 1.11 *************** *** 1,4 **** ! /* $OpenBSD: s_time.c,v 1.10 2015/09/10 06:36:45 bcook Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * --- 1,4 ---- ! /* $OpenBSD: s_time.c,v 1.11 2015/09/11 02:08:34 lteo Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * *************** *** 56,63 **** * [including the GNU Public Licence.] */ - #define NO_SHUTDOWN - /*----------------------------------------- s_time - SSL client connection timer program Written and donated by Larry Streepy --- 56,61 ---- *************** *** 114,119 **** --- 112,118 ---- char *keyfile; int maxtime; int nbio; + int no_shutdown; int perform; int verify; int verify_depth; *************** *** 184,189 **** --- 183,194 ---- .value = 1, }, { + .name = "no_shutdown", + .desc = "Shutdown the connection without notifying the server", + .type = OPTION_FLAG, + .opt.flag = &s_time_config.no_shutdown, + }, + { .name = "reuse", .desc = "Reuse the same session ID for each connection", .type = OPTION_VALUE, *************** *** 221,227 **** "usage: s_time " "[-bugs] [-CAfile file] [-CApath directory] [-cert file]\n" " [-cipher cipherlist] [-connect host:port] [-key keyfile]\n" ! " [-nbio] [-new] [-reuse] [-time seconds]\n" " [-verify depth] [-www page]\n\n"); options_usage(s_time_options); } --- 226,232 ---- "usage: s_time " "[-bugs] [-CAfile file] [-CApath directory] [-cert file]\n" " [-cipher cipherlist] [-connect host:port] [-key keyfile]\n" ! " [-nbio] [-new] [-no_shutdown] [-reuse] [-time seconds]\n" " [-verify depth] [-www page]\n\n"); options_usage(s_time_options); } *************** *** 342,352 **** while ((i = SSL_read(scon, buf, sizeof(buf))) > 0) bytes_read += i; } ! #ifdef NO_SHUTDOWN ! SSL_set_shutdown(scon, SSL_SENT_SHUTDOWN | SSL_RECEIVED_SHUTDOWN); ! #else ! SSL_shutdown(scon); ! #endif shutdown(SSL_get_fd(scon), SHUT_RDWR); close(SSL_get_fd(scon)); --- 347,357 ---- while ((i = SSL_read(scon, buf, sizeof(buf))) > 0) bytes_read += i; } ! if (s_time_config.no_shutdown) ! SSL_set_shutdown(scon, SSL_SENT_SHUTDOWN | ! SSL_RECEIVED_SHUTDOWN); ! else ! SSL_shutdown(scon); shutdown(SSL_get_fd(scon), SHUT_RDWR); close(SSL_get_fd(scon)); *************** *** 401,411 **** SSL_write(scon, buf, strlen(buf)); while (SSL_read(scon, buf, sizeof(buf)) > 0); } ! #ifdef NO_SHUTDOWN ! SSL_set_shutdown(scon, SSL_SENT_SHUTDOWN | SSL_RECEIVED_SHUTDOWN); ! #else ! SSL_shutdown(scon); ! #endif shutdown(SSL_get_fd(scon), SHUT_RDWR); close(SSL_get_fd(scon)); --- 406,416 ---- SSL_write(scon, buf, strlen(buf)); while (SSL_read(scon, buf, sizeof(buf)) > 0); } ! if (s_time_config.no_shutdown) ! SSL_set_shutdown(scon, SSL_SENT_SHUTDOWN | ! SSL_RECEIVED_SHUTDOWN); ! else ! SSL_shutdown(scon); shutdown(SSL_get_fd(scon), SHUT_RDWR); close(SSL_get_fd(scon)); *************** *** 435,445 **** while ((i = SSL_read(scon, buf, sizeof(buf))) > 0) bytes_read += i; } ! #ifdef NO_SHUTDOWN ! SSL_set_shutdown(scon, SSL_SENT_SHUTDOWN | SSL_RECEIVED_SHUTDOWN); ! #else ! SSL_shutdown(scon); ! #endif shutdown(SSL_get_fd(scon), SHUT_RDWR); close(SSL_get_fd(scon)); --- 440,450 ---- while ((i = SSL_read(scon, buf, sizeof(buf))) > 0) bytes_read += i; } ! if (s_time_config.no_shutdown) ! SSL_set_shutdown(scon, SSL_SENT_SHUTDOWN | ! SSL_RECEIVED_SHUTDOWN); ! else ! SSL_shutdown(scon); shutdown(SSL_get_fd(scon), SHUT_RDWR); close(SSL_get_fd(scon));