00001
00002
00003
00004 #ifndef _ASM_NODE_H_
00005 #define _ASM_NODE_H_
00006
00007
00008 #include <mxml.h>
00009 #ifndef _WIN32
00010 #include <netinet/in.h>
00011 #else
00012 #include <windows.h>
00013 #include <winsock.h>
00014 #endif
00015 #include "../include/macros.h"
00016 #include "../include/message.h"
00017 #include "xyssl-0.9/include/xyssl/dhm.h"
00018 #include "xyssl-0.9/include/xyssl/rsa.h"
00019 #include "xyssl-0.9/include/xyssl/aes.h"
00020 #ifndef _WIN32
00021 #include "config.h"
00022 #else
00023 #include "../winconfig.h"
00024 #endif
00025
00026 #ifdef MC_SECURITY
00027
00028 typedef enum asm_encryption_type_e
00029 {
00030 NONE,
00031 DH,
00032 NUM_ENCRYPT_METHODS
00033 } asm_encryption_type_t;
00034
00035
00036
00037
00038 typedef struct dh_data_s
00039 {
00040 dhm_context dhm;
00041 rsa_context rsa;
00042 aes_context aes;
00043 } dh_data_t;
00044 typedef dh_data_t* dh_data_p;
00045
00046
00047
00048 typedef union asm_encryption_data_u
00049 {
00050 struct dh_data_s* dh_data;
00051
00052 } asm_encryption_data_t;
00053 typedef asm_encryption_data_t* asm_encryption_data_p;
00054
00055 typedef struct asm_node_s
00056 {
00057 int id;
00058 struct sockaddr_in* remote_addr;
00059 asm_encryption_type_t type;
00060 union asm_encryption_data_u data;
00061 mxml_node_t* xml_encrypt_root;
00062 } asm_node_t;
00063 typedef asm_node_t* asm_node_p;
00064
00065 int
00066 asm_node_Destroy
00067 (
00068 asm_node_p asm_node
00069 );
00070
00071 struct mc_asm_s;
00072 asm_node_p
00073 asm_node_Initialize(message_p message, struct mc_asm_s* security_manager);
00074
00075 #endif
00076 #endif