lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [bug #65040] Compilation error when MBEDTLS_HAVE_TIME is no


From: INVALID.NOREPLY
Subject: [lwip-devel] [bug #65040] Compilation error when MBEDTLS_HAVE_TIME is not defined
Date: Sat, 16 Dec 2023 08:14:32 -0500 (EST)

URL:
  <https://savannah.nongnu.org/bugs/?65040>

                 Summary: Compilation error when MBEDTLS_HAVE_TIME is not
defined
                   Group: lwIP - A Lightweight TCP/IP stack
               Submitter: flashything
               Submitted: Sat 16 Dec 2023 01:14:30 PM UTC
                Category: None
                Severity: 3 - Normal
              Item Group: Compiler Warning
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None
            lwIP version: 2.2.0


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Sat 16 Dec 2023 01:14:30 PM UTC By: Anonymous
To save space I don't use time functions in mbedtls, so MBEDTLS_HAVE_TIME is
disabled. Thus the variable "start" in mbedtls_ssl_session is also not defined
in mbedtls/ssl.h:

struct mbedtls_ssl_session {
...
#if defined(MBEDTLS_HAVE_TIME)
    mbedtls_time_t start;       /*!< starting time      */
#endif
...
}


Then the compilation of altcp_tls_set_session in altcp_tls_mbedtls.c fails,
because there is a check of "session->data.start":

altcp_tls_set_session(struct altcp_pcb *conn, struct altcp_tls_session
*session)
{
...
    if (session->data.start)
      ret = mbedtls_ssl_set_session(&state->ssl_context, &session->data);
...
}


A possible patch could be testing "id_len" instead of "start": 

--- a/src/apps/altcp_tls/altcp_tls_mbedtls.c
+++ b/src/apps/altcp_tls/altcp_tls_mbedtls.c
@@ -683,7 +683,7 @@ altcp_tls_set_session(struct altcp_pcb *conn, struct
altcp_tls_session *session)
   if (session && conn && conn->state) {
     altcp_mbedtls_state_t *state = (altcp_mbedtls_state_t *)conn->state;
     int ret = -1;
-    if (session->data.start)
+    if (session->data.id_len)
       ret = mbedtls_ssl_set_session(&state->ssl_context, &session->data);
     return ret < 0 ? ERR_VAL : ERR_OK;
   }









    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?65040>

_______________________________________________
Message sent via Savannah
https://savannah.nongnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]