*/
#ifndef lint
-static char rcsid_ZCheckAuthentication_c[] =
+static const char rcsid_ZCheckAuthentication_c[] =
"$Zephyr: /mit/zephyr/src/lib/RCS/ZCheckAuthentication.c,v 1.14 89/03/24 14:17:38 jtkohl Exp Locker: raeburn $";
#endif
/* if mismatched checksum, then the packet was corrupted */
return ((our_checksum == notice->z_checksum) ? ZAUTH_YES : ZAUTH_FAILED);
#else
- ZCheckZcodeAuthentication(notice, from);
+ return ZCheckZcodeAuthentication(notice, from);
#endif
}
/* $Header$ */
#ifndef lint
-static char rcsid_ZCheckAuthentication_c[] =
+static const char rcsid_ZCheckAuthentication_c[] =
"$Zephyr: /mit/zephyr/src/lib/RCS/ZCheckAuthentication.c,v 1.14 89/03/24 14:17:38 jtkohl Exp Locker: raeburn $";
#endif
krb5_data cksumbuf;
int valid;
char *cksum0_base, *cksum1_base, *cksum2_base;
- char *svcinst, *x, *y;
- char *asn1_data, *key_data;
+ char *x;
+ unsigned char *asn1_data, *key_data;
int asn1_len, key_len, cksum0_len, cksum1_len, cksum2_len;
result = ZGetCreds(&creds);
ZChecksum_t our_checksum;
- our_checksum = des_quad_cksum(cksum0_base, NULL, cksum0_len, 0,
+ our_checksum = des_quad_cksum((unsigned char *)cksum0_base, NULL, cksum0_len, 0,
key_data);
if (our_checksum == notice->z_checksum) {
krb5_free_creds(Z_krb5_ctx, creds);
return ZAUTH_FAILED;
}
/* HOLDING: creds, asn1_data, cksumbuf.data */
- result = ZReadZcode(notice->z_ascii_checksum,
+ result = ZReadZcode((unsigned char *)notice->z_ascii_checksum,
asn1_data, asn1_len, &asn1_len);
if (result != ZERR_NONE) {
krb5_free_creds(Z_krb5_ctx, creds);
*/
#ifndef lint
-static char rcsid_ZCompareUID_c[] = "$Id$";
+static const char rcsid_ZCompareUID_c[] = "$Id$";
#endif
#include <internal.h>
*/
#ifndef lint
-static char rcsid_ZCompareUIDPred_c[] = "$Id$";
+static const char rcsid_ZCompareUIDPred_c[] = "$Id$";
#endif
#include <internal.h>
*/
#ifndef lint
-static char rcsid_ZFlushLocations_c[] = "$Id$";
+static const char rcsid_ZFlushLocations_c[] = "$Id$";
#endif
#include <internal.h>
*/
#ifndef lint
-static char rcsid_ZFormatAuthenticNotice_c[] = "$Id$";
+static const char rcsid_ZFormatAuthenticNotice_c[] = "$Id$";
#endif
#include <internal.h>
#if defined(HAVE_KRB4) || defined(HAVE_KRB5)
Code_t
ZFormatAuthenticNotice(ZNotice_t *notice,
- register char *buffer,
- register int buffer_len,
+ char *buffer,
+ int buffer_len,
int *len,
C_Block session)
{
newnotice.z_checksum = 0;
#else
newnotice.z_checksum =
- (ZChecksum_t)des_quad_cksum(buffer, NULL, ptr - buffer, 0, session);
+ (ZChecksum_t)des_quad_cksum((unsigned char *)buffer, NULL, ptr - buffer, 0, session);
#endif
if ((retval = Z_FormatRawHeader(&newnotice, buffer, buffer_len,
&hdrlen, NULL, NULL)) != ZERR_NONE)
int retval, hdrlen, hdr_adj;
krb5_enctype enctype;
krb5_cksumtype cksumtype;
- int valid;
- char *svcinst, *x, *y;
int key_len;
char *cksum_start, *cstart, *cend;
int cksum_len;
*/
#ifndef lint
-static char rcsid_ZFormatNotice_c[] = "$Id$";
+static const char rcsid_ZFormatNotice_c[] = "$Id$";
#endif
#include <internal.h>
*/
#ifndef lint
-static char rcsid_ZFormatRawNotice_c[] = "$Id$";
+static const char rcsid_ZFormatRawNotice_c[] = "$Id$";
#endif
#include <internal.h>
*/
#ifndef lint
-static char rcsid_ZFormatRawNoticeList_c[] = "$Id$";
+static const char rcsid_ZFormatRawNoticeList_c[] = "$Id$";
#endif
#include <internal.h>
*/
#ifndef lint
-static char rcsid_ZFormatRawNoticeList_c[] = "$Id$";
+static const char rcsid_ZFormatRawNoticeList_c[] = "$Id$";
#endif
#include <internal.h>
*/
#ifndef lint
-static char rcsid_ZFormatRawNotice_c[] = "$Id$";
+static const char rcsid_ZFormatRawNotice_c[] = "$Id$";
#endif
#include <internal.h>
*/
#ifndef lint
-static char rcsid_ZFreeNotice_c[] = "$Id$";
+static const char rcsid_ZFreeNotice_c[] = "$Id$";
#endif
#include <internal.h>
*/
#ifndef lint
-static char rcsid_ZGetLocations_c[] = "$Id$";
+static const char rcsid_ZGetLocations_c[] = "$Id$";
#endif
#include <internal.h>
krb5_principal principal;
char *prname;
int result;
- char pname[ANAME_SZ], pinst[INST_SZ], prealm[REALM_SZ]; /*XXX*/
#else
#ifdef HAVE_KRB4
char pname[ANAME_SZ], pinst[INST_SZ], prealm[REALM_SZ];
*/
#ifndef lint
-static char rcsid_ZGetSubscriptions_c[] = "$Id$";
+static const char rcsid_ZGetSubscriptions_c[] = "$Id$";
#endif
#include <internal.h>
*/
#ifndef lint
-static char rcsid_ZGetWGPort_c[] = "$Id$";
+static const char rcsid_ZGetWGPort_c[] = "$Id$";
#endif
#include <internal.h>
*/
#ifndef lint
-static char rcsid_ZInitialize_c[] =
+static const char rcsid_ZInitialize_c[] =
"$Zephyr: /afs/athena.mit.edu/astaff/project/zephyr/src/lib/RCS/ZInitialize.c,v 1.17 89/05/30 18:11:25 jtkohl Exp $";
#endif
char addr[4], hostname[MAXHOSTNAMELEN];
struct in_addr servaddr;
struct sockaddr_in sin;
- int s, sinsize = sizeof(sin);
+ unsigned int s, sinsize = sizeof(sin);
Code_t code;
ZNotice_t notice;
#ifdef HAVE_KRB5
*/
#ifndef lint
-static char rcsid_ZLocations_c[] =
+static const char rcsid_ZLocations_c[] =
"$Zephyr: /afs/athena.mit.edu/astaff/project/zephyr/src/lib/RCS/ZLocations.c,v 1.30 90/12/20 03:04:39 raeburn Exp $";
#endif
time_t ourtime;
ZNotice_t notice, retnotice;
char *bptr[3];
- struct hostent *hent;
short wg_port = ZGetWGPort();
if (!location_info_set)
*
* Copyright (c) 1987 by the Massachusetts Institute of Technology.
* For copying and distribution information, see the file
- * "mit-copyright.h".
+ * "mit-copyright.h".
*/
#include <internal.h>
CREDENTIALS cred;
C_Block *session;
- result = krb_mk_req(&authent, SERVER_SERVICE,
+ result = krb_mk_req(&authent, SERVER_SERVICE,
SERVER_INSTANCE, __Zephyr_realm, 0);
if (result != MK_AP_OK)
return (result+krb_err_base);
/* zero length authent is an error, so malloc(0) is not a problem */
if (!notice->z_ascii_authent)
return (ENOMEM);
- if ((result = ZMakeAscii(notice->z_ascii_authent,
- authent.length*3,
- authent.dat,
+ if ((result = ZMakeAscii(notice->z_ascii_authent,
+ authent.length*3,
+ authent.dat,
authent.length)) != ZERR_NONE) {
free(notice->z_ascii_authent);
return (result);
ZMakeZcodeRealmAuthentication(register ZNotice_t *notice,
char *buffer,
int buffer_len,
- int *phdr_len,
+ int *phdr_len,
char *realm)
{
#ifdef HAVE_KRB5
krb5_error_code result;
krb5_creds *creds;
krb5_keyblock *keyblock;
- krb5_enctype enctype;
- krb5_cksumtype cksumtype;
krb5_auth_context authctx;
krb5_data *authent;
- char *svcinst, *x, *y;
- char *cksum_start, *cstart, *cend, *asn1_data;
- int i, cksum_len, zcode_len, asn1_len, phdr_adj;
-
+ char *cksum_start, *cstart, *cend;
+ int cksum_len, zcode_len, phdr_adj;
+
result = ZGetCredsRealm(&creds, realm);
if (result)
return result;
/* HOLDING: creds */
-
+
/* Figure out what checksum type to use */
keyblock = Z_credskey(creds);
/* HOLDING: creds */
-
+
/* Create the authenticator */
result = krb5_auth_con_init(Z_krb5_ctx, &authctx);
if (result) {
krb5_free_creds(Z_krb5_ctx, creds);
return (result);
}
-
+
authent = (krb5_data *)malloc(sizeof(krb5_data));
/* HOLDING: creds, authctx */
return (result);
}
/* HOLDING: creds, authent */
-
+
/* Encode the authenticator */
notice->z_auth = 1;
notice->z_authent_len = authent->length;
return (ENOMEM);
}
/* HOLDING: creds, authent, notice->z_ascii_authent */
- result = ZMakeZcode(notice->z_ascii_authent, zcode_len,
- authent->data, authent->length);
+ result = ZMakeZcode(notice->z_ascii_authent, zcode_len,
+ (unsigned char *)authent->data, authent->length);
krb5_free_data(Z_krb5_ctx, authent);
if (result) {
free(notice->z_ascii_authent);
return (result);
}
/* HOLDING: creds, notice->z_ascii_authent */
-
+
/* format the notice header, with a zero checksum */
result = Z_NewFormatRawHeader(notice, buffer, buffer_len, phdr_len,
&cksum_start, &cksum_len, &cstart, &cend);
krb5_creds creds_in;
krb5_ccache ccache; /* XXX make this a global or static?*/
int result;
-
+
result = krb5_cc_default(Z_krb5_ctx, &ccache);
if (result)
return result;
krb5_cc_close(Z_krb5_ctx, ccache);
return result;
}
-
+
result = krb5_cc_get_principal(Z_krb5_ctx, ccache, &creds_in.client);
if (result) {
krb5_free_cred_contents(Z_krb5_ctx, &creds_in); /* I also hope this is ok */
krb5_cc_close(Z_krb5_ctx, ccache);
return result;
}
-
-#ifdef HAVE_KRB5_CREDS_KEYBLOCK_ENCTYPE
+
+#ifdef HAVE_KRB5_CREDS_KEYBLOCK_ENCTYPE
creds_in.keyblock.enctype = ENCTYPE_DES_CBC_CRC; /* XXX? */
#else
creds_in.session.keytype = KEYTYPE_DES; /* XXX? */
#endif
-
+
result = krb5_get_credentials(Z_krb5_ctx, 0, ccache, &creds_in, creds_out);
krb5_cc_close(Z_krb5_ctx, ccache);
krb5_free_cred_contents(Z_krb5_ctx, &creds_in); /* I also hope this is ok */
*/
#ifndef lint
-static char rcsid_ZOpenPort_c[] = "$Id$";
+static const char rcsid_ZOpenPort_c[] = "$Id$";
#endif
#include <internal.h>
ZOpenPort(u_short *port)
{
struct sockaddr_in bindin;
- int len;
+ unsigned int len;
(void) ZClosePort();
*/
#ifndef lint
-static char rcsid_ZParseNotice_c[] =
+static const char rcsid_ZParseNotice_c[] =
"$Zephyr: /mit/zephyr/src/lib/RCS/ZParseNotice.c,v 1.22 91/03/29 03:34:46 raeburn Exp $";
#endif
*/
#ifndef lint
-static char rcsid_ZPeekIfNotice_c[] = "$Id$";
+static const char rcsid_ZPeekIfNotice_c[] = "$Id$";
#endif
#include <internal.h>
*/
#ifndef lint
-static char rcsid_ZPeekNotice_c[] = "$Id$";
+static const char rcsid_ZPeekNotice_c[] = "$Id$";
#endif
#include <internal.h>
*/
#ifndef lint
-static char rcsid_ZPeekPacket_c[] = "$Id$";
+static const char rcsid_ZPeekPacket_c[] = "$Id$";
#endif
#include <internal.h>
*/
#ifndef lint
-static char rcsid_ZPending_c[] = "$Id$";
+static const char rcsid_ZPending_c[] = "$Id$";
#endif
#include <internal.h>
*/
#ifndef lint
-static char rcsid_ZReadAscii_c[] = "$Id$";
+static const char rcsid_ZReadAscii_c[] = "$Id$";
#endif /* lint */
#include <internal.h>
*/
#ifndef lint
-static char rcsid_ZReadZcode_c[] = "$Id$";
+static const char rcsid_ZReadZcode_c[] = "$Id$";
#endif /* lint */
#include <internal.h>
*/
#ifndef lint
-static char rcsid_ZReceiveNotice_c[] = "$Id$";
+static const char rcsid_ZReceiveNotice_c[] = "$Id$";
#endif
#include <internal.h>
*/
#ifndef lint
-static char rcsid_ZReceivePacket_c[] = "$Id$";
+static const char rcsid_ZReceivePacket_c[] = "$Id$";
#endif
#include <internal.h>
*/
#ifndef lint
-static char rcsid_ZSendList_c[] = "$Id$";
+static const char rcsid_ZSendList_c[] = "$Id$";
#endif
#include <internal.h>
*/
#ifndef lint
-static char rcsid_ZSendNotice_c[] = "$Id$";
+static const char rcsid_ZSendNotice_c[] = "$Id$";
#endif
#include <internal.h>
*/
#ifndef lint
-static char rcsid_ZSendPacket_c[] =
+static const char rcsid_ZSendPacket_c[] =
"$Zephyr: /mit/zephyr/src/lib/RCS/ZSendPacket.c,v 1.29 91/03/21 11:57:08 raeburn Exp $";
#endif
*/
#ifndef lint
-static char rcsid_ZSendRawList_c[] = "$Id$";
+static const char rcsid_ZSendRawList_c[] = "$Id$";
#endif
#include <internal.h>
*/
#ifndef lint
-static char rcsid_ZSendRawNotice_c[] = "$Id$";
+static const char rcsid_ZSendRawNotice_c[] = "$Id$";
#endif
#include <internal.h>
*/
#ifndef lint
-static char rcsid_ZSetDestAddr_c[] = "$Id$";
+static const char rcsid_ZSetDestAddr_c[] = "$Id$";
#endif
#include <internal.h>
*/
#ifndef lint
-static char rcsid_ZSetFD_c[] = "$Id$";
+static const char rcsid_ZSetFD_c[] = "$Id$";
#endif
#include <internal.h>
*/
#ifndef lint
-static char rcsid_ZSetServerState_c[] = "$Id$";
+static const char rcsid_ZSetServerState_c[] = "$Id$";
#endif
#include <internal.h>
*/
#ifndef lint
-static char rcsid_ZVariables_c[] = "$Id$";
+static const char rcsid_ZVariables_c[] = "$Id$";
#endif
#include <internal.h>
#include "mit-copyright.h"
#ifndef lint
-static char rcsid_ZWaitForNotice_c[] = "$Id$";
+static const char rcsid_ZWaitForNotice_c[] = "$Id$";
#endif
#include <internal.h>
ZNotice_t notice;
ZPacket_t packet;
struct sockaddr_in olddest, from;
- int from_len, packet_len, zvlen, part, partof;
+ unsigned int from_len;
+ int packet_len, zvlen, part, partof;
char *slash;
Code_t retval;
fd_set fds;
Code_t retval;
static char version[BUFSIZ]; /* default init should be all \0 */
struct sockaddr_in name;
- int namelen = sizeof(name);
+ unsigned int namelen = sizeof(name);
if (!notice->z_sender)
notice->z_sender = ZGetSender();
static char version[BUFSIZ]; /* default init should be all \0 */
struct sockaddr_in name;
struct timeval tv;
- int namelen = sizeof(name);
+ unsigned int namelen = sizeof(name);
if (!notice->z_sender)
notice->z_sender = ZGetSender();
krb5_keyblock *keyblock,
krb5_cksumtype cksumtype,
char **asn1_data,
- int *asn1_len)
+ unsigned int *asn1_len)
{
krb5_error_code result;
- char *data;
+ unsigned char *data;
int len;
#if HAVE_KRB5_C_MAKE_CHECKSUM
krb5_checksum checksum;
int cksum1_len; /* length of part after checksum */
krb5_data cksumbuf;
krb5_data cksum;
- char *key_data;
+ unsigned char *key_data;
int key_len;
krb5_enctype enctype;
krb5_cksumtype cksumtype;
*/
result = ZMakeZcode(cstart, buffer_len - (plain_len + cksum_len),
- cksum.data, cksum.length);
+ (unsigned char *)cksum.data, cksum.length);
free(cksum.data);
if (!result) {
int zcode_len = strlen(cstart) + 1;
Z_krb5_verify_cksum(krb5_keyblock *keyblock,
krb5_data *cksumbuf,
krb5_cksumtype cksumtype,
- char *asn1_data,
+ unsigned char *asn1_data,
int asn1_len)
{
krb5_error_code result;