libssl patch for sdk 1.5.2

crosofg
Posts: 16
Joined: Wed Aug 26, 2015 1:59 pm

libssl patch for sdk 1.5.2

Postby crosofg » Sun Jan 31, 2016 5:06 pm

Can you please share the libssl patch for latest sdk. ESP resets after server handshake.

Code: Select all

add 1
aid 1
station: 34:bb:26:6b:1d:78 join, AID = 1
server handshake start.
Fatal exception 28(LoadProhibitedCause):
epc1=0x4021520d, epc2=0x00000000, epc3=0x00000000, excvaddr=0x0000000c, depc=0x00000000

 ets Jan  8 2013,rst cause:2, boot mode:(1,7)


 ets Jan  8 2013,rst cause:4, boot mode:(1,7)

wdt reset

ESP_Faye
Posts: 1646
Joined: Mon Oct 27, 2014 11:08 am

Re: libssl patch for sdk 1.5.2

Postby ESP_Faye » Mon Feb 01, 2016 2:23 pm

Hi,

Could your please provide your test code for debugging ?

Thanks for your interest in ESP8266 !

crosofg
Posts: 16
Joined: Wed Aug 26, 2015 1:59 pm

Re: libssl patch for sdk 1.5.2

Postby crosofg » Tue Feb 02, 2016 12:16 am

Please find the code attached. I am using sdk 1.5.2

Code: Select all

#include"ets_sys.h"
#include"osapi.h"
#include"gpio.h"
#include"os_type.h"
#include"user_interface.h"
#include"mem.h"
#include"espconn.h"
#include"driver/uart.h"

// Make your own user_config.h
#include"user_config.h"   // defines WIFI_SSID and WIFI_PSWD

// These  files are created by makecert.sh
#include "ssl/cert.h"      // defines myesp_crt_DER and myesp_crt_DER_len
#include "ssl/private_key.h"   // defines myesp_key_DER and myesp_key_DER_len

// listener connection data
struct espconn listenConn;
esp_tcp listenConnTcp;

// standard HTTP reply
uint8_t* reply = "HTTP/1.1 200 OK\r\n"
      "Connection: close\r\n"   // make the client (browser) close the connection after receipt
      "Content-type: text/html\r\n"
      "Content-length: 30\r\n\r\n"
      "<html><body>Test</body></html>\0";

void ICACHE_FLASH_ATTR
onRecv(void* arg, char* data, unsigned short length) {
   os_printf("Received %d bytes from client:\n--begin data--\n", length);
   uart0_tx_buffer(data, length);
   os_printf("\n--end data--\n");
   // send reply
   struct espconn* clientConn = (struct espconn*) arg;
   espconn_secure_send(clientConn, reply, os_strlen(reply));

}

void ICACHE_FLASH_ATTR
onSent(void* arg) {
   os_printf("Sent data to client.\n");
}

void ICACHE_FLASH_ATTR
onError(void* arg, int8_t err) {
   os_printf("Connection error: %d\n", err);
}

void ICACHE_FLASH_ATTR
onDisconn(void* arg) {
   os_printf("Client disconnected.\n");
}

void ICACHE_FLASH_ATTR
onClientConnected(void* arg) {
   struct espconn* clientConn = (struct espconn*) arg;
   os_printf("Client connected from %d.%d.%d.%d:%d.\n",
         clientConn->proto.tcp->remote_ip[0],
         clientConn->proto.tcp->remote_ip[1],
         clientConn->proto.tcp->remote_ip[2],
         clientConn->proto.tcp->remote_ip[3],
         clientConn->proto.tcp->remote_port);
   // register callback functions
   espconn_regist_recvcb(clientConn, onRecv);
   espconn_regist_sentcb(clientConn, onSent);
   espconn_regist_reconcb(clientConn, onError);
   espconn_regist_disconcb(clientConn, onDisconn);
}

void ICACHE_FLASH_ATTR
onWifiEvent(System_Event_t *event) {
   if (event->event != EVENT_SOFTAPMODE_STACONNECTED)
      return;
   os_printf("WiFi is up, starting HTTPS server...\n");
   // set listener configuration and register callback
   listenConn.type = ESPCONN_TCP;
   listenConn.state = ESPCONN_NONE;
   listenConn.proto.tcp = &listenConnTcp;
   listenConnTcp.local_port = 443;
   espconn_regist_connectcb(&listenConn, onClientConnected);
   // SSL configuration
   espconn_secure_set_size(0x02, 8192);
   espconn_secure_ca_disable(0x02);

   // set server certificate (defined in user_config.h and cert.h)
   espconn_secure_set_default_certificate(myesp_crt_DER, myesp_crt_DER_len);
   espconn_secure_set_default_private_key(myesp_key_DER, myesp_key_DER_len);
   // start listening
   espconn_secure_accept(&listenConn);
   os_printf("HTTPS server started.\n");
}

