mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-21 10:26:06 +03:00
fixed win32 build
git-svn-id: svn://svn.code.sf.net/p/axtls/code/trunk@117 9a5d90b5-6617-0410-8a86-bb477d3ed2e3
This commit is contained in:
parent
f9ee197cff
commit
2bbf4cfd92
@ -471,8 +471,10 @@ namespace axTLS
|
||||
public SSL Connect(Socket s, byte[] session_id)
|
||||
{
|
||||
int client_fd = s.Handle.ToInt32();
|
||||
return new SSL(axtls. ssl_client_new(m_ctx, client_fd, session_id,
|
||||
session_id ? null : session_id.Length));
|
||||
byte sess_id_size = (byte)(session_id != null ?
|
||||
session_id.Length : 0);
|
||||
return new SSL(axtls.ssl_client_new(m_ctx, client_fd, session_id,
|
||||
sess_id_size));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -177,13 +177,13 @@ print DATA_OUT << "END";
|
||||
%apply signed char[] {signed char *};
|
||||
|
||||
/* allow ssl_get_session_id() to return "byte[]" */
|
||||
%typemap(out) unsigned char * ssl_get_session_id \"if (result) jresult = SWIG_JavaArrayOutSchar(jenv, result, SSL_SESSION_ID_SIZE);\"
|
||||
%typemap(out) unsigned char * ssl_get_session_id \"if (result) jresult = SWIG_JavaArrayOutSchar(jenv, result, ssl_get_session_id_size((SSL const *)arg1));\"
|
||||
|
||||
/* allow ssl_client_new() to have a null session_id input */
|
||||
%typemap(in) const signed char session_id[] (jbyte *jarr) {
|
||||
if (jarg3 == NULL)
|
||||
{
|
||||
jresult = (jint)ssl_client_new(arg1,arg2,NULL);
|
||||
jresult = (jint)ssl_client_new(arg1,arg2,NULL,0);
|
||||
return jresult;
|
||||
}
|
||||
|
||||
@ -275,7 +275,7 @@ JNIEXPORT jint JNICALL Java_axTLSj_axtlsjJNI_getFd(JNIEnv *env, jclass jcls, job
|
||||
|
||||
/* for ssl_session_id() */
|
||||
%typemap(out) const unsigned char * {
|
||||
SV *svs = newSVpv((const char *)\$1, SSL_SESSION_ID_SIZE);
|
||||
SV *svs = newSVpv((unsigned char *)\$1, (int)ssl_get_session_id((SSL const *)arg1));
|
||||
\$result = newRV(svs);
|
||||
sv_2mortal(\$result);
|
||||
argvi++;
|
||||
@ -330,7 +330,7 @@ SWIG_TYPEMAP_NUM_ARR(uchar,unsigned char);
|
||||
%typemap(out) const unsigned char * {
|
||||
int i;
|
||||
lua_newtable(L);
|
||||
for (i = 0; i < SSL_SESSION_ID_SIZE; i++){
|
||||
for (i = 0; i < ssl_get_session_id((SSL const *)\$1); i++){
|
||||
lua_pushnumber(L,(lua_Number)result[i]);
|
||||
lua_rawseti(L,-2,i+1); /* -1 is the number, -2 is the table */
|
||||
}
|
||||
@ -359,7 +359,7 @@ SWIG_TYPEMAP_NUM_ARR(uchar,unsigned char);
|
||||
if (lua_isnil(L,\$input))
|
||||
\$1 = NULL;
|
||||
else
|
||||
\$1 = SWIG_get_uchar_num_array_fixed(L,\$input, SSL_SESSION_ID_SIZE);
|
||||
\$1 = SWIG_get_uchar_num_array_fixed(L,\$input, ssl_get_session_id((SSL const *)\$1));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -90,6 +90,7 @@ sub transformSignature
|
||||
$line =~ s/uint8_t \*\* ?(\w+)/ByRef $1 As IntPtr/g;
|
||||
$line =~ s/const uint8_t \* ?(\w+)/ByVal $1() As Byte/g;
|
||||
$line =~ s/uint8_t \* ?(\w+)/ByVal $1() As Byte/g;
|
||||
$line =~ s/uint8_t ?(\w+)/ByVal $1 As Byte/g;
|
||||
$line =~ s/const char \* ?(\w+)/ByVal $1 As String/g;
|
||||
$line =~ s/const SSL_CTX \* ?(\w+)/ByVal $1 As IntPtr/g;
|
||||
$line =~ s/SSL_CTX \* ?(\w+)/ByVal $1 As IntPtr/g;
|
||||
|
@ -61,6 +61,9 @@ public class SSLClient extends SSLCTX
|
||||
public SSL connect(Socket s, byte[] session_id)
|
||||
{
|
||||
int client_fd = axtlsj.getFd(s);
|
||||
return new SSL(axtlsj.ssl_client_new(m_ctx, client_fd, session_id));
|
||||
byte sess_id_size = (byte)(session_id != null ?
|
||||
session_id.length : 0);
|
||||
return new SSL(axtlsj.ssl_client_new(m_ctx, client_fd, session_id,
|
||||
sess_id_size));
|
||||
}
|
||||
}
|
||||
|
@ -48,8 +48,7 @@ Namespace axTLSvb
|
||||
Public Function GetSessionId() As Byte()
|
||||
Dim ptr As IntPtr = axtls.ssl_get_session_id(m_ssl)
|
||||
Dim sess_id_size As Integer = axtls.ssl_get_session_id_size(m_ssl)
|
||||
|
||||
Dim result(sess_id_size) As Byte
|
||||
Dim result(sess_id_size-1) As Byte
|
||||
Marshal.Copy(ptr, result, 0, sess_id_size)
|
||||
Return result
|
||||
End Function
|
||||
@ -172,10 +171,16 @@ Namespace axTLSvb
|
||||
End Sub
|
||||
|
||||
Public Function Connect(ByVal s As Socket, _
|
||||
ByVal session_id As Byte(), _
|
||||
ByVal sess_id_size As Integer) As SSL
|
||||
ByVal session_id As Byte()) As SSL
|
||||
Dim client_fd As Integer = s.Handle.ToInt32()
|
||||
Return New SSL( axtls.ssl_client_new(m_ctx, client_fd, session_id, _
|
||||
Dim sess_id_size As Byte
|
||||
If session_id is Nothing Then
|
||||
sess_id_size = 0
|
||||
Else
|
||||
sess_id_size = session_id.Length
|
||||
End If
|
||||
|
||||
Return New SSL(axtls.ssl_client_new(m_ctx, client_fd, session_id, _
|
||||
sess_id_size))
|
||||
End Function
|
||||
|
||||
|
@ -54,7 +54,8 @@ endif
|
||||
|
||||
CC=cl.exe
|
||||
LD=link.exe
|
||||
CFLAGS+=/nologo /W3 /D "WIN32" /D "_MBCS" /D "_CONSOLE" /FD /I"..\ssl" /I"..\config" /c
|
||||
AXTLS_INCLUDE=$(shell cygpath -w $(AXTLS_HOME))
|
||||
CFLAGS+=/nologo /W3 /D "WIN32" /D "_MBCS" /D "_CONSOLE" /FD /I"$(AXTLS_INCLUDE)crypto" /I"$(AXTLS_INCLUDE)ssl" /I"$(AXTLS_INCLUDE)config" /c
|
||||
LDFLAGS=/nologo /subsystem:console /machine:I386
|
||||
LDSHARED = /dll
|
||||
AR=lib /nologo
|
||||
|
@ -28,6 +28,7 @@ OBJ=\
|
||||
rc4.o \
|
||||
sha1.o
|
||||
|
||||
include ../config/makefile.post
|
||||
|
||||
all: $(OBJ)
|
||||
|
||||
include ../config/makefile.post
|
||||
|
@ -18,27 +18,27 @@
|
||||
|
||||
all : web_server lua
|
||||
|
||||
include ../config/.config
|
||||
include ../config/makefile.conf
|
||||
AXTLS_HOME=..
|
||||
|
||||
include $(AXTLS_HOME)/config/.config
|
||||
include $(AXTLS_HOME)/config/makefile.conf
|
||||
|
||||
ifndef CONFIG_PLATFORM_WIN32
|
||||
|
||||
ifdef CONFIG_PLATFORM_CYGWIN
|
||||
TARGET=../$(STAGE)/axhttpd.exe
|
||||
TARGET2=../$(STAGE)/htpasswd.exe
|
||||
TARGET=$(AXTLS_HOME)/$(STAGE)/axhttpd.exe
|
||||
TARGET2=$(AXTLS_HOME)/$(STAGE)/htpasswd.exe
|
||||
else
|
||||
TARGET=../$(STAGE)/axhttpd
|
||||
TARGET2=../$(STAGE)/htpasswd
|
||||
TARGET=$(AXTLS_HOME)/$(STAGE)/axhttpd
|
||||
TARGET2=$(AXTLS_HOME)/$(STAGE)/htpasswd
|
||||
endif
|
||||
|
||||
ifdef CONFIG_HTTP_STATIC_BUILD
|
||||
LIBS=../$(STAGE)/libaxtls.a
|
||||
LIBS=$(AXTLS_HOME)/$(STAGE)/libaxtls.a
|
||||
else
|
||||
LIBS=-L../$(STAGE) -laxtls
|
||||
LIBS=-L$(AXTLS_HOME)/$(STAGE) -laxtls
|
||||
endif
|
||||
|
||||
AXTLS_HOME=..
|
||||
|
||||
ifdef CONFIG_HTTP_BUILD_LUA
|
||||
lua: kepler-1.1
|
||||
|
||||
@ -53,13 +53,13 @@ endif
|
||||
else # win32 build
|
||||
lua:
|
||||
|
||||
TARGET=../$(STAGE)/axhttpd.exe
|
||||
TARGET2=../$(STAGE)/htpasswd.exe
|
||||
TARGET=$(AXTLS_HOME)/$(STAGE)/axhttpd.exe
|
||||
TARGET2=$(AXTLS_HOME)/$(STAGE)/htpasswd.exe
|
||||
|
||||
ifdef CONFIG_HTTP_STATIC_BUILD
|
||||
LIBS=../$(STAGE)/axtls.static.lib ..\\config\\axtls.res
|
||||
LIBS=$(AXTLS_HOME)/$(STAGE)/axtls.static.lib $(AXTLS_HOME)\\config\\axtls.res
|
||||
else
|
||||
LIBS=../$(STAGE)/axtls.lib ..\\config\\axtls.res
|
||||
LIBS=$(AXTLS_HOME)/$(STAGE)/axtls.lib $(AXTLS_HOME)\\config\\axtls.res
|
||||
endif
|
||||
endif
|
||||
|
||||
@ -78,11 +78,11 @@ OBJ= \
|
||||
proc.o \
|
||||
tdate_parse.o
|
||||
|
||||
include ../config/makefile.post
|
||||
include $(AXTLS_HOME)/config/makefile.post
|
||||
|
||||
ifndef CONFIG_PLATFORM_WIN32
|
||||
|
||||
$(TARGET): $(OBJ) ../$(STAGE)/libaxtls.a
|
||||
$(TARGET): $(OBJ) $(AXTLS_HOME)/$(STAGE)/libaxtls.a
|
||||
$(LD) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
|
||||
ifndef CONFIG_DEBUG
|
||||
ifndef CONFIG_PLATFORM_SOLARIS
|
||||
@ -90,7 +90,7 @@ ifndef CONFIG_PLATFORM_SOLARIS
|
||||
endif
|
||||
endif
|
||||
|
||||
$(TARGET2): htpasswd.o ../$(STAGE)/libaxtls.a
|
||||
$(TARGET2): htpasswd.o $(AXTLS_HOME)/$(STAGE)/libaxtls.a
|
||||
$(LD) $(LDFLAGS) -o $@ htpasswd.o $(LIBS)
|
||||
|
||||
else # Win32
|
||||
@ -100,13 +100,13 @@ OBJ:=$(OBJ:.o=.obj)
|
||||
$(CC) $(CFLAGS) $<
|
||||
|
||||
htpasswd.obj : htpasswd.c
|
||||
$(CC) $(CFLAGS) $<
|
||||
$(CC) $(CFLAGS) $?
|
||||
|
||||
$(TARGET): $(OBJ)
|
||||
$(LD) $(LDFLAGS) $(LIBS) /out:$@ $(OBJ)
|
||||
$(LD) $(LDFLAGS) /out:$@ $(LIBS) $?
|
||||
|
||||
$(TARGET2): htpasswd.obj
|
||||
$(LD) $(LDFLAGS) $(LIBS) /out:$@ $<
|
||||
$(LD) $(LDFLAGS) /out:$@ $(LIBS) $?
|
||||
endif
|
||||
|
||||
endif # CONFIG_AXHTTPD
|
||||
|
@ -18,22 +18,22 @@
|
||||
|
||||
all : sample
|
||||
|
||||
include ../../config/.config
|
||||
include ../../config/makefile.conf
|
||||
AXTLS_HOME=../..
|
||||
|
||||
include $(AXTLS_HOME)/config/.config
|
||||
include $(AXTLS_HOME)/config/makefile.conf
|
||||
|
||||
ifndef CONFIG_PLATFORM_WIN32
|
||||
|
||||
ifdef CONFIG_PLATFORM_CYGWIN
|
||||
TARGET=../../$(STAGE)/axssl.exe
|
||||
TARGET=$(AXTLS_HOME)/$(STAGE)/axssl.exe
|
||||
else
|
||||
TARGET=../../$(STAGE)/axssl
|
||||
TARGET=$(AXTLS_HOME)/$(STAGE)/axssl
|
||||
endif # cygwin
|
||||
|
||||
LIBS=../../$(STAGE)
|
||||
CFLAGS += -I../../crypto -I../../ssl -I../../config
|
||||
LIBS=$(AXTLS_HOME)/$(STAGE)
|
||||
else
|
||||
TARGET=../../$(STAGE)/axssl.exe
|
||||
CFLAGS += /I"..\..\ssl" /I"..\..\config"
|
||||
TARGET=$(AXTLS_HOME)/$(STAGE)/axssl.exe
|
||||
endif
|
||||
|
||||
ifndef CONFIG_C_SAMPLES
|
||||
@ -42,12 +42,12 @@ sample:
|
||||
else
|
||||
sample : $(TARGET)
|
||||
OBJ= axssl.o
|
||||
include ../../config/makefile.post
|
||||
include $(AXTLS_HOME)/config/makefile.post
|
||||
|
||||
ifndef CONFIG_PLATFORM_WIN32
|
||||
|
||||
$(TARGET): $(OBJ) $(LIBS)/libaxtls.a
|
||||
$(LD) $(LDFLAGS) -o $@ $< -L$(LIBS) -laxtls
|
||||
$(LD) $(LDFLAGS) -o $@ $(OBJ) -L$(LIBS) -laxtls
|
||||
ifndef CONFIG_DEBUG
|
||||
ifndef CONFIG_PLATFORM_SOLARIS
|
||||
strip --remove-section=.comment $(TARGET)
|
||||
@ -56,11 +56,11 @@ endif # CONFIG_DEBUG
|
||||
else # Win32
|
||||
|
||||
$(TARGET): $(OBJ)
|
||||
$(LD) $(LDFLAGS) ..\\..\\config\\axtls.res /out:$@ $^ /libpath:"../../$(STAGE)" axtls.lib
|
||||
$(LD) $(LDFLAGS) $(AXTLS_HOME)/config/axtls.res /out:$@ $^ /libpath:"$(AXTLS_HOME)/$(STAGE)" axtls.lib
|
||||
endif
|
||||
|
||||
endif # CONFIG_C_SAMPLES
|
||||
|
||||
clean::
|
||||
-@rm -f ../../$(STAGE)/axssl*
|
||||
-@rm -f $(AXTLS_HOME)/$(STAGE)/axssl*
|
||||
|
||||
|
@ -508,8 +508,7 @@ public class axssl
|
||||
{
|
||||
while (reconnect-- > 0)
|
||||
{
|
||||
ssl = ssl_ctx.Connect(client_sock, session_id,
|
||||
axtls.SSL_SESSION_ID_SIZE);
|
||||
ssl = ssl_ctx.Connect(client_sock, session_id);
|
||||
|
||||
if ((res = ssl.HandshakeStatus()) != axtls.SSL_OK)
|
||||
{
|
||||
|
53
ssl/Makefile
53
ssl/Makefile
@ -16,8 +16,10 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
include ../config/.config
|
||||
include ../config/makefile.conf
|
||||
AXTLS_HOME=..
|
||||
|
||||
include $(AXTLS_HOME)/config/.config
|
||||
include $(AXTLS_HOME)/config/makefile.conf
|
||||
|
||||
all: libs
|
||||
ifdef CONFIG_PERFORMANCE_TESTING
|
||||
@ -29,76 +31,79 @@ endif
|
||||
endif
|
||||
|
||||
ifndef CONFIG_PLATFORM_WIN32
|
||||
TARGET1=../$(STAGE)/libaxtls.a
|
||||
TARGET1=$(AXTLS_HOME)/$(STAGE)/libaxtls.a
|
||||
BASETARGET=libaxtls.so
|
||||
CRYPTO_PATH=$(AXTLS_HOME)/crypto/
|
||||
ifdef CONFIG_PLATFORM_CYGWIN
|
||||
TARGET2=../$(STAGE)/libaxtls.dll.a
|
||||
TARGET2=$(AXTLS_HOME)/$(STAGE)/libaxtls.dll.a
|
||||
else
|
||||
TARGET2=../$(STAGE)/$(LIBMINOR)
|
||||
TARGET2=$(AXTLS_HOME)/$(STAGE)/$(LIBMINOR)
|
||||
endif
|
||||
|
||||
# shared library major/minor numbers
|
||||
LIBMAJOR=$(BASETARGET).1
|
||||
LIBMINOR=$(BASETARGET).1.1
|
||||
else
|
||||
TARGET1=axtls.lib
|
||||
TARGET2=../$(STAGE)/axtls.dll
|
||||
STATIC_LIB=../$(STAGE)/axtls.static.lib
|
||||
TARGET1=$(AXTLS_HOME)/axtls.lib
|
||||
TARGET2=$(AXTLS_HOME)/$(STAGE)/axtls.dll
|
||||
STATIC_LIB=$(AXTLS_HOME)/$(STAGE)/axtls.static.lib
|
||||
CRYPTO_PATH=$(AXTLS_HOME)\\crypto\\
|
||||
endif
|
||||
|
||||
libs: $(TARGET1) $(TARGET2)
|
||||
|
||||
AXTLS_HOME=..
|
||||
CRYPTO_OBJ=\
|
||||
$(CRYPTO_PATH)aes.o \
|
||||
$(CRYPTO_PATH)hmac.o \
|
||||
$(CRYPTO_PATH)md5.o \
|
||||
$(CRYPTO_PATH)rc4.o \
|
||||
$(CRYPTO_PATH)sha1.o
|
||||
|
||||
OBJ=\
|
||||
../crypto/aes.o \
|
||||
asn1.o \
|
||||
x509.o \
|
||||
bigint.o \
|
||||
crypto_misc.o \
|
||||
../crypto/hmac.o \
|
||||
os_port.o \
|
||||
loader.o \
|
||||
../crypto/md5.o \
|
||||
openssl.o \
|
||||
p12.o \
|
||||
rsa.o \
|
||||
../crypto/rc4.o \
|
||||
../crypto/sha1.o \
|
||||
tls1.o \
|
||||
tls1_svr.o \
|
||||
tls1_clnt.o
|
||||
|
||||
include ../config/makefile.post
|
||||
include $(AXTLS_HOME)/config/makefile.post
|
||||
|
||||
ifndef CONFIG_PLATFORM_WIN32 # Linux/Unix/Cygwin
|
||||
|
||||
$(TARGET1) : $(OBJ)
|
||||
$(AR) -r $@ $(OBJ)
|
||||
$(AR) -r $@ $(CRYPTO_OBJ) $(OBJ)
|
||||
|
||||
$(TARGET2) : $(OBJ)
|
||||
ifndef CONFIG_PLATFORM_CYGWIN
|
||||
$(LD) $(LDFLAGS) $(LDSHARED) -Wl,-soname,$(LIBMAJOR) -o ../$(STAGE)/$(LIBMINOR) $(OBJ)
|
||||
cd ../$(STAGE); ln -sf $(LIBMINOR) $(LIBMAJOR); ln -sf $(LIBMAJOR) $(BASETARGET); cd -
|
||||
$(LD) $(LDFLAGS) $(LDSHARED) -Wl,-soname,$(LIBMAJOR) -o $(AXTLS_HOME)/$(STAGE)/$(LIBMINOR) $(CRYPTO_OBJ) $(OBJ)
|
||||
cd $(AXTLS_HOME)/$(STAGE); ln -sf $(LIBMINOR) $(LIBMAJOR); ln -sf $(LIBMAJOR) $(BASETARGET); cd -
|
||||
else
|
||||
$(LD) $(LDFLAGS) $(LDSHARED) -o ../$(STAGE)/cygaxtls.dll \
|
||||
-Wl,--out-implib=../$(STAGE)/libaxtls.dll.a \
|
||||
$(LD) $(LDFLAGS) $(LDSHARED) -o $(AXTLS_HOME)/$(STAGE)/cygaxtls.dll \
|
||||
-Wl,--out-implib=$(AXTLS_HOME)/$(STAGE)/libaxtls.dll.a \
|
||||
-Wl,--export-all-symbols \
|
||||
-Wl,--enable-auto-import $(OBJ)
|
||||
-Wl,--enable-auto-import $(CRYPTO_OBJ) $(OBJ)
|
||||
endif
|
||||
|
||||
else # Win32
|
||||
CRYPTO_OBJ:=$(CRYPTO_OBJ:.o=.obj)
|
||||
|
||||
$(TARGET1) : $(OBJ)
|
||||
$(AR) /out:$@ $(OBJ)
|
||||
$(AR) /out:$@ $(CRYPTO_OBJ) $(OBJ)
|
||||
|
||||
$(TARGET2) : $(OBJ)
|
||||
cp $(TARGET1) $(STATIC_LIB)
|
||||
$(LD) $(LDFLAGS) $(LDSHARED) /out:$@ $(OBJ)
|
||||
$(LD) $(LDFLAGS) $(LDSHARED) /out:$@ $(CRYPTO_OBJ) $(OBJ)
|
||||
|
||||
endif
|
||||
|
||||
clean::
|
||||
$(MAKE) -C test clean
|
||||
-@rm -f ../$(STAGE)/* *.a *.lib
|
||||
-@rm -f $(AXTLS_HOME)/$(STAGE)/* *.a $(TARGET1) $(TARGET2)
|
||||
|
||||
|
@ -18,8 +18,10 @@
|
||||
|
||||
all:
|
||||
|
||||
include ../../config/.config
|
||||
include ../../config/makefile.conf
|
||||
AXTLS_HOME=../..
|
||||
|
||||
include $(AXTLS_HOME)/config/.config
|
||||
include $(AXTLS_HOME)/config/makefile.conf
|
||||
|
||||
ifdef CONFIG_PERFORMANCE_TESTING
|
||||
all: performance
|
||||
@ -29,37 +31,53 @@ ifdef CONFIG_SSL_TEST
|
||||
all: ssltesting
|
||||
endif
|
||||
|
||||
ifndef CONFIG_PLATFORM_WIN32
|
||||
performance: ../../$(STAGE)/perf_bigint
|
||||
ssltesting: ../../$(STAGE)/ssltest
|
||||
LIBS=../../$(STAGE)
|
||||
CFLAGS += -I../../ssl -I../../config -I../../crypto
|
||||
include $(AXTLS_HOME)/config/makefile.post
|
||||
|
||||
../../$(STAGE)/perf_bigint: perf_bigint.o $(LIBS)/libaxtls.a
|
||||
ifndef CONFIG_PLATFORM_WIN32
|
||||
performance: $(AXTLS_HOME)/$(STAGE)/perf_bigint
|
||||
ssltesting: $(AXTLS_HOME)/$(STAGE)/ssltest
|
||||
LIBS=$(AXTLS_HOME)/$(STAGE)
|
||||
|
||||
$(AXTLS_HOME)/$(STAGE)/perf_bigint: perf_bigint.o $(LIBS)/libaxtls.a
|
||||
$(CC) $(LDFLAGS) -o $@ $^ -L $(LIBS) -laxtls
|
||||
|
||||
../../$(STAGE)/ssltest: ssltest.o $(LIBS)/libaxtls.a
|
||||
$(AXTLS_HOME)/$(STAGE)/ssltest: ssltest.o $(LIBS)/libaxtls.a
|
||||
$(CC) $(LDFLAGS) -o $@ $^ -lpthread -L $(LIBS) -laxtls
|
||||
else
|
||||
performance: ../../$(STAGE)/perf_bigint.exe
|
||||
ssltesting: ../../$(STAGE)/ssltest.exe
|
||||
CFLAGS += /I".." /I"../../config"
|
||||
performance: $(AXTLS_HOME)/$(STAGE)/perf_bigint.exe
|
||||
ssltesting: $(AXTLS_HOME)/$(STAGE)/ssltest.exe
|
||||
|
||||
%.obj : %.c
|
||||
$(CC) $(CFLAGS) $<
|
||||
CRYPTO_PATH="$(AXTLS_INCLUDE)crypto\\"
|
||||
AXTLS_SSL_PATH="$(AXTLS_INCLUDE)ssl\\"
|
||||
|
||||
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
|
||||
CRYPTO_OBJ=\
|
||||
$(CRYPTO_PATH)aes.obj \
|
||||
$(CRYPTO_PATH)hmac.obj \
|
||||
$(CRYPTO_PATH)md5.obj \
|
||||
$(CRYPTO_PATH)rc4.obj \
|
||||
$(CRYPTO_PATH)sha1.obj
|
||||
|
||||
../../$(STAGE)/perf_bigint.exe: perf_bigint.obj $(OBJLIST)
|
||||
$(LD) $(LDFLAGS) /out:$@ $^
|
||||
OBJ=\
|
||||
$(AXTLS_SSL_PATH)asn1.obj \
|
||||
$(AXTLS_SSL_PATH)x509.obj \
|
||||
$(AXTLS_SSL_PATH)bigint.obj \
|
||||
$(AXTLS_SSL_PATH)crypto_misc.obj \
|
||||
$(AXTLS_SSL_PATH)os_port.obj \
|
||||
$(AXTLS_SSL_PATH)loader.obj \
|
||||
$(AXTLS_SSL_PATH)openssl.obj \
|
||||
$(AXTLS_SSL_PATH)p12.obj \
|
||||
$(AXTLS_SSL_PATH)rsa.obj \
|
||||
$(AXTLS_SSL_PATH)tls1.obj \
|
||||
$(AXTLS_SSL_PATH)tls1_svr.obj \
|
||||
$(AXTLS_SSL_PATH)tls1_clnt.obj
|
||||
|
||||
../../$(STAGE)/ssltest.exe: ssltest.obj $(OBJLIST)
|
||||
$(LD) $(LDFLAGS) /out:$@ $^
|
||||
$(AXTLS_HOME)/$(STAGE)/perf_bigint.exe: perf_bigint.obj
|
||||
$(LD) $(LDFLAGS) /out:$@ $? $(CRYPTO_OBJ) $(OBJ)
|
||||
|
||||
$(AXTLS_HOME)/$(STAGE)/ssltest.exe: ssltest.obj
|
||||
$(LD) $(LDFLAGS) /out:$@ $? $(CRYPTO_OBJ) $(OBJ)
|
||||
endif
|
||||
|
||||
clean::
|
||||
-@rm -f ../../$(STAGE)/perf_bigint* ../../$(STAGE)/ssltest*
|
||||
-@rm -f $(AXTLS_HOME)/$(STAGE)/perf_bigint* $(AXTLS_HOME)/$(STAGE)/ssltest*
|
||||
|
||||
include ../../config/makefile.post
|
||||
|
@ -106,6 +106,8 @@ fi
|
||||
|
||||
if [ -x ./axssl.vbnet.exe ]; then
|
||||
echo "######################## VB.NET SAMPLE ###########################"
|
||||
echo $SERVER_ARGS
|
||||
echo $CLIENT_ARGS
|
||||
./axssl.vbnet $SERVER_ARGS &
|
||||
echo "VB.NET Test passed" | ./axssl.vbnet.exe $CLIENT_ARGS
|
||||
kill %1
|
||||
|
@ -88,7 +88,9 @@ int do_clnt_handshake(SSL *ssl, int handshake_type, uint8_t *buf, int hs_len)
|
||||
if ((ret = send_certificate(ssl)) == SSL_OK &&
|
||||
(ret = send_client_key_xchg(ssl)) == SSL_OK)
|
||||
{
|
||||
ret = send_cert_verify(ssl);
|
||||
ret = (ssl->chain_length == 0) ?
|
||||
SSL_ERROR_INVALID_HANDSHAKE :
|
||||
send_cert_verify(ssl);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -302,36 +302,38 @@ static int send_server_hello(SSL *ssl)
|
||||
memcpy(ssl->server_random, &buf[6], SSL_RANDOM_SIZE);
|
||||
offset = 6 + SSL_RANDOM_SIZE;
|
||||
|
||||
/* send a session id - and put it into the cache */
|
||||
buf[offset++] = SSL_SESSION_ID_SIZE;
|
||||
|
||||
#ifndef CONFIG_SSL_SKELETON_MODE
|
||||
if (IS_SET_SSL_FLAG(SSL_SESSION_RESUME))
|
||||
{
|
||||
/* retrieve id from session cache */
|
||||
buf[offset++] = SSL_SESSION_ID_SIZE;
|
||||
memcpy(&buf[offset], ssl->session->session_id, SSL_SESSION_ID_SIZE);
|
||||
memcpy(ssl->session_id, ssl->session->session_id, SSL_SESSION_ID_SIZE);
|
||||
ssl->sess_id_size = SSL_SESSION_ID_SIZE;
|
||||
offset += SSL_SESSION_ID_SIZE;
|
||||
}
|
||||
else /* generate our own session id */
|
||||
#endif
|
||||
{
|
||||
#ifndef CONFIG_SSL_SKELETON_MODE
|
||||
buf[offset++] = SSL_SESSION_ID_SIZE;
|
||||
get_random(SSL_SESSION_ID_SIZE, &buf[offset]);
|
||||
memcpy(ssl->session_id, &buf[offset], SSL_SESSION_ID_SIZE);
|
||||
ssl->sess_id_size = SSL_SESSION_ID_SIZE;
|
||||
|
||||
#ifndef CONFIG_SSL_SKELETON_MODE
|
||||
/* store id in session cache */
|
||||
if (ssl->ssl_ctx->num_sessions)
|
||||
{
|
||||
memcpy(ssl->session->session_id,
|
||||
ssl->session_id, SSL_SESSION_ID_SIZE);
|
||||
}
|
||||
|
||||
offset += SSL_SESSION_ID_SIZE;
|
||||
#else
|
||||
buf[offset++] = 0; /* don't bother with session id in skelton mode */
|
||||
#endif
|
||||
}
|
||||
|
||||
offset += SSL_SESSION_ID_SIZE;
|
||||
|
||||
buf[offset++] = 0; /* cipher we are using */
|
||||
buf[offset++] = ssl->cipher;
|
||||
buf[offset++] = 0; /* no compression */
|
||||
|
Loading…
x
Reference in New Issue
Block a user