소스 검색

Resolved merge conflict by incorporating both suggestions.

Avetisyan Karen 7 년 전
부모
커밋
0588721b8a
6개의 변경된 파일1849개의 추가작업 그리고 396개의 파일을 삭제
  1. 255 0
      docs/makefsdata.pl
  2. 1377 388
      modules/HTTP_Server/fsdata.c
  3. 206 0
      modules/HTTP_Server/http_server.c
  4. 8 1
      modules/Makefile
  5. 1 1
      modules/mbedtls_api/cert_req.c
  6. 2 6
      modules/mbedtls_api/mbedtls_config.h

+ 255 - 0
docs/makefsdata.pl

@@ -0,0 +1,255 @@
+#!/usr/bin/perl -w
+
+use strict;
+use warnings;
+use 5.010;
+use FindBin '$Bin';
+
+use constant HTTPD_SERVER_AGENT => "lwIP/1.3.1 (http://savannah.nongnu.org/projects/lwip)";
+
+my @HTTPHeaderStrings =
+(
+   "Content-type: text/html\r\nContent-Encoding: gzip\r\n",
+   "Content-type: text/html\r\nExpires: Fri, 10 Apr 2008 14:00:00 GMT\r\nPragma: no-cache\r\n",
+   "Content-type: image/gif\r\n",
+   "Content-type: image/png\r\n",
+   "Content-type: image/jpeg\r\n",
+   "Content-type: image/bmp\r\n",
+   "Content-type: image/x-icon\r\n",
+   "Content-type: application/octet-stream\r\n",
+   "Content-type: application/x-javascript\r\nContent-Encoding: gzip\r\n",
+   "Content-type: application/x-javascript\r\nContent-Encoding: gzip\r\n",
+   "Content-type: text/css\r\nContent-Encoding: gzip\r\n",
+   "Content-type: application/x-shockwave-flash\r\n",
+   "Content-type: text/xml\r\n",
+   "Content-type: text/plain\r\n",
+   "HTTP/1.0 200 OK\r\n",
+   "HTTP/1.0 404 File not found\r\n",
+   "HTTP/1.0 400 Bad Request\r\n",
+   "HTTP/1.0 501 Not Implemented\r\n",
+   "HTTP/1.1 200 OK\r\n",
+   "HTTP/1.1 404 File not found\r\n",
+   "HTTP/1.1 400 Bad Request\r\n",
+   "HTTP/1.1 501 Not Implemented\r\n",
+   "Content-Length: ",
+   "Connection: Close\r\n",
+   "Server: ".HTTPD_SERVER_AGENT."\r\n",
+   "\r\n<html><body><h2>404: The requested file cannot be found.</h2></body></html>\r\n"
+);
+
+use constant {
+  HTTP_HDR_HTML           => 0,  # text/html
+  HTTP_HDR_SSI            => 1,  # text/html Expires...
+  HTTP_HDR_GIF            => 2,  # image/gif
+  HTTP_HDR_PNG            => 3,  # image/png
+  HTTP_HDR_JPG            => 4,  # image/jpeg
+  HTTP_HDR_BMP            => 5,  # image/bmp
+  HTTP_HDR_ICO            => 6,  # image/x-icon
+  HTTP_HDR_APP            => 7,  # application/octet-stream
+  HTTP_HDR_JS             => 8,  # application/x-javascript
+  HTTP_HDR_RA             => 9,  # application/x-javascript
+  HTTP_HDR_CSS            => 10, # text/css
+  HTTP_HDR_SWF            => 11, # application/x-shockwave-flash
+  HTTP_HDR_XML            => 12, # text/xml
+  HTTP_HDR_DEFAULT_TYPE   => 13, # text/plain
+  HTTP_HDR_OK             => 14, # 200 OK
+  HTTP_HDR_NOT_FOUND      => 15, # 404 File not found
+  HTTP_HDR_BAD_REQUEST    => 16, # 400 Bad request
+  HTTP_HDR_NOT_IMPL       => 17, # 501 Not Implemented
+  HTTP_HDR_OK_11          => 18, # 200 OK
+  HTTP_HDR_NOT_FOUND_11   => 19, # 404 File not found
+  HTTP_HDR_BAD_REQUEST_11 => 20, # 400 Bad request
+  HTTP_HDR_NOT_IMPL_11    => 21, # 501 Not Implemented
+  HTTP_HDR_CONTENT_LENGTH => 22, # Content-Length: (HTTP 1.1)
+  HTTP_HDR_CONN_CLOSE     => 23, # Connection: Close (HTTP 1.1)
+  HTTP_HDR_SERVER         => 24, # Server: HTTPD_SERVER_AGENT
+  DEFAULT_404_HTML        => 25, # default 404 body
+};
+
+use constant HEX_BYTES_PER_LINE => 16;
+
+
+
+my $cwd;
+my $fsdir;
+my $num_args = $#ARGV + 1;
+if ($num_args > 0) {
+  foreach my $argnum (0 .. $#ARGV) {
+    if ($ARGV[$argnum] eq "-h" or $ARGV[$argnum] eq "--help"){
+      say "    __  ___      __        ____         __      __       ";
+      say "   /  |/  /___ _/ /_____  / __/________/ /___ _/ /_____ _";
+      say "  / /|_/ / __ `/ //_/ _ \\/ /_/ ___/ __  / __ `/ __/ __ `/";
+      say " / /  / / /_/ / ,< /  __/ __(__  ) /_/ / /_/ / /_/ /_/ / ";
+      say "/_/  /_/\\__,_/_/|_|\\___/_/ /____/\\__,_/\\__,_/\\__/\\__,_/  ";
+      say "                                                         ";
+      say "makefsdata - HTML to C source converter\n\n";
+      say "Usage: makefsdata.pl <fsdata_file_dir> <fs_folder_dir>\n";
+      exit;
+    }
+  }
+  if($num_args != 2) {
+    say "Incorrect arguments!\n";
+    say "Usage: makefsdata.pl <fsdata_file_dir> <fs_folder_dir>\n";
+    exit;
+  }
+  if(-d $ARGV[0] and -d $ARGV[1] ){
+    # say $ARGV[0];
+    # say $ARGV[1];
+    $cwd = $ARGV[0];
+    $fsdir = $ARGV[1];
+  } else {
+    say "Drectory dosn't exist!\n";
+    exit;
+  }
+} else {
+  $cwd = $Bin;
+  $fsdir = "$cwd/fs";
+}
+
+open(OUTPUT, "> $cwd/fsdata.c");
+chdir($fsdir);
+
+my $dir = '.';
+
+opendir(DIR, $dir) or die "Can't open directory $!";
+
+my $file;
+my $fvar;
+my $prevfile;
+my @files;
+my @fvars;
+
+print(OUTPUT "#include \"lwip/def.h\"\n");
+print(OUTPUT "#include \"fsdata.h\"\n");
+print(OUTPUT "\n\n#define file_NULL (struct fsdata_file *) NULL\n\n\n");
+
+my $z = 0;
+while($file = readdir(DIR)) {
+
+  # Do not include files in CVS directories nor backup files.
+  if($file =~ /(CVS|~)/) {
+    next;
+  }
+  next if ($file =~ m/^\./);
+  say("Processing --> $file");
+  my $size = -s $file;
+
+  my $curHeader;
+  if($file =~ /\.html$/) {
+    $curHeader = $HTTPHeaderStrings[HTTP_HDR_HTML];
+  } elsif($file =~ /\.js$/) {
+    $curHeader = $HTTPHeaderStrings[HTTP_HDR_JS];
+  } elsif($file =~ /\.css$/) {
+    $curHeader = $HTTPHeaderStrings[HTTP_HDR_CSS];
+  } elsif($file =~ /\.ico$/) {
+    $curHeader = $HTTPHeaderStrings[HTTP_HDR_ICO];
+  } elsif($file =~ /\.gif$/) {
+    $curHeader = $HTTPHeaderStrings[HTTP_HDR_GIF];
+  } elsif($file =~ /\.png$/) {
+    $curHeader = $HTTPHeaderStrings[HTTP_HDR_PNG];
+  } elsif($file =~ /\.jpg$/) {
+    $curHeader = $HTTPHeaderStrings[HTTP_HDR_JPG];
+  } elsif($file =~ /\.class$/) {
+    $curHeader = $HTTPHeaderStrings[HTTP_HDR_APP];
+  } else {
+    $curHeader = $HTTPHeaderStrings[HTTP_HDR_DEFAULT_TYPE];
+  }
+
+  my $contentLength = "$HTTPHeaderStrings[HTTP_HDR_CONTENT_LENGTH]$size\r\n";
+  say $curHeader;
+  say "$HTTPHeaderStrings[HTTP_HDR_CONTENT_LENGTH]$size";
+
+  system("cp $file /tmp/file");
+  open(FILE, "/tmp/file");
+  unlink("/tmp/file");
+
+  my $i = 0;
+  my $fvar = $file;
+  $fvar =~ s-/-_-g;
+  $fvar =~ s-\.-_-g;
+  my $filenamelen = length("/$file");
+  print(OUTPUT "static const unsigned int dummy_align__$fvar = $z;\n");
+  print(OUTPUT "static const unsigned char data__".$fvar."[] = {\n");
+  print(OUTPUT "/* /$file ($filenamelen chars) */\n");
+
+  # Filename to hex
+  for(my $j = 0; $j < $filenamelen; $j++) {
+    printf(OUTPUT "0x%02.2x,", unpack("C", substr("/$file", $j, 1)));
+  }
+  printf(OUTPUT "0x00,\n");
+  $z++;
+
+  print(OUTPUT "\n/* HTTP header */\n");
+  sub hearderGen{
+    my ($header) = @_;
+    my $header_len = length($header);
+    print(OUTPUT "\n/* \"$header\" ($header_len bytes) */");
+    for(my $j = 0; $j < length($header); $j++) {
+      if(($j % HEX_BYTES_PER_LINE) == 0) {
+        print(OUTPUT "\n");
+      }
+      printf(OUTPUT "0x%02.2x,", unpack("C", substr($header, $j, 1)));
+    }
+    return;
+  }
+
+  # Generate random Etag sting
+  sub rndStr{ join'', @_[ map{ rand @_ } 1 .. shift ] }
+  my $etag = rndStr(15, 'A'..'Z', 0..9, 'a'..'z');
+
+  # Put hex heders to file
+  if($file =~ /404/) {
+    hearderGen($HTTPHeaderStrings[HTTP_HDR_NOT_FOUND_11]);
+  } else {
+    hearderGen($HTTPHeaderStrings[HTTP_HDR_OK_11]);
+  }
+  hearderGen($HTTPHeaderStrings[HTTP_HDR_SERVER]);
+  hearderGen($contentLength);
+  hearderGen($HTTPHeaderStrings[HTTP_HDR_CONN_CLOSE]);
+  hearderGen($curHeader);
+  hearderGen("ETag: \"$etag\"\r\n");
+  # /r/n
+  printf(OUTPUT "0x0d,0x0a,\n");
+
+  say "Etag: \"$etag\"";
+  say "----------------------------\n";
+
+  # RAW file to hex
+  print(OUTPUT "\n/* raw file data ($size bytes) */");
+  while(read(FILE, my $data, 1)) {
+    if($i == 0) {
+      print(OUTPUT "\n");
+    }
+
+    printf(OUTPUT "0x%02.2x,", unpack("C", $data));
+    $i++;
+    if($i == HEX_BYTES_PER_LINE) {
+      print(OUTPUT "");
+      $i = 0;
+    }
+  }
+  print(OUTPUT "};\n\n");
+  close(FILE);
+  push(@fvars, $fvar);
+  push(@files, $file);
+}
+
+my $i;
+for($i = 0; $i < @fvars; $i++) {
+  $file = $files[$i];
+  $fvar = $fvars[$i];
+
+  if($i == 0) {
+    $prevfile = "file_NULL";
+  } else {
+    $prevfile = "file__" . $fvars[$i - 1];
+  }
+  print(OUTPUT "const struct fsdata_file file__".$fvar."[] = {{\n\t$prevfile,\n\tdata__$fvar,\n\t");
+  print(OUTPUT "data__$fvar + ". (length($file) + 2) .",\n\t");
+  print(OUTPUT "sizeof(data__$fvar) - ". (length($file) + 2) .",\n\t1,\n}};\n\n");
+}
+
+print(OUTPUT "#define FS_ROOT file__$fvars[$i - 1]\n");
+print(OUTPUT "#define FS_NUMFILES $i\n");
+
+say "Done!\nNow you have fsdata.c";

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1377 - 388
modules/HTTP_Server/fsdata.c


