This is a fun one. When you run
openssl s_time -connect host:port -new
it exits with status 1, even if nothing fails, because we 'goto end'
without setting ret = 0 in the -new case.
Present since the SSLeay 0.8.1b import into the OpenSSL tree [1].
A seasoned bug. :)
ok?
--
Scott Cheloha
[1]
https://github.com/openssl/openssl/blob/d02b48c63a58ea4367a0e905979f140b7d090f86/apps/s_time.c
Index: usr.bin/openssl/s_time.c
===================================================================
RCS file: /cvs/src/usr.bin/openssl/s_time.c,v
retrieving revision 1.25
diff -u -p -r1.25 s_time.c
--- usr.bin/openssl/s_time.c 11 Aug 2018 16:07:36 -0000 1.25
+++ usr.bin/openssl/s_time.c 13 Aug 2018 16:46:57 -0000
@@ -316,29 +316,22 @@ s_time_main(int argc, char **argv)
/* goto end; */
}
- if (!(s_time_config.perform & 1))
- goto next;
- printf("Collecting connection statistics for %lld seconds\n",
- (long long)s_time_config.maxtime);
-
/* Loop and time how long it takes to make connections */
-
- if (benchmark(0))
- goto end;
-
+ if (s_time_config.perform & 1) {
+ printf("Collecting connection statistics for %lld seconds\n",
+ (long long)s_time_config.maxtime);
+ if (benchmark(0))
+ goto end;
+ }
/*
* Now loop and time connections using the same session id over and
* over
*/
-
- next:
- if (!(s_time_config.perform & 2))
- goto end;
- printf("\n\nNow timing with session id reuse.\n");
-
- if (benchmark(1))
- goto end;
-
+ if (s_time_config.perform & 2) {
+ printf("\n\nNow timing with session id reuse.\n");
+ if (benchmark(1))
+ goto end;
+ }
ret = 0;
end:
if (tm_ctx != NULL) {