static struct module *module_list=NULL;
static int modlistver = 0;
-static char expected_key[] =
+static unsigned char expected_key[] =
{ 0x8e, 0x93, 0x22, 0x83, 0xf5, 0xc3, 0xc0, 0x75,
0xff, 0x8b, 0xa9, 0xbe, 0x7c, 0x43, 0x74, 0x63 };
return 0;
}
-static int key_matches(char *key1, char *key2)
+static int key_matches(unsigned char *key1, unsigned char *key2)
{
int match = 1;
int x;
return match;
}
-static int verify_key(char *key)
+static int verify_key(unsigned char *key)
{
struct MD5Context c;
- char digest[16];
+ unsigned char digest[16];
MD5Init(&c);
- MD5Update(&c, key, strlen(key));
+ MD5Update(&c, key, strlen((char *)key));
MD5Final(digest, &c);
if (key_matches(expected_key, digest))
return 0;
#ifdef RTLD_GLOBAL
char *val;
#endif
- char *key;
+ unsigned char *key;
char tmp[80];
if (strncasecmp(resource_name, "res_", 4)) {
if (m->reload == NULL)
m->reload = dlsym(m->lib, "_reload");
- if (!m->key || !(key = m->key())) {
+ if (!m->key || !(key = (unsigned char *) m->key())) {
ast_log(LOG_WARNING, "Key routine returned NULL in module %s\n", fn);
key = NULL;
errors++;
struct MD5Context md5;
unsigned char digest[16];
MD5Init(&md5);
- MD5Update(&md5, s->challenge, strlen(s->challenge));
- MD5Update(&md5, password, strlen(password));
+ MD5Update(&md5, (unsigned char *) s->challenge, strlen(s->challenge));
+ MD5Update(&md5, (unsigned char *) password, strlen(password));
MD5Final(digest, &md5);
for (x=0;x<16;x++)
len += sprintf(md5key + len, "%2.2x", digest[x]);
int ktype = 0;
char *c = NULL;
char ffname[256];
- char digest[16];
+ unsigned char digest[16];
FILE *f;
struct MD5Context md5;
struct ast_key *key;
memset(buf, 0, 256);
fgets(buf, sizeof(buf), f);
if (!feof(f)) {
- MD5Update(&md5, buf, strlen(buf));
+ MD5Update(&md5, (unsigned char *) buf, strlen(buf));
}
}
MD5Final(digest, &md5);
int ast_sign_bin(struct ast_key *key, char *msg, int msglen, unsigned char *dsig)
{
unsigned char digest[20];
- int siglen = 128;
+ unsigned int siglen = 128;
int res;
if (key->ktype != AST_KEY_PRIVATE) {