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

added a better installer

git-svn-id: svn://svn.code.sf.net/p/axtls/code/trunk@22 9a5d90b5-6617-0410-8a86-bb477d3ed2e3
This commit is contained in:
cameronrich 2006-07-16 10:48:14 +00:00
parent 5915029090
commit 8578256d9f
19 changed files with 238 additions and 197 deletions

View File

@ -24,7 +24,7 @@ else
all: target
endif
target : $(TARGET)
target : $(STAGE) $(TARGET)
include config/makefile.conf
@ -45,11 +45,18 @@ ifdef CONFIG_SAMPLES
$(MAKE) -C samples
endif
$(STAGE) :
@mkdir -p $(STAGE)
$(PREFIX) :
@mkdir -p $(PREFIX)/lib
@mkdir -p $(PREFIX)/bin
release:
$(MAKE) -C config/scripts/config clean
-$(MAKE) clean
-@rm config/.* config/config.h
-@rm config/*.msi config/*.back.aip
-@rm config/*.msi config/*.back.aip config/config.h config/.config*
@rm -fr $(STAGE)
cd ../; tar cvfz $(RELEASE).tar.gz --wildcards-match-slash --exclude .svn axTLS; cd -;
docs:
@ -59,20 +66,21 @@ docs:
win32_demo:
-@rm -fr ../axTLS.release_test > /dev/null 2>&1
$(MAKE) win32releaseconf
cd ../; zip $(RELEASE).zip \
./axTLS/awhttpd.exe \
./axTLS/axssl.exe \
./axTLS/axtls.dll \
./axTLS/axtls.lib \
./axTLS/axtls.static.lib \
./axTLS/axtlsj.dll \
./axTLS/axssl.csharp.exe \
./axTLS/axssl.vbnet.exe \
./axTLS/axtls.jar \
./axTLS/www/* \
./axTLS/www/crypto_files/* \
./axTLS/www/test_dir/*; \
unzip -d axTLS.release_test $(RELEASE).zip; cd -;
install: $(PREFIX) all
install -m 755 $(STAGE)/libax* $(PREFIX)/lib
-install -m 755 $(STAGE)/ax* $(PREFIX)/bin
-install -m 755 $(STAGE)/axtlsp.pm `perl -e 'use Config; print $$Config{installarchlib};'`
-install -m 755 $(STAGE)/awhttpd* $(PREFIX)/bin
installclean:
-@rm $(PREFIX)/lib/libax*
-@rm $(PREFIX)/bin/ax*
-@rm $(PREFIX)/bin/awhttpd*
-@rm `perl -e 'use Config; print $$Config{installarchlib};'`/axtlsp.pm
test:
cd $(STAGE); ssltest; ../ssl/test/test_axssl.sh; cd -;
# tidy up things
clean::
@ -132,3 +140,7 @@ win32releaseconf: config/scripts/config/conf
@./config/scripts/config/conf -D config/win32config $(CONFIG_CONFIG_IN) > /dev/null
$(MAKE)
# The special debian release configuration
debianconf: config/scripts/config/conf
@./config/scripts/config/conf -D config/debianconfig $(CONFIG_CONFIG_IN) > /dev/null
$(MAKE)

16
README
View File

@ -33,7 +33,7 @@ Select your platform type, save the configuration, exit, and then
type "make" again.
If all goes well, you should end up with an executable called "awhttpd" (or
awhttpd.exe) in this directory.
awhttpd.exe) in the _stage directory.
To play with all the various axTLS options, type:
@ -45,7 +45,7 @@ Save the new configuration and rebuild.
# Running it
########################################################################
To run it, type (as superuser):
To run it, go to the _stage directory, and type (as superuser):
> awhttpd
@ -64,8 +64,6 @@ to see the same page unencrypted.
See the README in the httpd directory from more configuration information on
Anti-Web.
Note: libaxtls.so may have to in your shared library path.
########################################################################
# The axssl utilities
########################################################################
@ -82,12 +80,12 @@ axssl.pl - Perl sample
All the tools have identical command-line parameters. e.g. to run something
interesting:
> axssl s_server -verify -CAfile ssl/test/axTLS.ca_x509
> axssl s_server -verify -CAfile ../ssl/test/axTLS.ca_x509
and
> axssl s_client -cert ssl/test/axTLS.x509_1024 -key \
ssl/test/axTLS.key_1024 -reconnect
> axssl s_client -cert ../ssl/test/axTLS.x509_1024 -key \
../ssl/test/axTLS.key_1024 -reconnect
C#
==
@ -152,7 +150,7 @@ Solaris issues
Cygwin issues
=============
* The bindings all compile but don't run under cygwin with the exception of
Perl. This is due to win32 executables being incompatible with cygwin
* The bindings all compile but don't run under Cygwin with the exception of
Perl. This is due to win32 executables being incompatible with Cygwin
libraries.

View File

@ -22,12 +22,12 @@ include ../../config/makefile.java.conf
all: lib jar
JAR=../../axtls.jar
JAR=../../$(STAGE)/axtls.jar
ifdef CONFIG_PLATFORM_WIN32
TARGET=../../axtlsj.dll
TARGET=../../$(STAGE)/axtlsj.dll
else
TARGET=../../libaxtlsj.so
TARGET=../../$(STAGE)/libaxtlsj.so
endif
lib: $(TARGET)
@ -54,7 +54,7 @@ JAVA_CLASSES:=$(JAVA_FILES:%.java=classes/axTLSj/%.class)
ifdef CONFIG_PLATFORM_WIN32
CFLAGS += /I"$(shell cygpath -w $(SSL_HOME))"
CFLAGS += /I"$(shell cygpath -w $(CONFIG_HOME))"
LDFLAGS += axtls.lib /libpath:"../../"
LDFLAGS += axtls.lib /libpath:"../../$(STAGE)"
include ../../config/makefile.post
@ -71,7 +71,7 @@ CFLAGS += -I$(SSL_HOME)
CFLAGS += -I$(CONFIG_HOME)
$(TARGET) : $(OBJ)
$(LD) $(LDFLAGS) -L ../../ $(LDSHARED) -o $@ $(OBJ) -laxtls
$(LD) $(LDFLAGS) -L ../../$(STAGE) $(LDSHARED) -o $@ $(OBJ) -laxtls
endif
jar: $(OBJ) $(JAR)
@ -79,7 +79,7 @@ jar: $(OBJ) $(JAR)
# if we are doing the samples then defer creating the jar until then
$(JAR): $(JAVA_CLASSES)
ifndef CONFIG_JAVA_SAMPLES
jar cvf $@ -C classes .
jar cvf $@ -C classes axTLSj
else
@if [ ! -f $(JAR) ]; then touch $(JAR); fi
endif

View File

@ -22,9 +22,9 @@ include ../../config/makefile.conf
all: lib
ifdef CONFIG_PLATFORM_WIN32
TARGET=../../axtlsp.dll
TARGET=../../$(STAGE)/axtlsp.dll
else
TARGET=../../libaxtlsp.so
TARGET=../../$(STAGE)/libaxtlsp.so
endif
ifneq ($(MAKECMDGOALS), clean)
@ -46,13 +46,13 @@ test_perl:
endif
lib: $(TARGET)
AXOLOTLS_HOME=../..
SSL_HOME=$(AXOLOTLS_HOME)/ssl
CONFIG_HOME=$(AXOLOTLS_HOME)/config
AXTLS_HOME=../..
SSL_HOME=$(AXTLS_HOME)/ssl
CONFIG_HOME=$(AXTLS_HOME)/config
OBJ:=axTLSp_wrap.o
include ../../config/makefile.post
ifndef CONFIG_PLATFORM_WIN32
ifndef CONFIG_PLATFORM_WIN32 # Linux/Unix/Cygwin
#
# Could have used libperl.a, but it increases the library to over 1MB, so just
@ -60,22 +60,22 @@ ifndef CONFIG_PLATFORM_WIN32
# work.
#
$(TARGET) : $(OBJ)
$(LD) $(LDFLAGS) -L ../../ -L$(PERL5_CORE) $(LDSHARED) -o $@ $(OBJ) -laxtls -lperl
$(LD) $(LDFLAGS) -L ../../$(STAGE) -L$(PERL5_CORE) $(LDSHARED) -o $@ $(OBJ) -laxtls -lperl
ifdef CONFIG_PLATFORM_CYGWIN
cd ../../; ln -sf $(notdir $@) axtlsp.dll
cd ../../$(STAGE); ln -sf $(notdir $@) axtlsp.dll
endif
@install axtlsp.pm ../../
@install axtlsp.pm ../../$(STAGE)
CFLAGS += -D__USE_GNU -I$(CONFIG_HOME) -I$(SSL_HOME) -I$(PERL5_CORE)
else
CFLAGS += /I"`cygpath -w $(CONFIG_HOME)`" /I"`cygpath -w $(SSL_HOME)`"
CFLAGS += /I"$(PERL5_CORE)"
LDFLAGS += $(CONFIG_PERL_LIB) /libpath:"$(PERL5_CORE)" axtls.lib /libpath:"../../"
LDFLAGS += $(CONFIG_PERL_LIB) /libpath:"$(PERL5_CORE)" axtls.lib /libpath:"../../$(STAGE)"
$(TARGET) : $(OBJ)
$(LD) $(LDFLAGS) $(LDSHARED) /out:$@ $(OBJ)
@install axtlsp.pm ../../
install axtlsp.pm ../../$(STAGE)
endif # WIN32
clean::
@rm -f $(TARGET) axtls* *.i axTLSp* *.c .depend ../../axtlsp.pm
@rm -f $(TARGET) axtls* *.i axTLSp* *.c .depend ../../$(STAGE)/axtlsp.pm

View File

@ -29,6 +29,12 @@ endchoice
menu "General Configuration"
config PREFIX
string "axTLS installation prefix"
default "/usr/local"
help
Define your directory to install axTLS files/subdirs in.
config CONFIG_DEBUG
bool "Build axTLS with Debugging symbols"
default n
@ -47,7 +53,7 @@ depends on CONFIG_PLATFORM_WIN32
choice
prompt "Compiler"
depends on CONFIG_PLATFORM_WIN32
default CONFIG_VISUAL_STUDIO_8_0
default CONFIG_VISUAL_STUDIO_7_0
config CONFIG_VISUAL_STUDIO_6_0
bool "Visual Studio 6.0 (VC98)"

View File

@ -20,6 +20,9 @@
# A standard makefile for all makefiles
#
# All executables and libraries go here
STAGE=./_stage
ifneq ($(MAKECMDGOALS), clean)
# Give an initial rule

View File

@ -36,11 +36,12 @@ config CONFIG_STANDARD_AWHTTPD
config CONFIG_HTTP_WEBROOT
string "Web root location"
default "www"
default "../www" if !CONFIG_PLATFORM_WIN32
default "..\\www" if CONFIG_PLATFORM_WIN32
depends on !CONFIG_STANDARD_AWHTTPD
help
The location of the web root. This is the directory where
index.html lives.
The location of the web root in relation to awhttpd. This is
the directory where index.html lives.
config CONFIG_HTTP_PORT
int "HTTP port"

View File

@ -24,26 +24,26 @@ include ../config/makefile.conf
ifndef CONFIG_PLATFORM_WIN32
ifdef CONFIG_PLATFORM_CYGWIN
TARGET=../awhttpd.exe
TARGET=../$(STAGE)/awhttpd.exe
else
TARGET=../awhttpd
TARGET=../$(STAGE)/awhttpd
endif
ifdef CONFIG_HTTP_STATIC_BUILD
LIBS=../libaxtls.a
LIBS=../$(STAGE)/libaxtls.a
else
LIBS=-L../ -laxtls
LIBS=-L../$(STAGE) -laxtls
endif
CFLAGS += -I../ssl
else # win32 build
TARGET=../awhttpd.exe
TARGET=../$(STAGE)/awhttpd.exe
ifdef CONFIG_HTTP_STATIC_BUILD
LIBS=../axtls.static.lib ..\config\axtls.res
LIBS=../$(STAGE)/axtls.static.lib ..\\config\\axtls.res
else
LIBS=../axtls.lib ..\config\axtls.res
LIBS=../$(STAGE)/axtls.lib ..\\config\\axtls.res
endif
endif

View File

@ -24,16 +24,15 @@ include ../../config/makefile.conf
ifndef CONFIG_PLATFORM_WIN32
ifdef CONFIG_PLATFORM_CYGWIN
TARGET=../../axssl.exe
TARGET=../../$(STAGE)/axssl.exe
else
TARGET=../../axssl
TARGET=../../$(STAGE)/axssl
endif # cygwin
LIBS=../../libaxtls.a
LIBS=../../$(STAGE)
CFLAGS += -I../../ssl -I../../config
else
TARGET=../../axssl.exe
LIBS=../../axtls.lib
TARGET=../../$(STAGE)/axssl.exe
CFLAGS += /I"..\..\ssl" /I"..\..\config"
endif
@ -47,8 +46,8 @@ include ../../config/makefile.post
ifndef CONFIG_PLATFORM_WIN32
$(TARGET): $(OBJ) $(LIBS)
$(LD) $(LDFLAGS) -o $@ $^
$(TARGET): $(OBJ)
$(LD) $(LDFLAGS) -o $@ $< -L$(LIBS) -laxtls
ifndef CONFIG_DEBUG
ifndef CONFIG_PLATFORM_SOLARIS
strip --remove-section=.comment $(TARGET)
@ -56,12 +55,12 @@ endif # SOLARIS
endif # CONFIG_DEBUG
else # Win32
$(TARGET): $(OBJ) $(LIBS)
$(LD) $(LDFLAGS) ..\..\config\axtls.res /out:$@ $^
$(TARGET): $(OBJ)
$(LD) $(LDFLAGS) ..\\..\\config\\axtls.res /out:$@ $^ /libpath:"../../$(STAGE)" axtls.lib
endif
endif # CONFIG_C_SAMPLES
clean::
-@rm -f ../../axssl*
-@rm -f ../../$(STAGE)/axssl*

View File

@ -21,7 +21,7 @@ include ../../config/makefile.conf
include ../../config/makefile.dotnet.conf
all : sample
TARGET=../../axssl.csharp.exe
TARGET=../../$(STAGE)/axssl.csharp.exe
sample : $(TARGET)
$(TARGET): ../../bindings/csharp/axTLS.cs ../../bindings/csharp/axInterface.cs axssl.cs

View File

@ -21,12 +21,12 @@ include ../../config/makefile.conf
include ../../config/makefile.java.conf
all : sample
JAR=../../axtls.jar
JAR=../../$(STAGE)/axtls.jar
CLASSES=../../bindings/java/classes
sample : $(JAR)
$(JAR) : $(CLASSES)/axssl.class $(wildcard $(CLASSES)/axTLSj/*.class)
jar mcvf manifest.mf $@ -C $(CLASSES) .
jar mcvf manifest.mf $@ -C $(CLASSES) axTLSj -C $(CLASSES) axssl.class
JAVA_FILES=axssl.java
JAVA_CLASSES:=$(JAVA_FILES:%.java=$(CLASSES)/axTLSj/%.class)

View File

@ -20,11 +20,11 @@ include ../../config/.config
include ../../config/makefile.conf
all: samples
TARGET=../../axssl.pl
TARGET=../../$(STAGE)/axssl.pl
samples: $(TARGET)
$(TARGET): axssl.pl
@cd ../../; ln -sf samples/perl/axssl.pl axssl.pl
install $< $@
clean::
-@rm -f $(TARGET)

View File

@ -23,7 +23,7 @@ include ../../config/makefile.dotnet.conf
# only build on Win32 platforms
ifdef GO_DOT_NET
all : sample
TARGET=../../axssl.vbnet.exe
TARGET=../../$(STAGE)/axssl.vbnet.exe
sample : $(TARGET)
$(TARGET): ../../bindings/vbnet/axTLSvb.vb ../../bindings/vbnet/axInterface.vb axssl.vb

View File

@ -29,12 +29,17 @@ endif
endif
ifndef CONFIG_PLATFORM_WIN32
TARGET1=../libaxtls.a
TARGET2=../libaxtls.so
TARGET1=../$(STAGE)/libaxtls.a
BASETARGET=libaxtls.so
TARGET2=../$(STAGE)/$(BASETARGET)
# shared library major/minor numbers
LIBMAJOR=$(BASETARGET).1
LIBMINOR=$(BASETARGET).1.0
else
TARGET1=../axtls.lib
TARGET2=../axtls.dll
STATIC_LIB=../axtls.static.lib
TARGET1=axtls.lib
TARGET2=../$(STAGE)/axtls.dll
STATIC_LIB=../$(STAGE)/axtls.static.lib
endif
libs: $(TARGET1) $(TARGET2)
@ -61,13 +66,14 @@ endif
include ../config/makefile.post
ifndef CONFIG_PLATFORM_WIN32
ifndef CONFIG_PLATFORM_WIN32 # Linux/Unix/Cygwin
$(TARGET1) : $(OBJ)
$(AR) -r $@ $(OBJ)
$(TARGET2) : $(OBJ)
$(LD) $(LDFLAGS) $(LDSHARED) -o $@ $(OBJ)
$(LD) $(LDFLAGS) -Wl,-soname,$(LIBMAJOR) $(LDSHARED) -o ../$(STAGE)/$(LIBMINOR) $(OBJ)
cd ../$(STAGE); ln -sf $(LIBMINOR) $(LIBMAJOR); ln -sf $(LIBMAJOR) $(BASETARGET); cd -
else # Win32
@ -82,5 +88,5 @@ endif
clean::
$(MAKE) -C test clean
-@rm -f *.pch ../*.so ../*.a ../*.dll ../*.lib ../*.exp ../*.pdb ../*.ilk
-@rm -f ../$(STAGE)/*.pch ../$(STAGE)/*.so* ../$(STAGE)/*.a ../$(STAGE)/*.dll ../$(STAGE)/*.lib ../$(STAGE)/*.exp ../$(STAGE)/*.pdb ../$(STAGE)/*.ilk

View File

@ -30,19 +30,19 @@ all: ssltesting
endif
ifndef CONFIG_PLATFORM_WIN32
performance: ../../perf_bigint
ssltesting: ../../ssltest
LIBS=../../libaxtls.a
performance: ../../$(STAGE)/perf_bigint
ssltesting: ../../$(STAGE)/ssltest
LIBS=../../$(STAGE)
CFLAGS += -I../../ssl -I../../config
../../perf_bigint: perf_bigint.o $(LIBS)
$(CC) $(LDFLAGS) -o $@ $^
../../$(STAGE)/perf_bigint: perf_bigint.o
$(CC) $(LDFLAGS) -o $@ $^ -L $(LIBS) -laxtls
../../ssltest: ssltest.o $(LIBS)
$(CC) $(LDFLAGS) -o $@ -lpthread $^
../../$(STAGE)/ssltest: ssltest.o
$(CC) $(LDFLAGS) -o $@ $^ -lpthread -L $(LIBS) -laxtls
else
performance: ../../perf_bigint.exe
ssltesting: ../../ssltest.exe
performance: ../../$(STAGE)/perf_bigint.exe
ssltesting: ../../$(STAGE)/ssltest.exe
CFLAGS += /I".." /I"../../config"
%.obj : %.c
@ -52,14 +52,14 @@ OBJLIST=..\aes.obj ..\asn1.obj ..\bigint.obj ..\crypto_misc.obj ..\hmac.obj \
..\md5.obj ..\loader.obj ..\p12.obj ..\os_port.obj ..\rc4.obj \
..\rsa.obj ..\sha1.obj ..\tls1.obj ..\tls1_clnt.obj ..\tls1_svr.obj
../../perf_bigint.exe: perf_bigint.obj $(OBJLIST)
../../$(STAGE)/perf_bigint.exe: perf_bigint.obj $(OBJLIST)
$(LD) $(LDFLAGS) /out:$@ $^
../../ssltest.exe: ssltest.obj $(OBJLIST)
../../$(STAGE)/ssltest.exe: ssltest.obj $(OBJLIST)
$(LD) $(LDFLAGS) /out:$@ $^
endif
clean::
-@rm -f ../../perf_bigint* ../../ssltest*
-@rm -f ../../$(STAGE)/perf_bigint* ../../$(STAGE)/ssltest*
include ../../config/makefile.post

View File

@ -52,7 +52,7 @@ int main(int argc, char *argv[])
plaintext = /* 64 byte number */
"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ*^";
len = get_file("ssl/test/axTLS.key_512", &buf);
len = get_file("../ssl/test/axTLS.key_512", &buf);
asn1_get_private_key(buf, len, &rsa_ctx);
ctx = rsa_ctx->bi_ctx;
bi_data = bi_import(ctx, (uint8_t *)plaintext, strlen(plaintext));
@ -89,7 +89,7 @@ int main(int argc, char *argv[])
"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ*^"
"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ*^";
len = get_file("ssl/test/axTLS.key_1024", &buf);
len = get_file("../ssl/test/axTLS.key_1024", &buf);
asn1_get_private_key(buf, len, &rsa_ctx);
ctx = rsa_ctx->bi_ctx;
bi_data = bi_import(ctx, (uint8_t *)plaintext, strlen(plaintext));
@ -128,7 +128,7 @@ int main(int argc, char *argv[])
"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ*^"
"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ*^";
len = get_file("ssl/test/axTLS.key_2048", &buf);
len = get_file("../ssl/test/axTLS.key_2048", &buf);
asn1_get_private_key(buf, len, &rsa_ctx);
ctx = rsa_ctx->bi_ctx;
bi_data = bi_import(ctx, (uint8_t *)plaintext, strlen(plaintext));
@ -170,7 +170,7 @@ int main(int argc, char *argv[])
"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ*^"
"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ*^";
len = get_file("ssl/test/axTLS.key_4096", &buf);
len = get_file("../ssl/test/axTLS.key_4096", &buf);
asn1_get_private_key(buf, len, &rsa_ctx);
ctx = rsa_ctx->bi_ctx;
bi_data = bi_import(ctx, (uint8_t *)plaintext, strlen(plaintext));