+ 206 - 0
modules/HTTP_Server/http_server.c

@@ -48,6 +48,10 @@ static void HTTP_ForceUserLogout(uint8_t user_id);
 void LogoutTimerCallback(TimerHandle_t pxTimer);
 void LoginTimerCallback(TimerHandle_t pxTimer);
 int HTTP_ChangeUserPwd(char *bufIn, char *bufOut, uint16_t lenBufIn, uint16_t *lenBufOut);
+void send_file(char *filename, char *pnonmatch,  struct fs_file *file);
+static uint32_t Parse_Header(char *data, uint32_t len, const char *field, uint32_t flen, char *value);
+bool GetFileName(char *inStr, char *fileName, uint8_t *fileNameLen);
+
 
 SET_PAGE_t SET_PAGE = SET_PAGE_IDLE;
 
@@ -91,6 +95,13 @@ bool Authenticated = false;
 /* Level of currently logged-in user */
 uint8_t seclevel = 0xFF;
 
+/* Max HTTP file name length including "/" */
+#define MAX_FILENAME_LEN    32
+/* Max HTTP Etag field length */
+#define MAX_ETAG_LEN        48
+static const char If_None_Match[] = "If-None-Match: ";
+static const char Etag[] = "ETag: ";
+
 static volatile uint32_t DataFlag2=0;
 static volatile uint32_t DataFlag=0;
 static volatile uint32_t size =0;
