diff options
author | Karl Ramm <kcr@mit.edu> | 2009-03-02 03:14:23 +0000 |
---|---|---|
committer | Karl Ramm <kcr@mit.edu> | 2009-03-02 03:14:23 +0000 |
commit | 2e7ac9926a7acb502c3887a4a01f9b17ff1f857d (patch) | |
tree | 2bf4fa7a1e8e1be8945a317620257a0b292404b3 | |
parent | 5a4eb277e3f77610b67c13ee05ab4715f018b93b (diff) |
build everything successfully with -Wall -Werror
-rw-r--r-- | lib/ZCkAuth.c | 8 | ||||
-rw-r--r-- | lib/ZMkAuth.c | 11 | ||||
-rw-r--r-- | server/bdump.c | 17 | ||||
-rw-r--r-- | server/kstuff.c | 11 | ||||
-rw-r--r-- | server/realm.c | 2 | ||||
-rw-r--r-- | server/subscr.c | 3 | ||||
-rw-r--r-- | server/zserver.h | 2 | ||||
-rw-r--r-- | server/zstring.c | 8 |
8 files changed, 35 insertions, 27 deletions
diff --git a/lib/ZCkAuth.c b/lib/ZCkAuth.c index 94de793..6646db4 100644 --- a/lib/ZCkAuth.c +++ b/lib/ZCkAuth.c @@ -52,10 +52,12 @@ ZCheckAuthentication(ZNotice_t *notice, session = (C_Block *)cred.session; - our_checksum = des_quad_cksum(notice->z_packet, NULL, + our_checksum = des_quad_cksum((unsigned char *)notice->z_packet, + NULL, notice->z_default_format+ - strlen(notice->z_default_format)+1- - notice->z_packet, 0, session); + strlen(notice->z_default_format) + 1 + - notice->z_packet, + 0, session); /* if mismatched checksum, then the packet was corrupted */ return ((our_checksum == notice->z_checksum) ? ZAUTH_YES : ZAUTH_FAILED); diff --git a/lib/ZMkAuth.c b/lib/ZMkAuth.c index 121f813..ee9e7e2 100644 --- a/lib/ZMkAuth.c +++ b/lib/ZMkAuth.c @@ -41,7 +41,6 @@ ZMakeAuthentication(register ZNotice_t *notice, #else #ifdef HAVE_KRB4 int result; - time_t now; KTEXT_ST authent; char *cstart, *cend; ZChecksum_t checksum; @@ -80,10 +79,10 @@ ZMakeAuthentication(register ZNotice_t *notice, return(result); /* Compute a checksum over the header and message. */ - checksum = des_quad_cksum(buffer, NULL, cstart - buffer, 0, session); - checksum ^= des_quad_cksum(cend, NULL, buffer + *len - cend, 0, + checksum = des_quad_cksum((unsigned char *)buffer, NULL, cstart - buffer, 0, session); + checksum ^= des_quad_cksum((unsigned char *)cend, NULL, buffer + *len - cend, 0, session); - checksum ^= des_quad_cksum(notice->z_message, NULL, notice->z_message_len, + checksum ^= des_quad_cksum((unsigned char *)notice->z_message, NULL, notice->z_message_len, 0, session); notice->z_checksum = checksum; ZMakeAscii32(cstart, buffer + buffer_len - cstart, checksum); @@ -193,7 +192,9 @@ ZMakeZcodeRealmAuthentication(register ZNotice_t *notice, *phdr_len += phdr_adj; return (result); -#endif /* HAVE_KRB5 */ +#else /* HAVE_KRB5 */ + return ZERR_INTERNAL; +#endif } #ifdef HAVE_KRB5 diff --git a/server/bdump.c b/server/bdump.c index 1dd2108..da67d62 100644 --- a/server/bdump.c +++ b/server/bdump.c @@ -102,7 +102,7 @@ static int setup_file_pointers(void); static void shutdown_file_pointers(void); static void cleanup(Server *server); -#if defined(HAVE_KRB4) || defined(HAVE_KRB5) +#ifdef HAVE_KRB5 static int des_service_decrypt(unsigned char *in, unsigned char *out); #endif #ifdef HAVE_KRB5 @@ -1026,8 +1026,8 @@ get_tgt(void) dest_tkt(); - retval = krb_get_svc_in_tkt(SERVER_SERVICE, buf, ZGetRealm(), - "krbtgt", ZGetRealm(), + retval = krb_get_svc_in_tkt(SERVER_SERVICE, buf, (char *)ZGetRealm(), + "krbtgt", (char *)ZGetRealm(), TKTLIFETIME, srvtab_file); if (retval != KSUCCESS) { syslog(LOG_ERR,"get_tgt: krb_get_svc_in_tkt: %s", @@ -1039,7 +1039,7 @@ get_tgt(void) } retval = read_service_key(SERVER_SERVICE, SERVER_INSTANCE, - ZGetRealm(), 0 /*kvno*/, + (char *)ZGetRealm(), 0 /*kvno*/, srvtab_file, (char *)serv_key); if (retval != KSUCCESS) { syslog(LOG_ERR, "get_tgt: read_service_key: %s", @@ -1333,8 +1333,9 @@ bdump_recv_loop(Server *server) syslog(LOG_ERR,"brl bad cblk read: %s (%s)", error_message(retval), cp); } else { - des_ecb_encrypt(cblock, client->session_key, serv_ksched.s, - DES_DECRYPT); + des_ecb_encrypt((des_cblock *)cblock, + (des_cblock *)client->session_key, + serv_ksched.s, DES_DECRYPT); } } #endif /* HAVE_KRB4 */ @@ -1670,8 +1671,8 @@ setup_file_pointers (void) #ifdef HAVE_KRB5 static int des_service_decrypt(unsigned char *in, unsigned char *out) { #ifndef HAVE_KRB4 - krb5_data dout; #ifdef HAS_KRB5_C_DECRYPT + krb5_data dout; krb5_enc_data din; dout.length = 8; @@ -1705,7 +1706,7 @@ static int des_service_decrypt(unsigned char *in, unsigned char *out) { #endif #else des_ecb_encrypt((C_Block *)in, (C_Block *)out, serv_ksched.s, DES_DECRYPT); - return 0; /* sigh */ #endif + return 0; /* sigh */ } #endif diff --git a/server/kstuff.c b/server/kstuff.c index a157288..0a9f6f7 100644 --- a/server/kstuff.c +++ b/server/kstuff.c @@ -20,12 +20,13 @@ static const char rcsid_kstuff_c[] = "$Id$"; #endif #endif -#ifdef HAVE_KRB4 - +#if defined(HAVE_KRB4) && defined(HAVE_KRB5) static ZChecksum_t compute_checksum(ZNotice_t *, C_Block); static ZChecksum_t compute_rlm_checksum(ZNotice_t *, C_Block); static Code_t ZCheckAuthentication4(ZNotice_t *notice, struct sockaddr_in *from); +#endif +#ifdef HAVE_KRB4 /* * GetKerberosData * @@ -105,7 +106,7 @@ SendKerberosData(int fd, /* file descriptor to write onto */ int written; int size_to_write; - rem = krb_mk_req(ticket, service, host, ZGetRealm(), (u_long) 0); + rem = krb_mk_req(ticket, service, host, (char *)ZGetRealm(), (u_long) 0); if (rem != KSUCCESS) return rem + krb_err_base; @@ -811,7 +812,7 @@ ZCheckAuthentication(ZNotice_t *notice, #undef KRB5AUTHENT -#ifdef HAVE_KRB4 +#if defined(HAVE_KRB4) && defined(HAVE_KRB5) static Code_t ZCheckAuthentication4(ZNotice_t *notice, struct sockaddr_in *from) @@ -865,7 +866,7 @@ ZCheckAuthentication4(ZNotice_t *notice, #endif -#ifdef HAVE_KRB4 +#if defined(HAVE_KRB4) && defined(HAVE_KRB5) static ZChecksum_t compute_checksum(ZNotice_t *notice, C_Block session_key) diff --git a/server/realm.c b/server/realm.c index 110125e..297c1f4 100644 --- a/server/realm.c +++ b/server/realm.c @@ -61,7 +61,9 @@ int nrealms = 0; /* number of other realms */ * */ static void realm_sendit(ZNotice_t *notice, struct sockaddr_in *who, int auth, ZRealm *realm, int ack_to_sender); +#ifdef HAVE_KRB5 static Code_t realm_sendit_auth(ZNotice_t *notice, struct sockaddr_in *who, int auth, ZRealm *realm, int ack_to_sender); +#endif static void rlm_ack(ZNotice_t *notice, Unacked *nacked); static void rlm_nack_cancel(ZNotice_t *notice, struct sockaddr_in *who); static void rlm_rexmit(void *arg); diff --git a/server/subscr.c b/server/subscr.c index 41384ee..c4fe16f 100644 --- a/server/subscr.c +++ b/server/subscr.c @@ -820,7 +820,8 @@ subscr_send_subs(Client *client) #endif /* HAVE_KRB4 */ #else /* HAVE_KRB5 */ #ifdef HAVE_KRB4 - des_ecb_encrypt(client->session_key, cblock, serv_ksched.s, DES_ENCRYPT); + des_ecb_encrypt((des_cblock *)client->session_key, (des_cblock *)cblock, + serv_ksched.s, DES_ENCRYPT); retval = ZMakeAscii(buf, sizeof(buf), cblock, sizeof(C_Block)); #endif /* HAVE_KRB4 */ diff --git a/server/zserver.h b/server/zserver.h index 2c3085b..b61740b 100644 --- a/server/zserver.h +++ b/server/zserver.h @@ -297,10 +297,10 @@ Code_t xmit_frag(ZNotice_t *notice, char *buf, int len, int waitforack); void hostm_shutdown(void); /* found in kstuff.c */ +Code_t ZCheckRealmAuthentication(ZNotice_t *, struct sockaddr_in *, char *); #if defined(HAVE_KRB4) || defined(HAVE_KRB5) Code_t ReadKerberosData(int, int *, char **, int *); void sweep_ticket_hash_table(void *); -Code_t ZCheckRealmAuthentication(ZNotice_t *, struct sockaddr_in *, char *); #endif #ifdef HAVE_KRB4 int GetKerberosData (int, struct in_addr, AUTH_DAT *, char *, char *); diff --git a/server/zstring.c b/server/zstring.c index 3807d18..de9e2fa 100644 --- a/server/zstring.c +++ b/server/zstring.c @@ -27,7 +27,7 @@ int valid_utf8_p(const char* s) int len; ssize_t uc; - while (len = utf8proc_iterate(s, -1, &uc)) { + while ((len = utf8proc_iterate((const unsigned char *)s, -1, &uc))) { if (len <=0) return 0; /* Not valid UTF-8 encoding. */ if (!(utf8proc_codepoint_valid(uc))) return 0; /* Not valid unicode codepoint. */ if (uc == 0) return 1; /* NULL, we're done. */ @@ -44,7 +44,7 @@ static char *zdowncase(const char* s) /* Use utf8proc if we're dealing with UTF-8. * Rather than downcase, casefold and normalize to NFKC. */ - utf8proc_map(s, 0, &new_s, + utf8proc_map((const unsigned char *)s, 0, (unsigned char **)&new_s, UTF8PROC_NULLTERM | UTF8PROC_STABLE | UTF8PROC_CASEFOLD | UTF8PROC_COMPAT | UTF8PROC_COMPOSE); @@ -65,7 +65,7 @@ String * make_string(char *s, int downcase) { - char *new_s,*p; + char *new_s; String *new_z,*hp; int i; @@ -131,7 +131,7 @@ String * find_string(char *s, int downcase) { - char *new_s,*p; + char *new_s; String *z; if (downcase) { |