X-Git-Url: http://git.eversberg.eu/gitweb.cgi?p=lcr.git;a=blobdiff_plain;f=crypt.cpp;h=87a5dde8dd2843961d3cd4bf2ecc451682dbe1ba;hp=92f0c1020a1c18aa8527e62d985fb54ed0655f62;hb=b2a665f8f1cdeb7d02c3f665d95e6a80297e21d1;hpb=8038fd190f3c0b451c07253190ec1d7de9ea822a diff --git a/crypt.cpp b/crypt.cpp index 92f0c10..87a5dde 100644 --- a/crypt.cpp +++ b/crypt.cpp @@ -140,14 +140,10 @@ the message type is encoded as element */ -#include -#include -#include -#include +#include "main.h" #ifdef CRYPTO #include #endif -#include "main.h" /* convert key string to binary key vector @@ -210,7 +206,7 @@ unsigned char *crypt_key(unsigned char *key, int *binary_len) /* * support routine to get cpu speed */ -static unsigned long get_bogomips(void) +static unsigned int get_bogomips(void) { FILE *fp; char buffer[64], *p; @@ -248,9 +244,9 @@ static unsigned long get_bogomips(void) /* * crc 32 stuff */ -static unsigned long crc_reflect(unsigned long ref, char ch) +static unsigned int crc_reflect(unsigned int ref, char ch) { - unsigned long value = 0; + unsigned int value = 0; int i; i = 1; @@ -264,12 +260,12 @@ static unsigned long crc_reflect(unsigned long ref, char ch) return(value); } -static unsigned long crc32_table[256]; +static unsigned int crc32_table[256]; static int crc_initialized = 0; void crc_init(void) { - unsigned long ulPolynomial = 0x04c11db7; + unsigned int ulPolynomial = 0x04c11db7; int i, j; i = 0; @@ -288,9 +284,9 @@ void crc_init(void) crc_initialized = 1; } -unsigned long crc32(unsigned char *data, int len) +unsigned int crc32(unsigned char *data, int len) { - unsigned long crc = 0xffffffff; + unsigned int crc = 0xffffffff; if (!crc_initialized) FATAL("crc not initialized, exitting..."); @@ -304,7 +300,7 @@ unsigned long crc32(unsigned char *data, int len) CM_ST_NAMES /* give name of state */ -static char *statename(int state) +static const char *statename(int state) { if (state>=0 && state=0 && message=0 && msg=0 && msgp_callerinfo.id, port->p_callerinfo.ntype), &auth_pointer, &crypt_pointer, &key_pointer); + ret = parse_secrets((char *)e_ext.number, (char *)numberrize_callerinfo(port->p_callerinfo.id, port->p_callerinfo.ntype, options.national, options.international), &auth_pointer, &crypt_pointer, &key_pointer); } if (!ret) { @@ -1898,7 +1894,7 @@ void EndpointAppPBX::encrypt_shared(void) void EndpointAppPBX::encrypt_keyex(void) { struct lcr_msg *message; - char *errstr = ""; + const char *errstr = ""; class Port *port; /* redisplay current crypt display */