1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-21 10:26:06 +03:00

fixed timeout issue in axhttd, -fPIC enabled, pkcs8 enabled for server

git-svn-id: svn://svn.code.sf.net/p/axtls/code/trunk@211 9a5d90b5-6617-0410-8a86-bb477d3ed2e3
This commit is contained in:
cameronrich 2011-06-24 12:16:42 +00:00
parent 66c588d3ab
commit 96b65cdb96
6 changed files with 18 additions and 7 deletions

View File

@ -100,7 +100,7 @@ LDSHARED = -shared
# Linux # Linux
ifndef CONFIG_PLATFORM_CYGWIN ifndef CONFIG_PLATFORM_CYGWIN
# CFLAGS += -fPIC CFLAGS += -fPIC
# Cygwin # Cygwin
else else

View File

@ -266,6 +266,7 @@ int main(int argc, char *argv[])
/* main loop */ /* main loop */
while (1) while (1)
{ {
struct timeval tv = { 10, 0 };
FD_ZERO(&rfds); FD_ZERO(&rfds);
FD_ZERO(&wfds); FD_ZERO(&wfds);
rnum = wnum = -1; rnum = wnum = -1;
@ -336,7 +337,11 @@ int main(int argc, char *argv[])
active = select(wnum > rnum ? wnum+1 : rnum+1, active = select(wnum > rnum ? wnum+1 : rnum+1,
rnum != -1 ? &rfds : NULL, rnum != -1 ? &rfds : NULL,
wnum != -1 ? &wfds : NULL, wnum != -1 ? &wfds : NULL,
NULL, NULL); NULL, usedconns ? &tv : NULL);
/* timeout? */
if (active == 0)
continue;
/* New connection? */ /* New connection? */
sp = servers; sp = servers;

View File

@ -225,7 +225,7 @@ config CONFIG_SSL_USE_PKCS12
bool "Use PKCS8/PKCS12" bool "Use PKCS8/PKCS12"
default n if !CONFIG_SSL_FULL_MODE default n if !CONFIG_SSL_FULL_MODE
default y if CONFIG_SSL_FULL_MODE default y if CONFIG_SSL_FULL_MODE
depends on !CONFIG_SSL_SERVER_ONLY && !CONFIG_SSL_SKELETON_MODE # depends on !CONFIG_SSL_SERVER_ONLY && !CONFIG_SSL_SKELETON_MODE
help help
PKCS#12 certificates combine private keys and certificates together in PKCS#12 certificates combine private keys and certificates together in
one file. one file.

View File

@ -175,16 +175,18 @@ void ssl_obj_free(SSLObjLoader *ssl_obj)
*/ */
#ifdef CONFIG_SSL_HAS_PEM #ifdef CONFIG_SSL_HAS_PEM
#define NUM_PEM_TYPES 3 #define NUM_PEM_TYPES 4
#define IV_SIZE 16 #define IV_SIZE 16
#define IS_RSA_PRIVATE_KEY 0 #define IS_RSA_PRIVATE_KEY 0
#define IS_ENCRYPTED_PRIVATE_KEY 1 #define IS_ENCRYPTED_PRIVATE_KEY 1
#define IS_CERTIFICATE 2 #define IS_PRIVATE_KEY 2
#define IS_CERTIFICATE 3
static const char * const begins[NUM_PEM_TYPES] = static const char * const begins[NUM_PEM_TYPES] =
{ {
"-----BEGIN RSA PRIVATE KEY-----", "-----BEGIN RSA PRIVATE KEY-----",
"-----BEGIN ENCRYPTED PRIVATE KEY-----", "-----BEGIN ENCRYPTED PRIVATE KEY-----",
"-----BEGIN PRIVATE KEY-----",
"-----BEGIN CERTIFICATE-----", "-----BEGIN CERTIFICATE-----",
}; };
@ -192,6 +194,7 @@ static const char * const ends[NUM_PEM_TYPES] =
{ {
"-----END RSA PRIVATE KEY-----", "-----END RSA PRIVATE KEY-----",
"-----END ENCRYPTED PRIVATE KEY-----", "-----END ENCRYPTED PRIVATE KEY-----",
"-----END PRIVATE KEY-----",
"-----END CERTIFICATE-----", "-----END CERTIFICATE-----",
}; };
@ -337,6 +340,7 @@ static int new_pem_obj(SSL_CTX *ssl_ctx, int is_cacert, char *where,
break; break;
case IS_ENCRYPTED_PRIVATE_KEY: case IS_ENCRYPTED_PRIVATE_KEY:
case IS_PRIVATE_KEY:
obj_type = SSL_OBJ_PKCS8; obj_type = SSL_OBJ_PKCS8;
break; break;

View File

@ -35,6 +35,8 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "os_port.h"
#include "ssl.h" #include "ssl.h"
/************************************************************************** /**************************************************************************

File diff suppressed because one or more lines are too long