Skip to content

Commit

Permalink
fixed timeout issue in axhttd, -fPIC enabled, pkcs8 enabled for server
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.code.sf.net/p/axtls/code/trunk@211 9a5d90b5-6617-0410-8a86-bb477d3ed2e3
  • Loading branch information
cameronrich committed Jun 24, 2011
1 parent 66c588d commit 96b65cd
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion config/makefile.conf
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ LDSHARED = -shared

# Linux
ifndef CONFIG_PLATFORM_CYGWIN
# CFLAGS += -fPIC
CFLAGS += -fPIC

# Cygwin
else
Expand Down
7 changes: 6 additions & 1 deletion httpd/axhttpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ int main(int argc, char *argv[])
/* main loop */
while (1)
{
struct timeval tv = { 10, 0 };
FD_ZERO(&rfds);
FD_ZERO(&wfds);
rnum = wnum = -1;
Expand Down Expand Up @@ -336,7 +337,11 @@ int main(int argc, char *argv[])
active = select(wnum > rnum ? wnum+1 : rnum+1,
rnum != -1 ? &rfds : NULL,
wnum != -1 ? &wfds : NULL,
NULL, NULL);
NULL, usedconns ? &tv : NULL);

/* timeout? */
if (active == 0)
continue;

/* New connection? */
sp = servers;
Expand Down
2 changes: 1 addition & 1 deletion ssl/Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ config CONFIG_SSL_USE_PKCS12
bool "Use PKCS8/PKCS12"
default n 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
PKCS#12 certificates combine private keys and certificates together in
one file.
Expand Down
8 changes: 6 additions & 2 deletions ssl/loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,23 +175,26 @@ void ssl_obj_free(SSLObjLoader *ssl_obj)
*/
#ifdef CONFIG_SSL_HAS_PEM

#define NUM_PEM_TYPES 3
#define NUM_PEM_TYPES 4
#define IV_SIZE 16
#define IS_RSA_PRIVATE_KEY 0
#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] =
{
"-----BEGIN RSA PRIVATE KEY-----",
"-----BEGIN ENCRYPTED PRIVATE KEY-----",
"-----BEGIN PRIVATE KEY-----",
"-----BEGIN CERTIFICATE-----",
};

static const char * const ends[NUM_PEM_TYPES] =
{
"-----END RSA PRIVATE KEY-----",
"-----END ENCRYPTED PRIVATE KEY-----",
"-----END PRIVATE KEY-----",
"-----END CERTIFICATE-----",
};

Expand Down Expand Up @@ -337,6 +340,7 @@ static int new_pem_obj(SSL_CTX *ssl_ctx, int is_cacert, char *where,
break;

case IS_ENCRYPTED_PRIVATE_KEY:
case IS_PRIVATE_KEY:
obj_type = SSL_OBJ_PKCS8;
break;

Expand Down
2 changes: 2 additions & 0 deletions ssl/test/perf_bigint.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "os_port.h"
#include "ssl.h"

/**************************************************************************
Expand Down
Loading

0 comments on commit 96b65cd

Please sign in to comment.