void ICACHE_FLASH_ATTR
onInitDone() {
   // WiFi configuration

   struct softap_config apConfig;
   char ssid[33];
   char password[33];
   wifi_set_opmode(SOFTAP_MODE);

   wifi_softap_get_config(&apConfig);
   os_memset(apConfig.ssid, 0, sizeof(apConfig.ssid));
   os_sprintf(ssid, "%s", "APESP");
   os_memcpy(apConfig.ssid, ssid, os_strlen(ssid));

   os_memset(apConfig.password, 0, sizeof(apConfig.password));
   os_sprintf(password, "%s", "");
   os_memcpy(apConfig.password, password, os_strlen(password));

   apConfig.authmode = AUTH_OPEN;
   apConfig.channel = 7;
   apConfig.max_connection = 4;
   apConfig.ssid_hidden = 0;
   wifi_softap_set_config(&apConfig);
   wifi_set_event_handler_cb(onWifiEvent);
//   wifi_station_connect();
}

void ICACHE_FLASH_ATTR
user_rf_pre_init() {
}

void ICACHE_FLASH_ATTR
user_init() {
   // initialise UART
   uart_init(BIT_RATE_9600, BIT_RATE_9600);      // 9600 baud
   system_set_os_print(1);
   // register post-initialisation callback
   system_init_done_cb(onInitDone);
}
Attachments
sslCode.zip
(18.82 KiB) Downloaded 486 times

crosofg
Posts: 16
Joined: Wed Aug 26, 2015 1:59 pm

Re: libssl patch for sdk 1.5.2

Postby crosofg » Tue Feb 02, 2016 12:18 am

This is the error I am getting.

Code: Select all

HTTPS server started.
server handshake start.
Fatal exception 28(LoadProhibitedCause):
epc1=0x4026bfa5, epc2=0x00000000, epc3=0x00000000, excvaddr=0x0000000c, depc=0x00▒▒▒Sb9▒a▒▒▒ʿ▒▒▒H▒s▒▒B[▒▒▒: softAP(5e:cf:7f:02:33:57)

ESP_Faye
Posts: 1646
Joined: Mon Oct 27, 2014 11:08 am

Re: libssl patch for sdk 1.5.2

Postby ESP_Faye » Thu Feb 04, 2016 10:22 am

Hi,

We are working on this issue now, please go back to the ESP8266_NONOS_SDK_V1.5.0 first.
So sorry for the inconvenience.
If there is any update, we will let you know.

hdrut
Posts: 25
Joined: Fri Feb 13, 2015 11:02 am
Location: Argentina

Re: libssl patch for sdk 1.5.2

Postby hdrut » Wed Feb 17, 2016 8:09 pm

Hi,

do you have any news on this? Is there a patch already?

Thks

Acuario
Posts: 2
Joined: Fri Jan 09, 2015 3:26 pm

Re: libssl patch for sdk 1.5.2

Postby Acuario » Wed Feb 24, 2016 2:56 pm

I get exactly the same problem and am using SDK esp_iot_sdk_v1.5.0_15_11_27

crosofg
Posts: 16
Joined: Wed Aug 26, 2015 1:59 pm

Re: libssl patch for sdk 1.5.2

Postby crosofg » Fri Feb 26, 2016 10:33 pm

Can anybody from Espressif reply please?

ESP_Faye
Posts: 1646
Joined: Mon Oct 27, 2014 11:08 am

Re: libssl patch for sdk 1.5.2

Postby ESP_Faye » Wed Mar 02, 2016 8:33 pm

Hi,

Sorry for the late reply.

Please have a try with the attachment base on ESP8266_NONOS_SDK_V1.5.2.
Attachments
libssl_on_ESP8266_NONOS_SDK_V1.5.2.zip
(162.05 KiB) Downloaded 514 times

hdrut
Posts: 25
Joined: Fri Feb 13, 2015 11:02 am
Location: Argentina

Re: libssl patch for sdk 1.5.2

Postby hdrut » Wed Mar 02, 2016 9:38 pm

Great, now it works !

Thank you.

Who is online

Users browsing this forum: No registered users and 15 guests