浏览代码

changed .gitignore again...

FlorianPalm 11 年之前
父节点
当前提交
9798c081d1

+ 2 - 1
OPCUAServer/.cproject

@@ -72,7 +72,7 @@
 								</outputEntries>
 								</outputEntries>
 							</builder>
 							</builder>
 							<tool id="org.eclipse.linuxtools.cdt.autotools.core.gnu.toolchain.tool.configure.479495998" name="configure" superClass="org.eclipse.linuxtools.cdt.autotools.core.gnu.toolchain.tool.configure">
 							<tool id="org.eclipse.linuxtools.cdt.autotools.core.gnu.toolchain.tool.configure.479495998" name="configure" superClass="org.eclipse.linuxtools.cdt.autotools.core.gnu.toolchain.tool.configure">
-								<option id="org.eclipse.linuxtools.cdt.autotools.core.option.configure.name.1234524991" name="Name" superClass="org.eclipse.linuxtools.cdt.autotools.core.option.configure.name" value="org.eclipse.linuxtools.cdt.autotools.core.configuration.build.2007012728" valueType="string"/>
+								<option id="org.eclipse.linuxtools.cdt.autotools.core.option.configure.name.1234524991" name="Name" superClass="org.eclipse.linuxtools.cdt.autotools.core.option.configure.name" value="org.eclipse.linuxtools.cdt.autotools.core.configuration.build.2007012728.1003956089" valueType="string"/>
 							</tool>
 							</tool>
 							<tool id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.autogen.1700750022" name="autogen.sh" superClass="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.autogen"/>
 							<tool id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.autogen.1700750022" name="autogen.sh" superClass="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.autogen"/>
 							<tool id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.gcc.5042704" name="GCC C Compiler" superClass="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.gcc">
 							<tool id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.gcc.5042704" name="GCC C Compiler" superClass="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.gcc">
@@ -493,6 +493,7 @@
 			</target>
 			</target>
 			<target name="Server" path="src" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
 			<target name="Server" path="src" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
 				<buildCommand>make</buildCommand>
 				<buildCommand>make</buildCommand>
+				<buildArguments/>
 				<buildTarget>Server</buildTarget>
 				<buildTarget>Server</buildTarget>
 				<stopOnError>true</stopOnError>
 				<stopOnError>true</stopOnError>
 				<useDefaultCommand>true</useDefaultCommand>
 				<useDefaultCommand>true</useDefaultCommand>

+ 7 - 2
OPCUAServer/.gitignore

@@ -1,7 +1,8 @@
 # ignore all bin directories
 # ignore all bin directories
 # matches "bin" in any subfolder
 # matches "bin" in any subfolder
 bin/
 bin/
-
+m4
+build-test
 # ignore all target directories
 # ignore all target directories
 target/
 target/
 autom4te.cache
 autom4te.cache
@@ -11,4 +12,8 @@ src/Makefile
 tests/Makefile
 tests/Makefile
 # ignore all files ending with ~
 # ignore all files ending with ~
 *.po
 *.po
-*.o 
+*.o
+*.plo
+*.log
+*.la
+*.sub 

+ 1 - 1
OPCUAServer/config.log

@@ -4,7 +4,7 @@ running configure, to aid debugging if configure makes a mistake.
 It was created by OPCUAServer configure 1.0, which was
 It was created by OPCUAServer configure 1.0, which was
 generated by GNU Autoconf 2.68.  Invocation command line was
 generated by GNU Autoconf 2.68.  Invocation command line was
 
 
-  $ ./configure 
+  $ /home/opcua/git/opcUaStack/OPCUAServer/configure 
 
 
 ## --------- ##
 ## --------- ##
 ## Platform. ##
 ## Platform. ##

+ 2 - 2
OPCUAServer/config.status

@@ -436,7 +436,7 @@ Report bugs to the package provider."
 ac_cs_config=""
 ac_cs_config=""
 ac_cs_version="\
 ac_cs_version="\
 OPCUAServer config.status 1.0
 OPCUAServer config.status 1.0
