unsigned long crc = 0xffffffff;
if (!crc_initialized)
- {
- PERROR("crc not initialized, exitting...");
- exit(-1);
- }
+ FATAL("crc not initialized, exitting...");
while (len--)
crc = (crc >> 8) ^ crc32_table[(crc & 0xFF) ^ *data++];
/* exit process */
apppbx->ea_endpoint->ep_use--;
- memset(args, 0, sizeof(struct auth_args));
- free(args);
+ FREE(args, sizeof(struct auth_args));
amemuse--;
return(NULL);
}
return;
}
- arg = (struct auth_args *)calloc(1, sizeof(struct auth_args));
- if (!arg)
- {
- PERROR("failed to alloc memory.\n");
- e_crypt_keyengine_return = -1;
- return;
- }
-
+ arg = (struct auth_args *)MALLOC(sizeof(struct auth_args));
arg->apppbx = this;
arg->job = job;
e_crypt_keyengine_return = 0;
{
struct message *message;
/* send message */
- message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_call_id, EPOINT_TO_CALL, MESSAGE_CRYPT);
+ message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_CRYPT);
message->param.crypt.type = msg;
if (!text)
text = "";
if (e_crypt != CRYPT_OFF)
{
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) encryption in progress, so we request the current message.\n", ea_endpoint->ep_serial);
- message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_call_id, EPOINT_TO_CALL, MESSAGE_CRYPT);
+ message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_CRYPT);
message->param.crypt.type = CU_INFO_REQ;
message_put(message);
return;
}
/* check the key for the call */
- if (port->p_type==PORT_TYPE_DSS1_TE_OUT || port->p_type==PORT_TYPE_DSS1_NT_OUT || port->p_type==PORT_TYPE_SIP_OUT)
- ret = parse_secrets((char *)e_ext.number, (char *)port->p_dialinginfo.number, &auth_pointer, &crypt_pointer, &key_pointer);
+ if (port->p_type==PORT_TYPE_DSS1_TE_OUT || port->p_type==PORT_TYPE_DSS1_NT_OUT)
+ ret = parse_secrets((char *)e_ext.number, (char *)port->p_dialinginfo.id, &auth_pointer, &crypt_pointer, &key_pointer);
else
{
if (!port->p_callerinfo.id[0])
// SPRINT(e_crypt_display, "Shared Key");
e_crypt = CRYPT_SWAIT;
/* sending activation */
- message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_call_id, EPOINT_TO_CALL, MESSAGE_CRYPT);
+ message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_CRYPT);
message->param.crypt.type = CU_ACTS_REQ;
message->param.crypt.len = key_len;
memcpy(message->param.crypt.data, key, key_len);
if (e_crypt != CRYPT_OFF)
{
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) encryption in progress, so we request the current message.\n", ea_endpoint->ep_serial);
- message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_call_id, EPOINT_TO_CALL, MESSAGE_CRYPT);
+ message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_CRYPT);
message->param.crypt.type = CU_INFO_REQ;
message_put(message);
return;
message_put(message);
e_crypt = CRYPT_KWAIT;
/* sending activation */
- message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_call_id, EPOINT_TO_CALL, MESSAGE_CRYPT);
+ message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_CRYPT);
message->param.crypt.type = CU_ACTK_REQ;
message_put(message);
#endif /* CRYPTO */
message_put(message);
e_crypt = CRYPT_RELEASE;
/* sending activation */
- message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_call_id, EPOINT_TO_CALL, MESSAGE_CRYPT);
+ message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_CRYPT);
message->param.crypt.type = CU_DACT_REQ;
message_put(message);
}
}
}
+