/*
- * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2005 Nokia. All rights reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
#include <stdio.h>
#include <openssl/buffer.h>
-#include "ssl_locl.h"
+#include "ssl_local.h"
#ifndef OPENSSL_NO_STDIO
int SSL_SESSION_print_fp(FILE *fp, const SSL_SESSION *x)
int ret;
if ((b = BIO_new(BIO_s_file())) == NULL) {
- SSLerr(SSL_F_SSL_SESSION_PRINT_FP, ERR_R_BUF_LIB);
+ ERR_raise(ERR_LIB_SSL, ERR_R_BUF_LIB);
return 0;
}
BIO_set_fp(b, fp, BIO_NOCLOSE);
if (x->ext.tick) {
if (BIO_puts(bp, "\n TLS session ticket:\n") <= 0)
goto err;
- /* TODO(size_t): Convert this call */
if (BIO_dump_indent
(bp, (const char *)x->ext.tick, (int)x->ext.ticklen, 4)
<= 0)
if (x->compress_meth != 0) {
SSL_COMP *comp = NULL;
- if (!ssl_cipher_get_evp(x, NULL, NULL, NULL, NULL, &comp, 0))
+ if (!ssl_cipher_get_evp(NULL, x, NULL, NULL, NULL, NULL, &comp, 0))
goto err;
if (comp == NULL) {
if (BIO_printf(bp, "\n Compression: %d", x->compress_meth) <= 0)
}
}
#endif
- if (x->time != 0L) {
- if (BIO_printf(bp, "\n Start Time: %ld", x->time) <= 0)
+ if (!ossl_time_is_zero(x->time)) {
+ if (BIO_printf(bp, "\n Start Time: %lld",
+ (long long)ossl_time_to_time_t(x->time)) <= 0)
goto err;
}
- if (x->timeout != 0L) {
- if (BIO_printf(bp, "\n Timeout : %ld (sec)", x->timeout) <= 0)
+ if (!ossl_time_is_zero(x->timeout)) {
+ if (BIO_printf(bp, "\n Timeout : %lld (sec)",
+ (long long)ossl_time2seconds(x->timeout)) <= 0)
goto err;
}
if (BIO_puts(bp, "\n") <= 0)
if (istls13) {
if (BIO_printf(bp, " Max Early Data: %u\n",
- x->ext.max_early_data) <= 0)
+ (unsigned int)x->ext.max_early_data) <= 0)
goto err;
}