-configured by ./configure, generated by GNU Autoconf 2.68,
+configured by /home/opcua/git/opcUaStack/OPCUAServer/configure, generated by GNU Autoconf 2.68,
   with options \"$ac_cs_config\"
   with options \"$ac_cs_config\"
 
 
 Copyright (C) 2010 Free Software Foundation, Inc.
 Copyright (C) 2010 Free Software Foundation, Inc.
@@ -514,7 +514,7 @@ if $ac_cs_silent; then
 fi
 fi
 
 
 if $ac_cs_recheck; then
 if $ac_cs_recheck; then
-  set X '/bin/bash' './configure'  $ac_configure_extra_args --no-create --no-recursion
+  set X '/bin/bash' '/home/opcua/git/opcUaStack/OPCUAServer/configure'  $ac_configure_extra_args --no-create --no-recursion
   shift
   shift
   $as_echo "running CONFIG_SHELL=/bin/bash $*" >&6
   $as_echo "running CONFIG_SHELL=/bin/bash $*" >&6
   CONFIG_SHELL='/bin/bash'
   CONFIG_SHELL='/bin/bash'

+ 170 - 1
OPCUAServer/src/.deps/opcuaServer.Po

@@ -1 +1,170 @@
-# dummy
+opcuaServer.o: opcuaServer.c /usr/include/stdio.h /usr/include/features.h \
+ /usr/include/i386-linux-gnu/bits/predefs.h \
+ /usr/include/i386-linux-gnu/sys/cdefs.h \
+ /usr/include/i386-linux-gnu/bits/wordsize.h \
+ /usr/include/i386-linux-gnu/gnu/stubs.h \
+ /usr/include/i386-linux-gnu/gnu/stubs-32.h \
+ /usr/lib/gcc/i686-linux-gnu/4.6/include/stddef.h \
+ /usr/include/i386-linux-gnu/bits/types.h \
+ /usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \
+ /usr/include/_G_config.h /usr/include/wchar.h \
+ /usr/lib/gcc/i686-linux-gnu/4.6/include/stdarg.h \
+ /usr/include/i386-linux-gnu/bits/stdio_lim.h \
+ /usr/include/i386-linux-gnu/bits/sys_errlist.h \
+ /usr/include/i386-linux-gnu/bits/stdio.h \
+ /usr/include/i386-linux-gnu/bits/stdio2.h /usr/include/stdlib.h \
+ /usr/include/i386-linux-gnu/bits/waitflags.h \
+ /usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/endian.h \
+ /usr/include/i386-linux-gnu/bits/endian.h \
+ /usr/include/i386-linux-gnu/bits/byteswap.h \
+ /usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \
+ /usr/include/i386-linux-gnu/sys/select.h \
+ /usr/include/i386-linux-gnu/bits/select.h \
+ /usr/include/i386-linux-gnu/bits/sigset.h \
+ /usr/include/i386-linux-gnu/bits/time.h \
+ /usr/include/i386-linux-gnu/bits/select2.h \
+ /usr/include/i386-linux-gnu/sys/sysmacros.h \
+ /usr/include/i386-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \
+ /usr/include/i386-linux-gnu/bits/stdlib.h opcua_binaryEncDec.h \
+ opcua_builtInDatatypes.h \
+ /usr/lib/gcc/i686-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \
+ /usr/include/i386-linux-gnu/bits/wchar.h /usr/include/string.h \
+ /usr/include/xlocale.h /usr/include/i386-linux-gnu/bits/string.h \
+ /usr/include/i386-linux-gnu/bits/string2.h \
+ /usr/include/i386-linux-gnu/bits/string3.h opcua_transportLayer.h \
+ opcua_advancedDatatypes.h opcua_connectionHelper.h opcua_types.h \
+ tcp_layer.h /usr/include/i386-linux-gnu/sys/socket.h \
+ /usr/include/i386-linux-gnu/sys/uio.h \
+ /usr/include/i386-linux-gnu/bits/uio.h \
+ /usr/include/i386-linux-gnu/bits/socket.h \
+ /usr/include/i386-linux-gnu/bits/sockaddr.h \
+ /usr/include/i386-linux-gnu/asm/socket.h \
+ /usr/include/asm-generic/socket.h \
+ /usr/include/i386-linux-gnu/asm/sockios.h \
+ /usr/include/asm-generic/sockios.h \
+ /usr/include/i386-linux-gnu/bits/socket2.h /usr/include/netinet/in.h \
+ /usr/include/i386-linux-gnu/bits/in.h
+
+/usr/include/stdio.h:
+
+/usr/include/features.h:
+
+/usr/include/i386-linux-gnu/bits/predefs.h:
+
+/usr/include/i386-linux-gnu/sys/cdefs.h:
+
+/usr/include/i386-linux-gnu/bits/wordsize.h:
+
+/usr/include/i386-linux-gnu/gnu/stubs.h:
+
+/usr/include/i386-linux-gnu/gnu/stubs-32.h:
+
+/usr/lib/gcc/i686-linux-gnu/4.6/include/stddef.h:
+
+/usr/include/i386-linux-gnu/bits/types.h:
+
+/usr/include/i386-linux-gnu/bits/typesizes.h:
+
+/usr/include/libio.h:
+
+/usr/include/_G_config.h:
+
+/usr/include/wchar.h:
+
+/usr/lib/gcc/i686-linux-gnu/4.6/include/stdarg.h:
+
+/usr/include/i386-linux-gnu/bits/stdio_lim.h:
+
+/usr/include/i386-linux-gnu/bits/sys_errlist.h:
+
+/usr/include/i386-linux-gnu/bits/stdio.h:
+
+/usr/include/i386-linux-gnu/bits/stdio2.h:
+
+/usr/include/stdlib.h:
+
+/usr/include/i386-linux-gnu/bits/waitflags.h:
+
+/usr/include/i386-linux-gnu/bits/waitstatus.h:
+
+/usr/include/endian.h:
+
+/usr/include/i386-linux-gnu/bits/endian.h:
+
+/usr/include/i386-linux-gnu/bits/byteswap.h:
+
+/usr/include/i386-linux-gnu/sys/types.h:
+
+/usr/include/time.h:
+
+/usr/include/i386-linux-gnu/sys/select.h:
+
+/usr/include/i386-linux-gnu/bits/select.h:
+
+/usr/include/i386-linux-gnu/bits/sigset.h:
+
+/usr/include/i386-linux-gnu/bits/time.h:
+
+/usr/include/i386-linux-gnu/bits/select2.h:
+
+/usr/include/i386-linux-gnu/sys/sysmacros.h:
+
+/usr/include/i386-linux-gnu/bits/pthreadtypes.h:
+
+/usr/include/alloca.h:
+
+/usr/include/i386-linux-gnu/bits/stdlib.h:
+
+opcua_binaryEncDec.h:
+
+opcua_builtInDatatypes.h:
+
+/usr/lib/gcc/i686-linux-gnu/4.6/include/stdint.h:
+
+/usr/include/stdint.h:
+
+/usr/include/i386-linux-gnu/bits/wchar.h:
+
+/usr/include/string.h:
+
+/usr/include/xlocale.h:
+
+/usr/include/i386-linux-gnu/bits/string.h:
+
+/usr/include/i386-linux-gnu/bits/string2.h:
+
+/usr/include/i386-linux-gnu/bits/string3.h:
+
+opcua_transportLayer.h:
+
+opcua_advancedDatatypes.h:
+
+opcua_connectionHelper.h:
+
+opcua_types.h:
+
+tcp_layer.h:
+
+/usr/include/i386-linux-gnu/sys/socket.h:
+
+/usr/include/i386-linux-gnu/sys/uio.h:
+
+/usr/include/i386-linux-gnu/bits/uio.h:
+
+/usr/include/i386-linux-gnu/bits/socket.h:
+
+/usr/include/i386-linux-gnu/bits/sockaddr.h:
+
+/usr/include/i386-linux-gnu/asm/socket.h:
+
+/usr/include/asm-generic/socket.h:
+
+/usr/include/i386-linux-gnu/asm/sockios.h:
+
+/usr/include/asm-generic/sockios.h:
+
+/usr/include/i386-linux-gnu/bits/socket2.h:
+
+/usr/include/netinet/in.h:
+
+/usr/include/i386-linux-gnu/bits/in.h:

