30 if(local == NULL) local =
"";
31 if(remote == NULL) remote =
"";
34 key = (
char *) malloc(strlen(local) + strlen(remote) + 2);
36 key = (
char *)
pmalloc(p, strlen(local) + strlen(remote) + 2);
38 sprintf(key,
"%s/%s", local, remote);
45 char *klocal, *kremote;
48 klocal = strndup(rkey, rkeylen);
49 kremote = strchr(klocal,
'/');
50 if(kremote != NULL) *kremote++ =
'\0';
52 ret = (local == NULL || (klocal != NULL && !strcmp(local, klocal)))
53 && (remote == NULL || (kremote != NULL && !strcmp(remote, kremote)));
62 char hash[41], buf[1024];
64 _sx_debug(
ZONE,
"generating dialback key, secret %s, remote %s, id %s", secret, remote,
id);
68 snprintf(buf, 1024,
"%s%s", hash, remote);
71 snprintf(buf, 1024,
"%s%s", hash,
id);