Implement Vebon SecIP encryption types RSA+AES. Needs RSA key with 257 exponent for alphatronics.

Note that the endianness is completely retarded. RSA public key transfer is little endian. Messages are big endian.
This commit is contained in:
Wilco Baan Hofman 2012-10-07 13:36:43 +02:00
parent 3fb1474113
commit fec14af688
5 changed files with 230 additions and 48 deletions

View file

@ -41,7 +41,7 @@ interface secip
typedef [public,flag(LIBNDR_FLAG_NOALIGN)] struct {
[value(0)] uint16 session_id;
uint8 rsa_key[128];
uint8 padding[75];
uint8 padding[74];
} secip_ppk_com;
typedef [public,flag(LIBNDR_FLAG_NOALIGN)] struct {
@ -51,28 +51,34 @@ interface secip
typedef [public,flag(LIBNDR_FLAG_NOALIGN)] struct {
[value(1)] uint8 protocol_version;
uint8 manufacturer[8];
uint8 manufacturer[20];
uint8 panel_type[12];
uint8 panel_version[8];
uint8 account_code[6];
uint8 crc_mode;
uint16 session_id;
secip_key_message_block key_block;
uint8 padding[137];
uint8 padding[136];
} secip_ppk_rep;
typedef [public,flag(LIBNDR_FLAG_NOALIGN)] struct {
secip_error error_code;
uint16 session_id;
uint8 padding[232];
uint8 padding[231];
} secip_arc_enc;
typedef [public,flag(LIBNDR_FLAG_NOALIGN)] struct {
uint16 path_id;
uint32 interval_seconds;
uint8 padding[70];
} secip_psup_req;
typedef [nodiscriminant,public,flag(LIBNDR_FLAG_NOALIGN)] union {
[case(SECIP_MSG_ATE_ENC)] secip_ate_enc ate_enc;
[case(SECIP_MSG_PPK_COM)] secip_ppk_com ppk_com;
[case(SECIP_MSG_PPK_REP)] secip_ppk_rep ppk_rep;
[case(SECIP_MSG_ARC_ENC)] secip_arc_enc arc_enc;
[case(SECIP_MSG_PATH_SUPERVISION_REQUEST)] secip_psup_req psup_req;
} secip_msg_union;
typedef [public,flag(LIBNDR_FLAG_NOALIGN)] struct {
@ -82,25 +88,17 @@ interface secip
uint16 sequence_number;
char device_id[16];
[switch_is(message_id)] secip_msg_union msg;
uint8 padding[30]; /* random */
} secip_packet;
typedef [public,flag(LIBNDR_FLAG_NOALIGN)] struct {
uint16 connection_id; /* 0xffff is unassigned */
secip_message message_id;
uint16 sequence_number;
char device_id[16];
[switch_is(message_id)] secip_msg_union msg;
uint8 padding[30]; /* random */
} secip_out_packet;
typedef [public,flag(LIBNDR_FLAG_NOALIGN)] struct {
uint8 raw_packet[256];
uint8 raw_packet[226];
uint8 padding[30];
[value(calculate_crc(raw_packet, 256))] uint16 crc;
} secip_setup_packet;
typedef [public,flag(LIBNDR_FLAG_NOALIGN)] struct {
uint8 raw_packet[128];
uint8 raw_packet[98];
uint8 padding[30];
[value(calculate_crc(raw_packet, 128))] uint16 crc;
} secip_comm_packet;
};