Rename struct certs_chain member from text_buf to info_buf
authorFabian Keil <fk@fabiankeil.de>
Wed, 27 May 2020 10:13:32 +0000 (12:13 +0200)
committerFabian Keil <fk@fabiankeil.de>
Thu, 28 May 2020 11:04:17 +0000 (13:04 +0200)
project.h
ssl.c

index 2c1e51d..8b132a5 100644 (file)
--- a/project.h
+++ b/project.h
@@ -351,7 +351,7 @@ struct http_request
  * Struct for linked list containing certificates
  */
 typedef struct certs_chain {
-   char text_buf[CERT_INFO_BUF_SIZE];    /* text info about properties of certificate               */
+   char info_buf[CERT_INFO_BUF_SIZE];    /* text info about properties of certificate               */
    char file_buf[CERT_FILE_BUF_SIZE];    /* buffer for whole certificate - format to save in file   */
    struct certs_chain *next;             /* next certificate in chain of trust                      */
 } certs_chain_t;
diff --git a/ssl.c b/ssl.c
index da456e6..0bb549b 100644 (file)
--- a/ssl.c
+++ b/ssl.c
@@ -2022,7 +2022,7 @@ extern void ssl_send_certificate_error(struct client_state *csp)
    {
       size_t base64_len = 4 * ((strlen(cert->file_buf) + 2) / 3) + 1;
 
-      message_len += strlen(cert->text_buf) + strlen("<pre></pre>\n")
+      message_len += strlen(cert->info_buf) + strlen("<pre></pre>\n")
                      +  base64_len + strlen("<a href=\"data:application"
                         "/x-x509-ca-cert;base64,\">Download certificate</a>");
       cert = cert->next;
@@ -2057,7 +2057,7 @@ extern void ssl_send_certificate_error(struct client_state *csp)
       }
 
       strlcat(message, "<pre>",        message_len);
-      strlcat(message, cert->text_buf, message_len);
+      strlcat(message, cert->info_buf, message_len);
       strlcat(message, "</pre>\n",     message_len);
 
       if (ret == 0)
@@ -2122,7 +2122,7 @@ static int ssl_verify_callback(void *csp_void, mbedtls_x509_crt *crt,
     */
    last->next = malloc_or_die(sizeof(struct certs_chain));
    last->next->next = NULL;
-   memset(last->next->text_buf, 0, sizeof(last->next->text_buf));
+   memset(last->next->info_buf, 0, sizeof(last->next->info_buf));
    memset(last->next->file_buf, 0, sizeof(last->next->file_buf));
 
    /*
@@ -2150,7 +2150,7 @@ static int ssl_verify_callback(void *csp_void, mbedtls_x509_crt *crt,
 
       mbedtls_x509_crt_info(buf, sizeof(buf), CERT_INFO_PREFIX, crt);
       encoded_text = html_encode(buf);
-      strlcpy(last->text_buf, encoded_text, sizeof(last->text_buf));
+      strlcpy(last->info_buf, encoded_text, sizeof(last->info_buf));
       freez(encoded_text);
    }
 
@@ -2177,8 +2177,8 @@ static void free_certificate_chain(struct client_state *csp)
    struct certs_chain *cert = csp->server_certs_chain.next;
 
    /* Cleaning buffers */
-   memset(csp->server_certs_chain.text_buf, 0,
-      sizeof(csp->server_certs_chain.text_buf));
+   memset(csp->server_certs_chain.info_buf, 0,
+      sizeof(csp->server_certs_chain.info_buf));
    memset(csp->server_certs_chain.file_buf, 0,
       sizeof(csp->server_certs_chain.file_buf));
    csp->server_certs_chain.next = NULL;