-/* ssl/ssl_txt.c */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
BIO *b;
int ret;
- if ((b = BIO_new(BIO_s_file_internal())) == NULL) {
+ if ((b = BIO_new(BIO_s_file())) == NULL) {
SSLerr(SSL_F_SSL_SESSION_PRINT_FP, ERR_R_BUF_LIB);
return (0);
}
goto err;
if (BIO_puts(bp, "SSL-Session:\n") <= 0)
goto err;
- if (x->ssl_version == SSL3_VERSION)
- s = "SSLv3";
- else if (x->ssl_version == TLS1_2_VERSION)
- s = "TLSv1.2";
- else if (x->ssl_version == TLS1_1_VERSION)
- s = "TLSv1.1";
- else if (x->ssl_version == TLS1_VERSION)
- s = "TLSv1";
- else if (x->ssl_version == DTLS1_VERSION)
- s = "DTLSv1";
- else if (x->ssl_version == DTLS1_2_VERSION)
- s = "DTLSv1.2";
- else if (x->ssl_version == DTLS1_BAD_VER)
- s = "DTLSv1-bad";
- else
- s = "unknown";
+ s = ssl_protocol_to_string(x->ssl_version);
if (BIO_printf(bp, " Protocol : %s\n", s) <= 0)
goto err;
if (BIO_printf(bp, "%02X", x->master_key[i]) <= 0)
goto err;
}
-#ifndef OPENSSL_NO_KRB5
- if (BIO_puts(bp, "\n Krb5 Principal: ") <= 0)
- goto err;
- if (x->krb5_client_princ_len == 0) {
- if (BIO_puts(bp, "None") <= 0)
- goto err;
- } else
- for (i = 0; i < x->krb5_client_princ_len; i++) {
- if (BIO_printf(bp, "%02X", x->krb5_client_princ[i]) <= 0)
- goto err;
- }
-#endif /* OPENSSL_NO_KRB5 */
#ifndef OPENSSL_NO_PSK
if (BIO_puts(bp, "\n PSK identity: ") <= 0)
goto err;
if (BIO_printf(bp, "%s", x->srp_username ? x->srp_username : "None") <= 0)
goto err;
#endif
-#ifndef OPENSSL_NO_TLSEXT
if (x->tlsext_tick_lifetime_hint) {
if (BIO_printf(bp,
"\n TLS session ticket lifetime hint: %ld (seconds)",
<= 0)
goto err;
}
-#endif
#ifndef OPENSSL_NO_COMP
if (x->compress_meth != 0) {
SSL_COMP *comp = NULL;
- ssl_cipher_get_evp(x, NULL, NULL, NULL, NULL, &comp, 0);
+ if (!ssl_cipher_get_evp(x, NULL, NULL, NULL, NULL, &comp, 0))
+ goto err;
if (comp == NULL) {
if (BIO_printf(bp, "\n Compression: %d", x->compress_meth) <=
0)
goto err;
} else {
- if (BIO_printf
- (bp, "\n Compression: %d (%s)", comp->id,
- comp->method->name) <= 0)
+ if (BIO_printf(bp, "\n Compression: %d (%s)", comp->id,
+ comp->name) <= 0)
goto err;
}
}
X509_verify_cert_error_string(x->verify_result)) <= 0)
goto err;
+ if (BIO_printf(bp, " Extended master secret: %s\n",
+ x->flags & SSL_SESS_FLAG_EXTMS ? "yes" : "no") <= 0)
+ goto err;
+
return (1);
err:
return (0);
/*
* the RSA prefix is required by the format's definition although there's
- * nothing RSA-specifc in the output, therefore, we don't have to check if
+ * nothing RSA-specific in the output, therefore, we don't have to check if
* the cipher suite is based on RSA
*/
if (BIO_puts(bp, "RSA ") <= 0)