* [including the GNU Public Licence.]
*/
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#ifdef NO_STDIO
+#define APPS_WIN16
+#endif
+
/* 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)
+#if defined(VMS) && defined(__DECC) && !defined(__U_INT)
#define __U_INT
typedef unsigned int u_int;
#endif
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
#define USE_SOCKETS
-#ifdef NO_STDIO
-#define APPS_WIN16
-#endif
#include "apps.h"
#include <openssl/x509.h>
#include <openssl/ssl.h>
#ifndef WINDOWS
else if (!ssl_pending && FD_ISSET(fileno(stdout),&writefds))
{
+#ifdef CHARSET_EBCDIC
+ ascii2ebcdic(&(sbuf[sbuf_off]),&(sbuf[sbuf_off]),sbuf_len);
+#endif
i=write(fileno(stdout),&(sbuf[sbuf_off]),sbuf_len);
if (i <= 0)
{
cbuf_len=i;
cbuf_off=0;
+#ifdef CHARSET_EBCDIC
+ ebcdic2ascii(cbuf, cbuf, i);
+#endif
}
write_ssl=1;
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<sk_X509_num(sk); i++)
{
if (peer != NULL)
{
BIO_printf(bio,"Server certificate\n");
- if (!c_showcerts) /* Redundant if we showed the whole chain */
+ if (!(c_showcerts && got_a_chain)) /* Redundant if we showed the whole chain */
PEM_write_bio_X509(bio,peer);
X509_NAME_oneline(X509_get_subject_name(peer),
buf,BUFSIZ);