View File

@ -39,8 +39,8 @@
#include "ssl.h"
#define DEFAULT_CERT "ssl/test/axTLS.x509_512.cer"
#define DEFAULT_KEY "ssl/test/axTLS.key_512"
#define DEFAULT_CERT "../ssl/test/axTLS.x509_512.cer"
#define DEFAULT_KEY "../ssl/test/axTLS.key_512"
//#define DEFAULT_SVR_OPTION SSL_DISPLAY_BYTES|SSL_DISPLAY_STATES
#define DEFAULT_SVR_OPTION 0
#define DEFAULT_CLNT_OPTION 0
@ -481,7 +481,7 @@ static int RSA_test(void)
uint8_t *buf;
/* extract the private key elements */
len = get_file("ssl/test/axTLS.key_1024", &buf);
len = get_file("../ssl/test/axTLS.key_1024", &buf);
if (asn1_get_private_key(buf, len, &rsa_ctx) < 0)
{
goto end;
@ -535,7 +535,7 @@ static int cert_tests(void)
/* check a bunch of 3rd party certificates */
ssl_ctx = ssl_ctx_new(0, 0);
len = get_file("ssl/test/microsoft.x509_ca", &buf);
len = get_file("../ssl/test/microsoft.x509_ca", &buf);
if ((res = add_cert_auth(ssl_ctx, buf, len)) < 0)
{
printf("Cert #1\n");
@ -547,7 +547,7 @@ static int cert_tests(void)
free(buf);
ssl_ctx = ssl_ctx_new(0, 0);
len = get_file("ssl/test/thawte.x509_ca", &buf);
len = get_file("../ssl/test/thawte.x509_ca", &buf);
if ((res = add_cert_auth(ssl_ctx, buf, len)) < 0)
{
printf("Cert #2\n");
@ -559,7 +559,7 @@ static int cert_tests(void)
free(buf);
ssl_ctx = ssl_ctx_new(0, 0);
len = get_file("ssl/test/deutsche_telecom.x509_ca", &buf);
len = get_file("../ssl/test/deutsche_telecom.x509_ca", &buf);
if ((res = add_cert_auth(ssl_ctx, buf, len)) < 0)
{
printf("Cert #3\n");
@ -571,7 +571,7 @@ static int cert_tests(void)
free(buf);
ssl_ctx = ssl_ctx_new(0, 0);
len = get_file("ssl/test/equifax.x509_ca", &buf);
len = get_file("../ssl/test/equifax.x509_ca", &buf);
if ((res = add_cert_auth(ssl_ctx, buf, len)) < 0)
{
printf("Cert #4\n");
@ -584,7 +584,7 @@ static int cert_tests(void)
/* Verisign use MD2 which is not supported */
ssl_ctx = ssl_ctx_new(0, 0);
len = get_file("ssl/test/verisign.x509_ca", &buf);
len = get_file("../ssl/test/verisign.x509_ca", &buf);
if ((res = add_cert_auth(ssl_ctx, buf, len)) !=
X509_VFY_ERROR_UNSUPPORTED_DIGEST)
{
@ -596,7 +596,7 @@ static int cert_tests(void)
ssl_ctx_free(ssl_ctx);
free(buf);
if (get_file("ssl/test/verisign.x509_my_cert", &buf) < 0 ||
if (get_file("../ssl/test/verisign.x509_my_cert", &buf) < 0 ||
x509_new(buf, &len, &x509_ctx))
{
printf("Cert #6\n");
@ -918,8 +918,8 @@ int SSL_server_tests(void)
* 512 bit RSA key
*/
if ((ret = SSL_server_test(NULL, "512 bit key", "-cipher RC4-SHA",
"ssl/test/axTLS.x509_512.cer", NULL,
"ssl/test/axTLS.key_512",
"../ssl/test/axTLS.x509_512.cer", NULL,
"../ssl/test/axTLS.key_512",
NULL, NULL, DEFAULT_SVR_OPTION)))
goto cleanup;
@ -928,9 +928,9 @@ int SSL_server_tests(void)
*/
if ((ret = SSL_server_test(NULL, "1024 bit key",
"-cipher RC4-SHA",
"ssl/test/axTLS.x509_device.cer",
"ssl/test/axTLS.x509_512.cer",
"ssl/test/axTLS.device_key",
"../ssl/test/axTLS.x509_device.cer",
"../ssl/test/axTLS.x509_512.cer",
"../ssl/test/axTLS.device_key",
NULL, NULL, DEFAULT_SVR_OPTION)))
goto cleanup;
@ -939,8 +939,8 @@ int SSL_server_tests(void)
*/
if ((ret = SSL_server_test(NULL, "2048 bit key",
"-cipher RC4-SHA",
"ssl/test/axTLS.x509_2048.cer", NULL,
"ssl/test/axTLS.key_2048",
"../ssl/test/axTLS.x509_2048.cer", NULL,
"../ssl/test/axTLS.key_2048",
NULL, NULL, DEFAULT_SVR_OPTION)))
goto cleanup;
@ -949,8 +949,8 @@ int SSL_server_tests(void)
*/
if ((ret = SSL_server_test(NULL, "4096 bit key",
"-cipher RC4-SHA",
"ssl/test/axTLS.x509_4096.cer", NULL,
"ssl/test/axTLS.key_4096",
"../ssl/test/axTLS.x509_4096.cer", NULL,
"../ssl/test/axTLS.key_4096",
NULL, NULL, DEFAULT_SVR_OPTION)))
goto cleanup;
@ -959,22 +959,22 @@ int SSL_server_tests(void)
*/
if ((ret = SSL_server_test(NULL, "Client Verification",
"-cipher RC4-SHA -tls1 "
"-cert ssl/test/axTLS.x509_2048.pem "
"-key ssl/test/axTLS.key_2048.pem ",
"-cert ../ssl/test/axTLS.x509_2048.pem "
"-key ../ssl/test/axTLS.key_2048.pem ",
NULL, NULL, NULL,
"ssl/test/axTLS.ca_x509.cer", NULL,
"../ssl/test/axTLS.ca_x509.cer", NULL,
DEFAULT_SVR_OPTION|SSL_CLIENT_AUTHENTICATION)))
goto cleanup;
/* this test should fail */
if (stat("ssl/test/axTLS.x509_bad_before.pem", &stat_buf) >= 0)
if (stat("../ssl/test/axTLS.x509_bad_before.pem", &stat_buf) >= 0)
{
if ((ret = SSL_server_test(NULL, "Bad Before Cert",
"-cipher RC4-SHA -tls1 "
"-cert ssl/test/axTLS.x509_bad_before.pem "
"-key ssl/test/axTLS.key_512.pem ",
"-cert ../ssl/test/axTLS.x509_bad_before.pem "
"-key ../ssl/test/axTLS.key_512.pem ",
NULL, NULL, NULL,
"ssl/test/axTLS.ca_x509.cer", NULL,
"../ssl/test/axTLS.ca_x509.cer", NULL,
DEFAULT_SVR_OPTION|SSL_CLIENT_AUTHENTICATION)) !=
SSL_X509_ERROR(X509_VFY_ERROR_NOT_YET_VALID))
goto cleanup;
@ -987,10 +987,10 @@ int SSL_server_tests(void)
/* this test should fail */
if ((ret = SSL_server_test(NULL, "Bad After Cert",
"-cipher RC4-SHA -tls1 "
"-cert ssl/test/axTLS.x509_bad_after.pem "
"-key ssl/test/axTLS.key_512.pem ",
"-cert ../ssl/test/axTLS.x509_bad_after.pem "
"-key ../ssl/test/axTLS.key_512.pem ",
NULL, NULL, NULL,
"ssl/test/axTLS.ca_x509.cer", NULL,
"../ssl/test/axTLS.ca_x509.cer", NULL,
DEFAULT_SVR_OPTION|SSL_CLIENT_AUTHENTICATION)) !=
SSL_X509_ERROR(X509_VFY_ERROR_EXPIRED))
goto cleanup;
@ -1000,8 +1000,8 @@ int SSL_server_tests(void)
/* this test should fail */
if ((ret = SSL_server_test(NULL, "Bogus cert", "-cipher RC4-SHA",
"ssl/test/axTLS.x509_crud.cer", NULL,
"ssl/test/axTLS.key_512", NULL,
"../ssl/test/axTLS.x509_crud.cer", NULL,
"../ssl/test/axTLS.key_512", NULL,
NULL, DEFAULT_SVR_OPTION)) != SSL_ERROR_INVALID_KEY)
goto cleanup;
@ -1011,8 +1011,8 @@ int SSL_server_tests(void)
/* this test should fail */
if ((ret = SSL_server_test(NULL, "Bogus private key",
"-cipher RC4-SHA",
"ssl/test/axTLS.x509_device.cer", NULL,
"ssl/test/axTLS.crud", NULL,
"../ssl/test/axTLS.x509_device.cer", NULL,
"../ssl/test/axTLS.crud", NULL,
NULL, DEFAULT_SVR_OPTION)) != SSL_ERROR_INVALID_KEY)
goto cleanup;
@ -1024,8 +1024,8 @@ int SSL_server_tests(void)
*/
if ((ret = SSL_server_test(NULL, "Key in PEM format",
"-cipher RC4-SHA",
"ssl/test/axTLS.x509_512.cer", NULL,
"ssl/test/axTLS.key_512.pem", NULL,
"../ssl/test/axTLS.x509_512.cer", NULL,
"../ssl/test/axTLS.key_512.pem", NULL,
NULL, DEFAULT_SVR_OPTION)))
goto cleanup;
@ -1034,8 +1034,8 @@ int SSL_server_tests(void)
*/
if ((ret = SSL_server_test(NULL, "Cert in PEM format",
"-cipher RC4-SHA",
"ssl/test/axTLS.x509_512.pem", NULL,
"ssl/test/axTLS.key_512.pem", NULL,
"../ssl/test/axTLS.x509_512.pem", NULL,
"../ssl/test/axTLS.key_512.pem", NULL,
NULL, DEFAULT_SVR_OPTION)))
goto cleanup;
@ -1044,8 +1044,8 @@ int SSL_server_tests(void)
*/
if ((ret = SSL_server_test(NULL, "Cert chain in PEM format",
"-cipher RC4-SHA",
"ssl/test/axTLS.x509_device.pem",
NULL, "ssl/test/axTLS.device_key.pem",
"../ssl/test/axTLS.x509_device.pem",
NULL, "../ssl/test/axTLS.device_key.pem",
NULL, NULL, DEFAULT_SVR_OPTION)))
goto cleanup;
@ -1054,8 +1054,8 @@ int SSL_server_tests(void)
*/
if ((ret = SSL_server_test(NULL, "AES128 encrypted key",
"-cipher RC4-SHA",
"ssl/test/axTLS.x509_aes128.pem", NULL,
"ssl/test/axTLS.key_aes128.pem",
"../ssl/test/axTLS.x509_aes128.pem", NULL,
"../ssl/test/axTLS.key_aes128.pem",
NULL, "abcd", DEFAULT_SVR_OPTION)))
goto cleanup;
@ -1064,8 +1064,8 @@ int SSL_server_tests(void)
*/
if ((ret = SSL_server_test(NULL, "AES256 encrypted key",
"-cipher RC4-SHA",
"ssl/test/axTLS.x509_aes256.pem", NULL,
"ssl/test/axTLS.key_aes256.pem",
"../ssl/test/axTLS.x509_aes256.pem", NULL,
"../ssl/test/axTLS.key_aes256.pem",
NULL, "abcd", DEFAULT_SVR_OPTION)))
goto cleanup;
@ -1074,8 +1074,8 @@ int SSL_server_tests(void)
*/
if ((ret = SSL_server_test(NULL, "AES128 encrypted invalid key",
"-cipher RC4-SHA",
"ssl/test/axTLS.x509_aes128.pem", NULL,
"ssl/test/axTLS.key_aes128.pem",
"../ssl/test/axTLS.x509_aes128.pem", NULL,
"../ssl/test/axTLS.key_aes128.pem",
NULL, "xyz", DEFAULT_SVR_OPTION)) != SSL_ERROR_INVALID_KEY)
goto cleanup;
@ -1086,7 +1086,7 @@ int SSL_server_tests(void)
* PKCS 8 key (encrypted)
*/
if ((ret = SSL_server_test(NULL, "pkcs 8 encrypted", "-cipher RC4-SHA",
DEFAULT_CERT, NULL, "ssl/test/axTLS.encrypted.p8", NULL, "abcd",
DEFAULT_CERT, NULL, "../ssl/test/axTLS.encrypted.p8", NULL, "abcd",
DEFAULT_SVR_OPTION)))
goto cleanup;
@ -1094,7 +1094,7 @@ int SSL_server_tests(void)
* PKCS 8 key (unencrypted)
*/
if ((ret = SSL_server_test(NULL, "pkcs 8 unencrypted", "-cipher RC4-SHA",
DEFAULT_CERT, NULL, "ssl/test/axTLS.unencrypted.p8", NULL, NULL,
DEFAULT_CERT, NULL, "../ssl/test/axTLS.unencrypted.p8", NULL, NULL,
DEFAULT_SVR_OPTION)))
goto cleanup;
@ -1102,12 +1102,12 @@ int SSL_server_tests(void)
* PKCS 12 key/certificate
*/
if ((ret = SSL_server_test(NULL, "pkcs 12 no CA", "-cipher RC4-SHA",
DEFAULT_CERT, NULL, "ssl/test/axTLS.withoutCA.p12",
DEFAULT_CERT, NULL, "../ssl/test/axTLS.withoutCA.p12",
NULL, "abcd", DEFAULT_SVR_OPTION)))
goto cleanup;
if ((ret = SSL_server_test(NULL, "pkcs 12 with CA", "-cipher RC4-SHA",
NULL, NULL, "ssl/test/axTLS.withCA.p12",
NULL, NULL, "../ssl/test/axTLS.withCA.p12",
NULL, "abcd", DEFAULT_SVR_OPTION)))
goto cleanup;
@ -1242,7 +1242,7 @@ static int SSL_client_test(
}
if (ssl_obj_load(*ssl_ctx, SSL_OBJ_X509_CACERT,
"ssl/test/axTLS.ca_x509.cer", NULL))
"../ssl/test/axTLS.ca_x509.cer", NULL))
{
printf("could not add cert auth\n");
TTY_FLUSH();
@ -1343,8 +1343,8 @@ int SSL_client_tests(void)
if ((ret = SSL_client_test("512 bit key",
&ssl_ctx,
"-cert ssl/test/axTLS.x509_512.pem "
"-key ssl/test/axTLS.key_512.pem", &sess_resume,
"-cert ../ssl/test/axTLS.x509_512.pem "
"-key ../ssl/test/axTLS.key_512.pem", &sess_resume,
DEFAULT_CLNT_OPTION, NULL, NULL, NULL)))
goto cleanup;
@ -1370,50 +1370,50 @@ int SSL_client_tests(void)
if ((ret = SSL_client_test("1024 bit key",
&ssl_ctx,
"-cert ssl/test/axTLS.x509_1024.pem "
"-key ssl/test/axTLS.key_1024.pem", NULL,
"-cert ../ssl/test/axTLS.x509_1024.pem "
"-key ../ssl/test/axTLS.key_1024.pem", NULL,
DEFAULT_CLNT_OPTION, NULL, NULL, NULL)))
goto cleanup;
if ((ret = SSL_client_test("2048 bit key",
&ssl_ctx,
"-cert ssl/test/axTLS.x509_2048.pem "
"-key ssl/test/axTLS.key_2048.pem", NULL,
"-cert ../ssl/test/axTLS.x509_2048.pem "
"-key ../ssl/test/axTLS.key_2048.pem", NULL,
DEFAULT_CLNT_OPTION, NULL, NULL, NULL)))
goto cleanup;
if ((ret = SSL_client_test("4096 bit key",
&ssl_ctx,
"-cert ssl/test/axTLS.x509_4096.pem "
"-key ssl/test/axTLS.key_4096.pem", NULL,
"-cert ../ssl/test/axTLS.x509_4096.pem "
"-key ../ssl/test/axTLS.key_4096.pem", NULL,
DEFAULT_CLNT_OPTION, NULL, NULL, NULL)))
goto cleanup;
if ((ret = SSL_client_test("Server cert chaining",
&ssl_ctx,
"-cert ssl/test/axTLS.x509_device.pem "
"-key ssl/test/axTLS.device_key.pem "
"-CAfile ssl/test/axTLS.x509_512.pem", NULL,
"-cert ../ssl/test/axTLS.x509_device.pem "
"-key ../ssl/test/axTLS.device_key.pem "
"-CAfile ../ssl/test/axTLS.x509_512.pem", NULL,
DEFAULT_CLNT_OPTION, NULL, NULL, NULL)))
goto cleanup;
/* Check the server can verify the client */
if ((ret = SSL_client_test("Client peer authentication",
&ssl_ctx,
"-cert ssl/test/axTLS.x509_2048.pem "
"-key ssl/test/axTLS.key_2048.pem "
"-CAfile ssl/test/axTLS.ca_x509.pem "
"-cert ../ssl/test/axTLS.x509_2048.pem "
"-key ../ssl/test/axTLS.key_2048.pem "
"-CAfile ../ssl/test/axTLS.ca_x509.pem "
"-verify 1 ", NULL, DEFAULT_CLNT_OPTION,
"ssl/test/axTLS.key_1024", NULL,
"ssl/test/axTLS.x509_1024.cer")))
"../ssl/test/axTLS.key_1024", NULL,
"../ssl/test/axTLS.x509_1024.cer")))
goto cleanup;
/* Should get an "ERROR" from openssl (as the handshake fails as soon as
* the certificate verification fails) */
if ((ret = SSL_client_test("Expired cert (verify now) should fail!",
&ssl_ctx,
"-cert ssl/test/axTLS.x509_bad_after.pem "
"-key ssl/test/axTLS.key_512.pem", NULL,
"-cert ../ssl/test/axTLS.x509_bad_after.pem "
"-key ../ssl/test/axTLS.key_512.pem", NULL,
DEFAULT_CLNT_OPTION, NULL, NULL, NULL)) !=
SSL_X509_ERROR(X509_VFY_ERROR_EXPIRED))
{
@ -1427,8 +1427,8 @@ int SSL_client_tests(void)
/* There is no "ERROR" from openssl */
if ((ret = SSL_client_test("Expired cert (verify later) should fail!",
&ssl_ctx,
"-cert ssl/test/axTLS.x509_bad_after.pem "
"-key ssl/test/axTLS.key_512.pem", NULL,
"-cert ../ssl/test/axTLS.x509_bad_after.pem "
"-key ../ssl/test/axTLS.key_512.pem", NULL,
DEFAULT_CLNT_OPTION|SSL_SERVER_VERIFY_LATER, NULL,
NULL, NULL)) != SSL_X509_ERROR(X509_VFY_ERROR_EXPIRED))
{
@ -1683,17 +1683,17 @@ int main(int argc, char *argv[])
goto cleanup;
TTY_FLUSH();
system("sh ssl/test/killopenssl.sh");
system("sh ../ssl/test/killopenssl.sh");
if (SSL_client_tests())
goto cleanup;
system("sh ssl/test/killopenssl.sh");
system("sh ../ssl/test/killopenssl.sh");
if (SSL_server_tests())
goto cleanup;
system("sh ssl/test/killopenssl.sh");
system("sh ../ssl/test/killopenssl.sh");
#if 0
if (multi_thread_test())

View File

@ -19,31 +19,41 @@
#
#
# Test the various axssl bindings
# Test the various axssl bindings. To run it, got to the _install directory
# and run this script from there.
#
if [ `uname -s` == "Linux" ]; then
# JAVA_BIN=/usr/local/jdk142/bin
if grep "CONFIG_PLATFORM_WIN32=y" "../config/.config" > /dev/null; then
JAVA_BIN="/cygdrive/c/Program Files/Java/jdk1.5.0_06/bin"
PERL_BIN="/cygdrive/c/Perl/bin/perl"
KILL_AXSSL="kill %1"
KILL_CSHARP="kill %1"
KILL_PERL="kill %1"
KILL_JAVA="kill %1"
else
if grep "CONFIG_PLATFORM_CYGWIN=y" "../config/.config" > /dev/null; then
# no .net or java on cygwin
PERL_BIN=/usr/bin/perl
KILL_AXSSL="killall axssl"
KILL_PERL="killall /usr/bin/perl"
else # Linux
JAVA_BIN=/usr/lib/java/bin
PERL_BIN=/usr/bin/perl
KILL_AXSSL="killall axssl"
KILL_CSHARP="killall mono"
KILL_PERL="killall /usr/bin/perl"
RUN_CSHARP="mono"
KILL_JAVA="killall $JAVA_BIN/java"
else
JAVA_BIN="/cygdrive/c/Program Files/Java/jdk1.5.0_06/bin"
KILL_AXSSL="kill %1"
KILL_CSHARP="kill %1"
KILL_PERL="kill %1"
KILL_JAVA="kill %1"
fi
fi
SERVER_ARGS="s_server -accept 15001 -verify -CAfile ./ssl/test/axTLS.ca_x509.cer"
CLIENT_ARGS="s_client -reconnect -connect localhost:15001 -verify -CAfile ./ssl/test/axTLS.ca_x509.cer -key ./ssl/test/axTLS.key_1024 -cert ./ssl/test/axTLS.x509_1024.cer"
BASE=..
SERVER_ARGS="s_server -accept 15001 -verify -CAfile $BASE/ssl/test/axTLS.ca_x509.cer"
CLIENT_ARGS="s_client -reconnect -connect localhost:15001 -verify -CAfile $BASE/ssl/test/axTLS.ca_x509.cer -key $BASE/ssl/test/axTLS.key_1024 -cert $BASE/ssl/test/axTLS.x509_1024.cer"
# check pem arguments
SERVER_PEM_ARGS="s_server -accept 15001 -pass abcd -key ./ssl/test/axTLS.key_aes128.pem -cert ./ssl/test/axTLS.x509_aes128.pem"
CLIENT_PEM_ARGS="s_client -connect localhost:15001 -CAfile ./ssl/test/axTLS.ca_x509.pem -key ./ssl/test/axTLS.key_1024.pem -cert ./ssl/test/axTLS.x509_1024.pem"
SERVER_PEM_ARGS="s_server -accept 15001 -pass abcd -key $BASE/ssl/test/axTLS.key_aes128.pem -cert $BASE/ssl/test/axTLS.x509_aes128.pem"
CLIENT_PEM_ARGS="s_client -connect localhost:15001 -CAfile $BASE/ssl/test/axTLS.ca_x509.pem -key $BASE/ssl/test/axTLS.key_1024.pem -cert $BASE/ssl/test/axTLS.x509_1024.pem"
export LD_LIBRARY_PATH=.:`perl -e 'use Config; print $Config{archlib};'`/CORE
@ -57,7 +67,8 @@ sleep 1
./axssl $SERVER_PEM_ARGS &
echo "C Test passed" | ./axssl $CLIENT_PEM_ARGS
$KILL_AXSSL
sleep 1
sleep 2
echo "### C tests complete"
fi
if [ -f ./axtls.jar ]; then
@ -71,6 +82,8 @@ sleep 1
echo "Java Test passed" | "$JAVA_BIN/java" -jar ./axtls.jar $CLIENT_PEM_ARGS
$KILL_JAVA
sleep 1
echo "### Java tests complete"
fi
if [ -x ./axssl.csharp.exe ]; then
@ -86,6 +99,8 @@ echo "C# Test passed" | $RUN_CSHARP ./axssl.csharp.exe $CLIENT_PEM_ARGS
sleep 1
$KILL_CSHARP
sleep 1
echo "### C# tests complete"
fi
if [ -x ./axssl.vbnet.exe ]; then
@ -101,17 +116,21 @@ sleep 1
echo "VB.NET Test passed" | ./axssl.vbnet.exe $CLIENT_PEM_ARGS
kill %1
sleep 1
echo "### VB.NET tests complete"
fi
if [ -f ./axssl.pl ]; then
echo "########################## PERL SAMPLE ###########################"
./axssl.pl $SERVER_ARGS &
echo "Perl Test passed" | ./axssl.pl $CLIENT_ARGS
"$PERL_BIN" ./axssl.pl $SERVER_ARGS &
echo "Perl Test passed" | "$PERL_BIN" ./axssl.pl $CLIENT_ARGS
$KILL_PERL
sleep 1
./axssl.pl $SERVER_PEM_ARGS &
echo "Perl Test passed" | ./axssl.pl $CLIENT_PEM_ARGS
"$PERL_BIN" ./axssl.pl $SERVER_PEM_ARGS &
echo "Perl Test passed" | "$PERL_BIN" ./axssl.pl $CLIENT_PEM_ARGS
$KILL_PERL
sleep 1
echo "### Perl tests complete"
fi
echo "########################## ALL TESTS COMPLETE ###########################"

View File

@ -2,14 +2,11 @@
echo "Content-type: text/html"
echo
echo "<HTML><TITLE>System Health</TITLE><BODY>"
echo "<H1>System Health for '`hostname`'</H1>"
echo "<H2>Processes</H2><TABLE BORDER=\"2\">"
echo "<html><title>System Health</title><body>"
echo "<h1>System Health for '`hostname`'</h1>"
echo "<h2>Processes</h2><table border=\"2\">"
ps -ef | sed -e "s/\(.*\)/<tr><td>\1<\/td><\/tr>/"
echo "</TABLE><H2>Free FileSystem Space</H2>"
echo "<TABLE BORDER=\"2\">"
echo "</table><h2>Free FileSystem Space</h2>"
echo "<table border=\"2\">"
df -h . | sed -e "s/\(.*\)/<tr><td>\1<\/td><\/tr>/"
echo "</TABLE></BODY></HTML>"
echo "</table></body></html>"