|
@@ -19,7 +19,7 @@
|
|
#include "log.h"
|
|
#include "log.h"
|
|
#include "hal.h"
|
|
#include "hal.h"
|
|
#include "radius_user.h"
|
|
#include "radius_user.h"
|
|
-#include "sntp_api.h"
|
|
|
|
|
|
+#include "sntp.h"
|
|
|
|
|
|
#ifdef PRINTF_STDLIB
|
|
#ifdef PRINTF_STDLIB
|
|
#include <stdio.h>
|
|
#include <stdio.h>
|
|
@@ -1742,20 +1742,20 @@ void ssl_server(void *pvParameters)
|
|
ret = x509parse_crt(&srvcert, (unsigned char *) test_srv_crt, strlen(test_srv_crt));
|
|
ret = x509parse_crt(&srvcert, (unsigned char *) test_srv_crt, strlen(test_srv_crt));
|
|
if(ret != 0)
|
|
if(ret != 0)
|
|
{
|
|
{
|
|
- printf(" failed\n ! x509parse_crt returned %d\n\r", ret);
|
|
|
|
|
|
+ //printf(" failed\n ! x509parse_crt returned %d\n\r", ret);
|
|
goto exit;
|
|
goto exit;
|
|
}
|
|
}
|
|
ret = x509parse_crt(&srvcert, (unsigned char *) test_ca_crt, strlen(test_ca_crt));
|
|
ret = x509parse_crt(&srvcert, (unsigned char *) test_ca_crt, strlen(test_ca_crt));
|
|
if(ret != 0)
|
|
if(ret != 0)
|
|
{
|
|
{
|
|
- printf(" failed\n ! x509parse_crt returned %d\n\r", ret);
|
|
|
|
|
|
+ //printf(" failed\n ! x509parse_crt returned %d\n\r", ret);
|
|
goto exit;
|
|
goto exit;
|
|
}
|
|
}
|
|
rsa_init( &rsa, RSA_PKCS_V15, 0 );
|
|
rsa_init( &rsa, RSA_PKCS_V15, 0 );
|
|
ret = x509parse_key(&rsa, (unsigned char *) test_srv_key, strlen(test_srv_key), NULL, 0);
|
|
ret = x509parse_key(&rsa, (unsigned char *) test_srv_key, strlen(test_srv_key), NULL, 0);
|
|
if( ret != 0 )
|
|
if( ret != 0 )
|
|
{
|
|
{
|
|
- printf(" failed\n ! x509parse_key returned %d\n\r", ret);
|
|
|
|
|
|
+ //printf(" failed\n ! x509parse_key returned %d\n\r", ret);
|
|
goto exit;
|
|
goto exit;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1766,7 +1766,7 @@ void ssl_server(void *pvParameters)
|
|
ret = net_bind(&listen_fd, NULL, 443);
|
|
ret = net_bind(&listen_fd, NULL, 443);
|
|
if(ret != 0)
|
|
if(ret != 0)
|
|
{
|
|
{
|
|
- printf(" failed\n ! net_bind returned %d\n\r", ret);
|
|
|
|
|
|
+ //printf(" failed\n ! net_bind returned %d\n\r", ret);
|
|
goto exit;
|
|
goto exit;
|
|
}
|
|
}
|
|
//printf(" ok\n\r");
|
|
//printf(" ok\n\r");
|
|
@@ -1778,7 +1778,7 @@ void ssl_server(void *pvParameters)
|
|
ret = net_accept(listen_fd, &client_fd, NULL);
|
|
ret = net_accept(listen_fd, &client_fd, NULL);
|
|
if(ret != 0)
|
|
if(ret != 0)
|
|
{
|
|
{
|
|
- printf(" failed\n ! net_accept returned %d\n\n", ret);
|
|
|
|
|
|
+ //printf(" failed\n ! net_accept returned %d\n\n", ret);
|
|
//goto exit;
|
|
//goto exit;
|
|
goto accept;
|
|
goto accept;
|
|
}
|
|
}
|
|
@@ -1791,7 +1791,7 @@ void ssl_server(void *pvParameters)
|
|
ret = ssl_init(&ssl);
|
|
ret = ssl_init(&ssl);
|
|
if(ret != 0)
|
|
if(ret != 0)
|
|
{
|
|
{
|
|
- printf(" failed\n ! ssl_init returned %d\n\n", ret);
|
|
|
|
|
|
+ //printf(" failed\n ! ssl_init returned %d\n\n", ret);
|
|
goto accept;
|
|
goto accept;
|
|
}
|
|
}
|
|
//printf(" ok\n");
|
|
//printf(" ok\n");
|
|
@@ -1838,6 +1838,8 @@ void ssl_server(void *pvParameters)
|
|
//printf("\n\r <= Read from client :");
|
|
//printf("\n\r <= Read from client :");
|
|
if(ssl_server_read() <= 0)
|
|
if(ssl_server_read() <= 0)
|
|
goto accept;
|
|
goto accept;
|
|
|
|
+
|
|
|
|
+ //ssl_server_read();
|
|
// -------------------------------------------------------------------------
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
|
//receivedBufLen = p->tot_len;
|
|
//receivedBufLen = p->tot_len;
|
|
@@ -2472,7 +2474,7 @@ exit:
|
|
|
|
|
|
accept:
|
|
accept:
|
|
// Wait 200s until next retry
|
|
// Wait 200s until next retry
|
|
- vTaskDelay(200);
|
|
|
|
|
|
+ //vTaskDelay(200);
|
|
|
|
|
|
// Close and free the SSL context
|
|
// Close and free the SSL context
|
|
net_close(client_fd);
|
|
net_close(client_fd);
|