lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [bug #36300] PPP CHAP stack requirements reduction


From: Sylvain Rochet
Subject: [lwip-devel] [bug #36300] PPP CHAP stack requirements reduction
Date: Wed, 25 Apr 2012 13:02:35 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.2) Gecko/20100101 Firefox/10.0.2 Iceweasel/10.0.2

URL:
  <http://savannah.nongnu.org/bugs/?36300>

                 Summary: PPP CHAP stack requirements reduction
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: gradator
            Submitted on: Wed 25 Apr 2012 01:02:35 PM GMT
                Category: None
                Severity: 3 - Normal
              Item Group: Change Request
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: 
            lwIP version: CVS Head

    _______________________________________________________

Details:

The current PPP CHAP implementation requires a lot of stack memory, let's say,
about 1 KiB stack memory is required to complete the challenge:

static void ChapReceiveResponse(...) {
  ...
  char secret[MAXSECRETLEN]; // 256
  char rhostname[256];
  MD5_CTX mdContext; // 64+16+4*4+2*4 = 104

static void ChapSendResponse(...) {
  ...
  char msg[256]; /* @todo: this can be a char*, no strcpy needed */

This can be an issue with system without much memory, if Ethernet input is
done through a thread that call ethernet_input() from etharp.c, then this
thread is going to require about 1 KiB of static stack size only necessary for
CHAP, which is only used from time to time (ideally, only one time).

Here is a patch that use mem_malloc() and mem_free() for heavy CHAP
authentication data, so that it use memory from the mem/packet pool and
doesn't waste memory.

It also uses the MAXNAMELEN define instead of the literal 256 there and
there.

Sylvain



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Wed 25 Apr 2012 01:02:35 PM GMT  Name: chap-less-stack-memory.patch 
Size: 8kB   By: gradator

<http://savannah.nongnu.org/bugs/download.php?file_id=25731>

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?36300>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/




reply via email to

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