X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=apps%2Fs_client.c;h=1fa157573a743751cf32436754652b8bc9f7f8d3;hb=35f7324c237b9b5ee46a04b88a6020173d3c66b1;hp=20e581ec204edd4e667619eef64939318bc42daf;hpb=6b691a5c85ddc4e407e32781841fee5c029506cd;p=oweals%2Fopenssl.git diff --git a/apps/s_client.c b/apps/s_client.c index 20e581ec20..1fa157573a 100644 --- a/apps/s_client.c +++ b/apps/s_client.c @@ -56,6 +56,15 @@ * [including the GNU Public Licence.] */ +/* With IPv6, it looks like Digital has mixed up the proper order of + recursive header file inclusion, resulting in the compiler complaining + that u_int isn't defined, but only if _POSIX_C_SOURCE is defined, which + is needed to have fileno() declared correctly... So let's define u_int */ +#if defined(__DECC) && !defined(__U_INT) +#define __U_INT +typedef unsigned int u_int; +#endif + #include #include #include @@ -64,12 +73,21 @@ #define APPS_WIN16 #endif #include "apps.h" -#include "x509.h" -#include "ssl.h" -#include "err.h" -#include "pem.h" +#include +#include +#include +#include #include "s_apps.h" +#if (defined(VMS) && __VMS_VER < 70000000) +/* FIONBIO used as a switch to enable ioctl, and that isn't in VMS < 7.0 */ +#undef FIONBIO +#endif + +#if defined(NO_RSA) && !defined(NO_SSL2) +#define NO_SSL2 +#endif + #undef PROG #define PROG s_client_main @@ -92,14 +110,8 @@ static int c_Pause=0; static int c_debug=0; static int c_showcerts=0; -#ifndef NOPROTO static void sc_usage(void); static void print_stuff(BIO *berr,SSL *con,int full); -#else -static void sc_usage(); -static void print_stuff(); -#endif - static BIO *bio_c_out=NULL; static int c_quiet=0; @@ -456,7 +468,14 @@ re_start: /* printf("mode tty(%d %d%d) ssl(%d%d)\n", tty_on,read_tty,write_tty,read_ssl,write_ssl);*/ - i=select(width,&readfds,&writefds,NULL,NULL); + /* Note: under VMS with SOCKETSHR the second parameter + * is currently of type (int *) whereas under other + * systems it is (void *) if you don't have a cast it + * will choke the compiler: if you do have a cast then + * you can either go for (int *) or (void *). + */ + i=select(width,(void *)&readfds,(void *)&writefds, + NULL,NULL); if ( i < 0) { BIO_printf(bio_err,"bad select %d\n", @@ -669,9 +688,13 @@ static void print_stuff(BIO *bio, SSL *s, int full) if (full) { + int got_a_chain = 0; + sk=SSL_get_peer_cert_chain(s); if (sk != NULL) { + got_a_chain = 1; /* we don't have it for SSL2 (yet) */ + BIO_printf(bio,"---\nCertificate chain\n"); for (i=0; i