lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] https mbed TLS lwip


From: Trampas Stern
Subject: Re: [lwip-users] https mbed TLS lwip
Date: Wed, 19 Feb 2020 10:45:03 -0500

I will increase more...  

I am monitoring for alloc failures, but not seeing any. 



altcp_mbedtls_state_t *
altcp_mbedtls_alloc(void *conf)
{
  altcp_mbedtls_state_t *ret = (altcp_mbedtls_state_t *)mem_calloc(1, sizeof(altcp_mbedtls_state_t));
  if (ret != NULL) {
    ret->conf = conf;
  }
  if (NULL == ret)
  {
 ERROR("Malloc failed");
  }
  return ret;
}

void
altcp_mbedtls_free(void *conf, altcp_mbedtls_state_t *state)
{
  LWIP_UNUSED_ARG(conf);
  LWIP_ASSERT("state != NULL", state != NULL);
  mem_free(state);
}

void *
altcp_mbedtls_alloc_config(size_t size)
{
  void *ret;
  size_t checked_size = (mem_size_t)size;
  if (size != checked_size) {
    /* allocation too big (mem_size_t overflow) */
 ERROR("Alloc failed");
    return NULL;
  }
  ret = (altcp_mbedtls_state_t *)mem_calloc(1, (mem_size_t)size);
  return ret;
}

On Wed, Feb 19, 2020 at 9:46 AM Simon Goldschmidt <address@hidden> wrote:
Trampas Stern wrote:
> right now I have the following settings:
> #define MEM_SIZE                 12 * 1024
> [..]
> It appears that I am getting handshake failures...
 
During runtime mbedTLS allocates hughe amounts of memory. Depending on your
configuration, this is routed to the lwIP heap (see altcp_tls_mbedtls_mem.c).
If so, this value is *much* too low!

The other values might be too low, too. Try to increase everything to the max
(that your system allows) and see how much you actually need by monitoring
lwip_stats.

Regards,
Simon


_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users

reply via email to

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