Fix typo in CONTRIBUTING.md
[openssl.git] / ssl / ssl_txt.c
index 554cc344090b1367c5b1639bd2842568f763dbb7..9e9c2e10ec8df257aea5153bbaa18c7f12d0114e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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
@@ -10,7 +10,7 @@
 
 #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)
@@ -19,7 +19,7 @@ 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);
@@ -107,7 +107,6 @@ int SSL_SESSION_print(BIO *bp, const SSL_SESSION *x)
     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)
@@ -117,7 +116,7 @@ int SSL_SESSION_print(BIO *bp, const SSL_SESSION *x)
     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)
@@ -129,12 +128,14 @@ int SSL_SESSION_print(BIO *bp, const SSL_SESSION *x)
         }
     }
 #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)
@@ -152,7 +153,7 @@ int SSL_SESSION_print(BIO *bp, const SSL_SESSION *x)
 
     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;
     }