* in network byte order.
*/
- if (result = gen_recv(sock, buf1, sizeof buf1)) {
+ if ((result = gen_recv(sock, buf1, sizeof buf1)) != 0) {
return result;
}
strncpy(srvinst, truename, (sizeof srvinst)-1);
srvinst[(sizeof srvinst)-1] = '\0';
for (p = srvinst; *p; p++) {
- if (isupper(*p)) {
- *p = tolower(*p);
+ if (isupper((unsigned char)*p)) {
+ *p = tolower((unsigned char)*p);
}
}
strncpy(srvrealm, (char *)krb_realmofhost(srvinst), (sizeof srvrealm)-1);
srvrealm[(sizeof srvrealm)-1] = '\0';
- if (p = strchr(srvinst, '.')) {
+ if ((p = strchr(srvinst, '.')) != NULL) {
*p = '\0';
}
memcpy(session, credentials.session, sizeof session);
memset(&credentials, 0, sizeof credentials);
- des_key_sched(session, schedule);
+ des_key_sched(&session, schedule);
result = krb_get_tf_fullname(TKT_FILE, tktuser, tktinst, tktrealm);
if (result) {
report(stderr,
GT_("non-null instance (%s) might cause strange behavior\n"),
tktinst);
- strcat(tktuser, ".");
- strcat(tktuser, tktinst);
+ strlcat(tktuser, ".", sizeof(tktuser));
+ strlcat(tktuser, tktinst, sizeof(tktuser));
}
if (strcmp(tktrealm, srvrealm) != 0) {
- strcat(tktuser, "@");
- strcat(tktuser, tktrealm);
+ strlcat(tktuser, "@", sizeof(tktuser));
+ strlcat(tktuser, tktrealm, sizeof(tktuser));
}
result = krb_mk_req(&authenticator, "imap", srvinst, srvrealm,
* checksum it previously sent.
*/
- if (result = gen_recv(sock, buf1, sizeof buf1))
+ if ((result = gen_recv(sock, buf1, sizeof buf1)) != 0)
return result;
/* The client must construct data with the first four octets
* process is complete.
*/
- len = from64tobits(buf2, buf1, sizeof(buf2x));
+ len = from64tobits(buf2, buf1, sizeof(buf2));
if (len < 0) {
report(stderr, GT_("could not decode BASE64 ready response\n"));
return PS_AUTHFAIL;
des_ecb_encrypt((des_cblock *)buf2, (des_cblock *)buf2, schedule, 0);
memcpy(challenge2.cstr, buf2, 4);
- if (ntohl(challenge2.cint) != challenge1.cint + 1) {
+ if ((int32)ntohl(challenge2.cint) != challenge1.cint + 1) {
report(stderr, GT_("challenge mismatch\n"));
return PS_AUTHFAIL;
}
authenticator.dat[4] = 1;
len = strlen(tktuser);
- strncpy(authenticator.dat+8, tktuser, len);
+ strncpy((char *)authenticator.dat+8, tktuser, len);
authenticator.length = len + 8 + 1;
while (authenticator.length & 7) {
authenticator.length++;
}
- des_pcbc_encrypt((des_cblock *)authenticator.dat,
- (des_cblock *)authenticator.dat, authenticator.length, schedule,
+ des_pcbc_encrypt((const unsigned char *)authenticator.dat,
+ (unsigned char *)authenticator.dat, authenticator.length, schedule,
&session, 1);
to64frombits(buf1, authenticator.dat, authenticator.length);