@@ -103,6 +114,7 @@ static const char Content_Length[17] =
 /* Content Length */
 {0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x4c, 0x65, 0x6e, 0x67,0x74, 0x68, 0x3a, 0x20, };
 
+const char HTTP_304_NOT_MODIFIED[] = "HTTP/1.1 304 Not Modified\r\n\r\n";
 const char HTTP_200_OK[] = "HTTP/1.1 200 OK\r\n\r\n";
 /* utf-8 marker to support MS Excel */
 const char UTF8_BOM[] = {0xEF, 0xBB, 0xBF, 0x00};
@@ -2830,6 +2842,8 @@ void HTTPS_Init()
 #include "FreeRTOS.h"
 #include "task.h" 
 
+#include "cert_req.h"
+
 #include <stdlib.h>
 #include <string.h>
 
@@ -2857,6 +2871,8 @@ struct fs_file file = {0, 0};
 #define HEAP_SIZE       (1u << 14)  // 16k
 unsigned char malloc_buf[HEAP_SIZE];
 
+extern unsigned char req_cert[];
+
 //
 void Cockie(void)
 {
@@ -2901,6 +2917,7 @@ void ssl_server(void *pvParameters)
   SSL_SERVER_STATE ssl_state = SSL_ACCEPT;
   char* sendPtr;
   int ret;
+  TickType_t handshakeTime = 0;
   
 #ifdef MBEDTLS_MEMORY_BUFFER_ALLOC_C
   mbedtls_memory_buffer_alloc_init(malloc_buf, sizeof(malloc_buf));
@@ -3008,6 +3025,7 @@ void ssl_server(void *pvParameters)
     case SSL_HANDSHAKE :
       
       mbedtls_printf( "  . Performing the SSL/TLS handshake..." );
+      handshakeTime = xTaskGetTickCount();
       while( ( ret = mbedtls_ssl_handshake( &ssl ) ) != 0 )
       {
         if( ret != MBEDTLS_ERR_SSL_WANT_READ && ret != MBEDTLS_ERR_SSL_WANT_WRITE )
@@ -3022,6 +3040,7 @@ void ssl_server(void *pvParameters)
         ssl_state = SSL_ERROR;
       else {
         mbedtls_printf( " ok\r\n" );
+        printf("HANDSHAKE_TIME: %d ms\r\n", xTaskGetTickCount() - handshakeTime);
         ssl_state = SSL_READ;
       }
       
@@ -3060,6 +3079,7 @@ void ssl_server(void *pvParameters)
     case SSL_ERROR :
       //mbedtls_net_free(&client_fd);
       //mbedtls_ssl_free( &ssl );
+      mbedtls_ssl_close_notify(&ssl);
       mbedtls_net_free(&client_fd);
       ssl_state = SSL_ACCEPT;
     break;
@@ -3175,6 +3195,30 @@ char* SSL_ProcessingRoutine(uint16_t* sendLen)
 //
 char* AuthenticatedFalseRoutine(uint16_t* sendLen)
 {
+	if (strncmp(receiveBuf, "GET", 3) == 0) {
+	  char filename[MAX_FILENAME_LEN];
+	  char nonmatch[MAX_ETAG_LEN];
+	  char *pnonmatch = NULL;
+	  uint8_t len;
+
+	  if (GetFileName(receiveBuf, filename, &len)) {
+		  HTTP_UpdateUserLoginTime(user_id);
+
+		  /* Parce If-Non_Match value */
+		  uint8_t nonmatch_len = Parse_Header(receiveBuf, receivedBufLen, If_None_Match, 15, nonmatch);
+		  if (nonmatch_len < MAX_ETAG_LEN && nonmatch_len > 0) {
+			  DBG printf("If_None_Match: %s\r\n", nonmatch);
+			  pnonmatch = nonmatch;
+		  }
+		  memset(sendBuf, 0, sizeof(sendBuf));
+		  send_file(filename, pnonmatch, &file);
+
+		  if (strlen(sendBuf)) {
+			  *sendLen = strlen(sendBuf);
+			  return sendBuf;
+		  }
+	  }
+	}
     if (strncmp(receiveBuf, "GET /main.css", 13) == 0) // +
     {
         fs_open("/main.css", &file);
@@ -3318,6 +3362,31 @@ char* AuthenticatedTrueRoutine(uint16_t* sendLen)
     char *DataOffset;
     char *ptr;
     
+    if (strncmp(receiveBuf, "GET", 3) == 0) {
+		  char filename[MAX_FILENAME_LEN];
+		  char nonmatch[MAX_ETAG_LEN];
+		  char *pnonmatch = NULL;
+		  uint8_t len;
+
+		  if (GetFileName(receiveBuf, filename, &len)) {
+			  HTTP_UpdateUserLoginTime(user_id);
+
+			  /* Parce If-Non_Match value */
+			  uint8_t nonmatch_len = Parse_Header(receiveBuf, receivedBufLen, If_None_Match, 15, nonmatch);
+			  if (nonmatch_len < MAX_ETAG_LEN && nonmatch_len > 0) {
+				  DBG printf("If_None_Match: %s\r\n", nonmatch);
+				  pnonmatch = nonmatch;
+			  }
+			  memset(sendBuf, 0, sizeof(sendBuf));
+			  send_file(filename, pnonmatch, &file);
+
+			  if (strlen(sendBuf)) {
+				  *sendLen = strlen(sendBuf);
+				  return sendBuf;
+			  }
+		  }
+	  }
+
     if (strncmp(receiveBuf, "GET /main.css", 13) == 0) // +
     {
         fs_open("/main.css", &file);
@@ -3449,6 +3518,19 @@ char* AuthenticatedTrueRoutine(uint16_t* sendLen)
         }  
         return 0;
     } 
+    else if (strncmp(receiveBuf, "GET /getcert.cgi", 16) == 0)
+    {
+    	/* Send HTTP header first (Safari needs it) */
+
+		  strcpy(sendBuf, HTTP_200_OK);
+		  *sendLen = strlen(sendBuf);
+		  SSL_WriteRoutine(&ssl, sendBuf, *sendLen);
+
+		//  SSL_Test();
+
+		  *sendLen = strlen(req_cert);
+		  return req_cert;
+    }
     else if (strncmp(receiveBuf, "POST /srv_crt_upload.cgi", 24) == 0)
     {
         static char boundary[70];
@@ -3830,3 +3912,127 @@ void HTTP_SendLog(void)
   
     return;
 }
+
+/**
+  * @brief  sends file from flash FS
+  * @param  filename: pointer to the file name to send
+  * @param  pnonmatch: pointer to the If-Non_Match value
+  * @param  pcb: pointer to a tcp_pcb struct
+  * @param  hs: pointer to a http_state struct
+  * @param  file: pointer to a fs_file struct
+  * @retval
+  */
+void send_file(char *filename, char *pnonmatch,  struct fs_file *file)
+{
+    int res = 0;
+    char etag[MAX_ETAG_LEN];
+    char *petag = NULL;
+
+    res = fs_open(filename, file);
+
+    if (res == 0) {
+        printf("Not found: %s\r\n", filename);
+        sprintf(filename, "/index.html");
+        fs_open(filename, file);
+    }
+
+    /* Find Etag value */
+    uint8_t etag_len = Parse_Header(file->data, file->len, Etag, 6, etag);
+    if (etag_len < MAX_ETAG_LEN && etag_len > 0) {
+        DBG printf("Etag: %s\r\n", etag);
+        petag = etag;
+    }
+
+    /* Compare Etag and If-Non-Match fields */
+    if (pnonmatch && petag && (strcmp(pnonmatch, petag) == 0)) {
+        /* Send 304 code */
+        sprintf(sendBuf, HTTP_304_NOT_MODIFIED);
+        DBG printf(sendBuf);
+        //hs->file = sendBuf;
+        //hs->left = strlen(sendBuf);
+    }
+    else {
+        /* Send file */
+        //DBG printf("%s\r\n\r\n", filename);
+        //hs->file = file->data;
+        //hs->left = file->len;
+    }
+
+    //send_data(pcb, hs);
+    //tcp_sent(pcb, http_sent);
+}
+
+/**
+  * @brief  Extract the custom field data from HTML data
+  * @param  data : pointer on receive packet buffer
+  * @param  len  : buffer length
+  * @param  field : field name
+  * @param  flen : field name length
+  * @retval value : pointer for field data
+  */
+static uint32_t Parse_Header(char *data, uint32_t len, const char *field, uint32_t flen, char *value)
+{
+    uint32_t i = 0, size = 0;
+    char *ptr;
+    uint32_t Offset = 0;
+
+    /* Find field name in data buffer */
+    for (i = 0; i < len; i++) {
+        if (strncmp ((char*)(data + i), field, flen) == 0) {
+            Offset = i + flen;
+            break;
+        }
+    }
+    /* Copy Field value */
+    if (Offset) {
+        i = 0;
+        ptr = (char*)(data + Offset);
+        while (*(ptr + i) != 0x0d) {
+            value[i] = *(ptr + i);
+            i++;
+        }
+        value[i] = '\0';
+        size = i;
+    }
+    return size;
+}
+/**
+  * @brief
+  * @retval None
+  */
+bool GetFileName(char *inStr, char *fileName, uint8_t *fileNameLen)
+{
+  char *beginValue = NULL;
+  char *endValue = NULL;
+  int  len = 0;
+  char *strPtr = NULL;
+
+  strPtr = strstr(inStr, "GET");
+  if (strPtr == NULL) {
+      strPtr = strstr(inStr, "POST");
+  }
+
+  if (strPtr == NULL) {
+      *fileNameLen = 0;
+      return false;
+  }
+  else {
+    beginValue = strpbrk(strPtr, "/");
+
+    endValue = strpbrk(beginValue, " ");
+    if (endValue == NULL) {
+        *fileNameLen = 0;
+        return false;
+    }
+    len = endValue - beginValue;
+    if (len < MAX_FILENAME_LEN) {
+        strncpy(fileName, beginValue, len);
+        *fileNameLen = len;
+        fileName[len] = '\0';
+        return true;
+    }
+    else {
+        return false;
+    }
+  }
+}

+ 8 - 1
modules/Makefile

@@ -135,7 +135,14 @@ FW_NAME = BT_6702xx
 
 -include ../Makefile.inc.stm32
 
-prebuild:
+#Building Web UI FS
+WUI_DIR = ../web_interface/dist/wui
+FSDATA_DIR = ./HTTP_Server
+
+$(FSDATA_DIR)/fsdata.c: $(WUI_DIR)/*
+	@../docs/makefsdata.pl $(FSDATA_DIR) $(WUI_DIR)
+
+prebuild: $(FSDATA_DIR)/fsdata.c
 	@echo "Hardware version: $(HARDWARE)"
 	
 postbuild: $(BUILDDIR)/$(TARGET).bin

+ 1 - 1
modules/mbedtls_api/cert_req.c

@@ -56,7 +56,7 @@ struct options
 } opt;
 
 
-unsigned char req_cert[4096];
+unsigned char req_cert[500];
 
 
 void SSL_Test()

+ 2 - 6
modules/mbedtls_api/mbedtls_config.h

@@ -48,7 +48,6 @@
 
 /* mbed TLS feature support */
 #define MBEDTLS_ECP_DP_SECP256R1_ENABLED
-#define MBEDTLS_ECP_DP_SECP384R1_ENABLED
 #define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
 
 #define MBEDTLS_SSL_PROTO_TLS1_2
@@ -118,12 +117,10 @@
  * is the "mbedtls_platform_entropy_poll" source, but you may want to add other ones.
  * Minimum is 2 for the entropy test suite.
  */
-#define MBEDTLS_ENTROPY_MAX_SOURCES 2
+#define MBEDTLS_ENTROPY_MAX_SOURCES 1
 
 /* Save ROM and a few bytes of RAM by specifying our own ciphersuite list */
 //#define MBEDTLS_SSL_CIPHERSUITES                        \
-//    MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,    \
-//    MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
       
 /*
  * Save RAM at the expense of interoperability: do this only if you control
@@ -134,10 +131,9 @@
 #define MBEDTLS_SSL_MAX_CONTENT_LEN             2048
 
 #define MBEDTLS_CAMELLIA_C
-#define MBEDTLS_BLOWFISH_C
 
 #define MBEDTLS_PLATFORM_C
-#define MBEDTLS_MEMORY_BUFFER_ALLOC_C
+//#define MBEDTLS_MEMORY_BUFFER_ALLOC_C
 #define MBEDTLS_PLATFORM_MEMORY
 //#define MBEDTLS_MEMORY_DEBUG
 #define MBEDTLS_SELF_TEST

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.