+ 13 - 11
OPCUAServer/src/opcua_binaryEncDec.c

@@ -13,14 +13,14 @@
 /*
 /*
  * convert byte array to Byte
  * convert byte array to Byte
  */
  */
-Byte convertToByte(char* buf, int pos)
+Byte convertToByte(const char *buf, int pos)
 {
 {
 	return (Byte)buf[pos];
 	return (Byte)buf[pos];
 }
 }
 /*
 /*
  * convert byte array to UInt16
  * convert byte array to UInt16
  */
  */
-UInt16 convertToUInt16(char* buf, int pos)
+UInt16 convertToUInt16(const char* buf, int pos)
 {
 {
 
 
 	Byte t1 = buf[pos];
 	Byte t1 = buf[pos];
@@ -31,7 +31,7 @@ UInt16 convertToUInt16(char* buf, int pos)
 /*
 /*
  * convert byte array to Int32
  * convert byte array to Int32
  */
  */
-Int32 convertToInt32(char* buf, int pos)
+Int32 convertToInt32(const char* buf, int pos)
 {
 {
 
 
 	SByte t1 = buf[pos];
 	SByte t1 = buf[pos];
@@ -44,7 +44,7 @@ Int32 convertToInt32(char* buf, int pos)
 /*
 /*
  * convert byte array to UInt32
  * convert byte array to UInt32
  */
  */
-UInt32 convertToUInt32(char* buf, int pos)
+UInt32 convertToUInt32(const char* buf, int pos)
 {
 {
 	Byte t1 = buf[pos];
 	Byte t1 = buf[pos];
 	UInt32 t2 = (UInt32)(buf[pos+1] << 8);
 	UInt32 t2 = (UInt32)(buf[pos+1] << 8);
@@ -56,15 +56,17 @@ UInt32 convertToUInt32(char* buf, int pos)
 
 
 void convertUInt32ToByteArray(UInt32 value,char *buf,int pos)
 void convertUInt32ToByteArray(UInt32 value,char *buf,int pos)
 {
 {
-	buf[pos] = (char)(value && 0xFF);
+	memcpy(buf,&value,sizeof(value));
+	/*buf[pos] = (char)(value && 0xFF);
 	buf[pos + 1] = (char)((value >> 8) && 0xFF);
 	buf[pos + 1] = (char)((value >> 8) && 0xFF);
 	buf[pos + 2] = (char)((value >> 16) && 0xFF);
 	buf[pos + 2] = (char)((value >> 16) && 0xFF);
 	buf[pos + 3] = (char)((value >> 24) && 0xFF);
 	buf[pos + 3] = (char)((value >> 24) && 0xFF);
+	*/
 }
 }
 /*
 /*
  * convert byte array to Int64
  * convert byte array to Int64
  */
  */
-Int64 convertToInt64(char* buf, int pos)
+Int64 convertToInt64(const char* buf, int pos)
 {
 {
 
 
 	SByte t1 = buf[pos];
 	SByte t1 = buf[pos];
@@ -82,7 +84,7 @@ Int64 convertToInt64(char* buf, int pos)
 
 
 
 
 
 
-convertToUAString(char* buf, int pos,UA_String *dstUAString)
+convertToUAString(const char* buf, int pos,UA_String *dstUAString)
 {
 {
 
 
 	dstUAString->Length = convertToInt32(buf,pos);
 	dstUAString->Length = convertToInt32(buf,pos);
@@ -97,7 +99,7 @@ convertToUAString(char* buf, int pos,UA_String *dstUAString)
 	}
 	}
 }
 }
 
 
-convertToUAGuid(char* buf, int pos,UA_Guid* dstGUID)
+convertToUAGuid(const char* buf, int pos,UA_Guid* dstGUID)
 {
 {
 
 
 	int counter = 0;
 	int counter = 0;
@@ -133,7 +135,7 @@ convertToUAGuid(char* buf, int pos,UA_Guid* dstGUID)
 }
 }
 
 
 
 
-UA_ByteString convertToUAByteString(char* buf, int pos){
+UA_ByteString convertToUAByteString(const char* buf, int pos){
 	UA_ByteString tmpUAByteString;
 	UA_ByteString tmpUAByteString;
 	int counter = sizeof(Int32);
 	int counter = sizeof(Int32);
 	int i = 0;
 	int i = 0;
@@ -156,13 +158,13 @@ UA_ByteString convertToUAByteString(char* buf, int pos){
 	return tmpUAByteString;
 	return tmpUAByteString;
 }
 }
 
 
-UA_DateTime convertToUADateTime(char* buf, int pos){
+UA_DateTime convertToUADateTime(const char* buf, int pos){
 	UA_DateTime tmpUADateTime;
 	UA_DateTime tmpUADateTime;
 	tmpUADateTime = convertToInt64(buf, pos);
 	tmpUADateTime = convertToInt64(buf, pos);
 	return tmpUADateTime;
 	return tmpUADateTime;
 }
 }
 
 
-UA_StatusCode convertToUAStatusCode(char* buf, int pos){
+UA_StatusCode convertToUAStatusCode(const char* buf, int pos){
 	return convertToUInt32(buf, pos);
 	return convertToUInt32(buf, pos);
 }
 }
 
 

+ 3 - 3
OPCUAServer/src/opcua_binaryEncDec.h

@@ -13,8 +13,8 @@
 
 
 
 
 //functions
 //functions
-Byte convertToByte(char* buf, int pos);
-Int32 convertToInt32(char* buf,int pos);
-UInt32 convertToUInt32(char* buf, int pos);
+Byte convertToByte(const char* buf, int pos);
+Int32 convertToInt32(const char* buf,int pos);
+UInt32 convertToUInt32(const char* buf, int pos);
 
 
 #endif /* OPCUA_BINARYENCDEC_NEU_H_ */
 #endif /* OPCUA_BINARYENCDEC_NEU_H_ */

+ 3 - 1
OPCUAServer/src/opcua_connectionHelper.h

@@ -52,12 +52,14 @@ struct SL_connection
 	T_ApplicationInstanceCertificate clientCertificate;
 	T_ApplicationInstanceCertificate clientCertificate;
 	UInt32 requestType;
 	UInt32 requestType;
 	UA_String secureChannelId;
 	UA_String secureChannelId;
+	UInt32 UInt32_secureChannelId;
 	UInt32 securityMode;
 	UInt32 securityMode;
 	UA_String clientNonce;
 	UA_String clientNonce;
 	UA_Duration requestedLifetime; /// life time of the secure channel
 	UA_Duration requestedLifetime; /// life time of the secure channel
 	UA_DateTime requestedAt; /// Point in time in which the secure channel was requested
 	UA_DateTime requestedAt; /// Point in time in which the secure channel was requested
 	UInt32 connectionState;
 	UInt32 connectionState;
-
+	UInt32 tokenId;
+	UInt32 revisedLifetime;
 };
 };
 
 
 struct SS_connection
 struct SS_connection

+ 44 - 29
OPCUAServer/src/opcua_secureChannelLayer.c

@@ -6,15 +6,22 @@
  */
  */
 #include "opcua_secureChannelLayer.h"
 #include "opcua_secureChannelLayer.h"
 
 
-SL_getRequestHeader()
+Int32 SL_openSecureChannelRequest_check(const UA_connection *connection, secureChannelMessage)
 {
 {
 
 
 }
 }
+/*
+ * respond the securechannel_open request
+ */
+
+Int32 SL_secureChannel_respond(UA_connection *connection, SL_Response *response)
+{
 
 
+}
 /*
 /*
  * opens a secureChannel (server side)
  * opens a secureChannel (server side)
  */
  */
-void SL_secureChannel_open(const UA_connection *connection,
+Int32 SL_secureChannel_open(const UA_connection *connection,
 		const AD_RawMessage *secureChannelMessage,
 		const AD_RawMessage *secureChannelMessage,
 		const SL_SecureConversationMessageHeader *SCM_Header,
 		const SL_SecureConversationMessageHeader *SCM_Header,
 		const SL_AsymmetricAlgorithmSecurityHeader *AAS_Header)
 		const SL_AsymmetricAlgorithmSecurityHeader *AAS_Header)
@@ -23,7 +30,7 @@ void SL_secureChannel_open(const UA_connection *connection,
 	TL_send();
 	TL_send();
 	//client protocol Version
 	//client protocol Version
 
 
-connection->secureLayer.
+connection->secureLayer.secureChannelId = AAS_Header->
 //connection->secureLayer.
 //connection->secureLayer.
 }
 }
 /*
 /*
@@ -88,7 +95,8 @@ if (secureChannelMessage.length > 0)
 		//Server Handling
 		//Server Handling
 		if (openSecureChannelHeader_check(connection, secureChannelMessage))
 		if (openSecureChannelHeader_check(connection, secureChannelMessage))
 		{
 		{
-
+			//check if the request is valid
+			SL_openSecureChannelRequest_check(connection, secureChannelMessage);
 		}
 		}
 		SL_secureChannel_open(connection, serviceMessage);
 		SL_secureChannel_open(connection, serviceMessage);
 	}
 	}
@@ -110,6 +118,9 @@ if (secureChannelMessage.length > 0)
 }
 }
 
 
 }
 }
+/*
+ * get the secure channel message header
+ */
 UInt32 SL_secureChannel_SCMHeader_get(UA_connection *connection,
 UInt32 SL_secureChannel_SCMHeader_get(UA_connection *connection,
 	AD_RawMessage *rawMessage, SL_SecureConversationMessageHeader* SC_Header)
 	AD_RawMessage *rawMessage, SL_SecureConversationMessageHeader* SC_Header)
 {
 {
@@ -125,42 +136,46 @@ pos += sizeof(UInt32);
 return pos;
 return pos;
 
 
 }
 }
+/*
+ * get the asymmetric algorithm security header
+ */
 UInt32 SL_secureChannel_AASHeader_get(UA_connection *connection,
 UInt32 SL_secureChannel_AASHeader_get(UA_connection *connection,
 	AD_RawMessage *rawMessage, UInt32 pos,
 	AD_RawMessage *rawMessage, UInt32 pos,
 	SL_AsymmetricAlgorithmSecurityHeader* AAS_Header)
 	SL_AsymmetricAlgorithmSecurityHeader* AAS_Header)
 {
 {
-AAS_Header->SecurityPolicyUri.Length = convertToInt32(rawMessage, pos);
 
 
-pos += sizeof(Int32);
-AAS_Header->SecurityPolicyUri.Data = rawMessage[pos];
+	AAS_Header->SecurityPolicyUri.Length = convertToInt32(rawMessage, pos);
 
 
-if (AAS_Header->SecurityPolicyUri.Length < 0)
-{
-	AAS_Header->SecurityPolicyUri.Length = 0;
-}
-pos += AAS_Header->SecurityPolicyUri.Length;
+	pos += sizeof(Int32);
+	AAS_Header->SecurityPolicyUri.Data = rawMessage[pos];
 
 
-AAS_Header->SenderCertificate.Length = convertToInt32(rawMessage, pos);
-pos += sizeof(Int32);
-if (AAS_Header->SenderCertificate.Length < 0)
-{
-	AAS_Header->SenderCertificate.Length = 0;
-}
-AAS_Header->SenderCertificate.Data = rawMessage[pos];
+	if (AAS_Header->SecurityPolicyUri.Length < 0)
+	{
+		AAS_Header->SecurityPolicyUri.Length = 0;
+	}
+	pos += AAS_Header->SecurityPolicyUri.Length;
+
+	AAS_Header->SenderCertificate.Length = convertToInt32(rawMessage, pos);
+	pos += sizeof(Int32);
+	if (AAS_Header->SenderCertificate.Length < 0)
+	{
+		AAS_Header->SenderCertificate.Length = 0;
+	}
+	AAS_Header->SenderCertificate.Data = rawMessage[pos];
 
 
-pos += AAS_Header->SenderCertificate.Length;
+	pos += AAS_Header->SenderCertificate.Length;
 
 
-AAS_Header->ReceiverThumbprint.Length = convertToInt32(rawMessage, pos);
-pos += sizeof(Int32);
+	AAS_Header->ReceiverThumbprint.Length = convertToInt32(rawMessage, pos);
+	pos += sizeof(Int32);
 
 
-if (AAS_Header->ReceiverThumbprint.Length < 0)
-{
-	AAS_Header->ReceiverThumbprint.Length = 0;
-}
-AAS_Header->ReceiverThumbprint.Data = rawMessage[pos];
+	if (AAS_Header->ReceiverThumbprint.Length < 0)
+	{
+		AAS_Header->ReceiverThumbprint.Length = 0;
+	}
+	AAS_Header->ReceiverThumbprint.Data = rawMessage[pos];
 
 
-pos += AAS_Header->ReceiverThumbprint.Length;
-return pos;
+	pos += AAS_Header->ReceiverThumbprint.Length;
+	return pos;
 }
 }
 void SL_secureChannel_Footer_get()
 void SL_secureChannel_Footer_get()
 {
 {

+ 11 - 2
OPCUAServer/src/opcua_secureChannelLayer.h

@@ -9,10 +9,19 @@
 #define OPCUA_SECURECHANNELLAYER_H_
 #define OPCUA_SECURECHANNELLAYER_H_
 
 
 static const Int32 SL_HEADER_LENGTH = 0;
 static const Int32 SL_HEADER_LENGTH = 0;
+typedef struct _SL_SecurityToken
+{
+	UInt32 ChannelId;
+	UInt32 TokenId;
+	UA_DateTime CreatedAt;
+	Int32 RevisedLifeTime;
+}SL_SecurityToken;
 typedef struct _SL_OpenSecureChannelResponse
 typedef struct _SL_OpenSecureChannelResponse
 {
 {
-
-};
+	UInt32 ServerProtocolVersion;
+	SL_SecurityToken ChannelSecurityToken;
+	UA_String ServerNonce;
+}SL_Response;
 typedef struct _SL_SecureConversationMessageHeader
 typedef struct _SL_SecureConversationMessageHeader
 {
 {
 	UInt32 MessageType;
 	UInt32 MessageType;

+ 3 - 3
OPCUAServer/src/opcua_transportLayer.c

@@ -187,9 +187,9 @@ void TL_getMessageHeader(struct TL_header *header, AD_RawMessage *rawMessage)
 	}
 	}
 
 
 	pos = pos + TL_MESSAGE_TYPE_LEN;
 	pos = pos + TL_MESSAGE_TYPE_LEN;
-	header->Reserved = convertToByte(rawMessage,pos);
+	header->Reserved = convertToByte(rawMessage->message,pos);
 	pos = pos + TL_RESERVED_LEN;
 	pos = pos + TL_RESERVED_LEN;
-	header->MessageSize = convertToUInt32(rawMessage,pos);
+	header->MessageSize = convertToUInt32(rawMessage->message,pos);
 
 
 }
 }
 Int32 TL_getPacketType(AD_RawMessage *rawMessage)
 Int32 TL_getPacketType(AD_RawMessage *rawMessage)
@@ -300,7 +300,7 @@ void TL_processHELMessage(UA_connection *connection, AD_RawMessage *rawMessage)
 			convertToUInt32(rawMessage->message,pos);
 			convertToUInt32(rawMessage->message,pos);
 	pos = pos +  sizeof(UInt32);
 	pos = pos +  sizeof(UInt32);
 
 
-	connection->transportLayer.endpointURL.Data = (rawMessage->message[pos]);
+	connection->transportLayer.endpointURL.Data = &(rawMessage->message[pos]);
 	connection->transportLayer.endpointURL.Length = tmpHeader.MessageSize - pos;
 	connection->transportLayer.endpointURL.Length = tmpHeader.MessageSize - pos;
 }
 }
 /*
 /*