+Wed Mar 1 20:15:00 1995 Keith Vetter (keithv@fusion.com)
+
+ * compat_r.c, copy_pri.c, get_fcre.c, get_in_t.c, init_ctx.c, in_tkt_p.c
+ in_tkt_s.c, preauth.c, princ_co.c, pr_to_sa.c, rd_req_d.c, recvauth.c
+ sendauth.c, send_tgs.c, unparse.c: 16 vs 32 bit casts, removed some
+ unused local variables, and pulled in winsock.h for network byte
+ ordering.
+
Tue Feb 28 01:14:57 1995 John Gilmore (gnu at toad.com)
* *.c: Avoid <krb5/...> includes.
* to a V4 sendauth.
*/
+#define NEED_WINSOCK_H
#include "k5-int.h"
#ifndef _MSDOS
#include <kerberosIV/krb.h>
#include <stdio.h>
#include <string.h>
+#ifndef _WINSOCKAPI_
#include <netinet/in.h>
#include <sys/socket.h>
+#endif
static int krb_v4_recvauth();
* the version string, and make sure it matches.
*/
- len = ntohl(vers.len);
+ len = (int) ntohl(vers.len);
if (len < 0 || len > 255)
return KRB5_SENDAUTH_BADAUTHVERS;
*tempprinc = *inprinc; /* Copy all of the non-allocated pieces */
- nelems = krb5_princ_size(context, inprinc);
+ nelems = (int) krb5_princ_size(context, inprinc);
tempprinc->data = malloc(nelems * sizeof(krb5_data));
if (tempprinc->data == 0) {
/* General-purpose forwarding routines. These routines may be put into */
/* libkrb5.a to allow widespread use */
+#define NEED_WINSOCK_H
+#include "k5-int.h"
#include <stdio.h>
-#ifndef _MSDOS
+#ifndef _WINSOCKAPI_
#include <pwd.h>
#include <netdb.h>
-
-#include "k5-int.h"
+#endif
#define KRB5_DEFAULT_LIFE 60*60*8 /* 8 hours */
/* helper function: convert flags to necessary KDC options */
krb5_enctype etype;
krb5_address **addrs;
krb5_error_code retval;
- krb5_data *scratch;
krb5_kdc_rep *dec_rep = 0;
krb5_error *err_reply;
krb5_response tgsrep;
krb5_free_kdc_rep(context, dec_rep);
return retval;
}
-#endif
krb5_data reply;
krb5_keyblock *decrypt_key = 0;
krb5_timestamp time_now;
- krb5_pa_data *padata;
+/* krb5_pa_data *padata; */
int f_salt = 0, use_salt = 0;
krb5_data salt;
char k4_version; /* same type as *(krb5_data::data) */
{
krb5_error_code retval;
krb5_encrypt_block eblock;
- const struct pwd_keyproc_arg *arg;
char pwdbuf[BUFSIZ];
krb5_data * password;
int pwsize = sizeof(pwdbuf);
krb5_keyblock ** key;
{
krb5_keyblock *realkey;
- const struct skey_keyproc_arg *arg;
krb5_error_code retval;
- krb5_keytab kt_id;
- krb5_keytab_entry kt_ent;
const krb5_keyblock * keyblock;
keyblock = (const krb5_keyblock *)keyseed;
krb5_enctype **etypes;
{
krb5_enctype * old_etypes;
- int i;
if (old_etypes = (krb5_enctype *)malloc(sizeof(krb5_enctype) *
(context->etype_count + 1))) {
int use_realm;
{
int size = 0, offset = 0;
- int nelem;
+ krb5_int32 nelem;
register int i;
if (pr == 0) {
if (use_realm)
size += krb5_princ_realm(context, pr)->length;
- for (i = 0; i < nelem; i++)
+ for (i = 0; i < (int) nelem; i++)
size += krb5_princ_component(context, pr, i)->length;
ret->length = size;
memcpy(ret->data, krb5_princ_realm(context, pr)->data, offset);
}
- for (i = 0; i < nelem; i++) {
+ for (i = 0; i < (int) nelem; i++) {
memcpy(&ret->data[offset], krb5_princ_component(context, pr, i)->data,
krb5_princ_component(context, pr, i)->length);
offset += krb5_princ_component(context, pr, i)->length;
#include <time.h>
#include "k5-int.h"
#include <syslog.h>
+#ifdef _MSDOS
+#define getpid _getpid
+#include <process.h>
+#endif
static krb5_preauth_ops preauth_systems[] = {
{
if (retval)
return retval;
if ( !seeded) {
- seeded = kdc_time + getpid();
+ seeded = (int) kdc_time + getpid();
srand(seeded);
}
for (i=0; i < 8; i++)
*tmp++ = rand() & 255;
- *tmp++ = 0;
- *tmp++ = (kdc_time >> 24) & 255;
- *tmp++ = (kdc_time >> 16) & 255;
- *tmp++ = (kdc_time >> 8) & 255;
- *tmp++ = kdc_time & 255;
+ *tmp++ = (unsigned char) 0;
+ *tmp++ = (unsigned char) ((kdc_time >> 24) & 255);
+ *tmp++ = (unsigned char) ((kdc_time >> 16) & 255);
+ *tmp++ = (unsigned char) ((kdc_time >> 8) & 255);
+ *tmp++ = (unsigned char) (kdc_time & 255);
return(0);
}
krb5_const_principal princ1;
krb5_const_principal princ2;
{
- register int i, nelem;
+ register int i;
+ krb5_int32 nelem;
nelem = krb5_princ_size(context, princ1);
if (nelem != krb5_princ_size(context, princ2))
if (! krb5_realm_compare(context, princ1, princ2))
return FALSE;
- for (i = 0; i < nelem; i++) {
+ for (i = 0; i < (int) nelem; i++) {
register const krb5_data *p1 = krb5_princ_component(context, princ1, i);
register const krb5_data *p2 = krb5_princ_component(context, princ2, i);
if (p1->length != p2->length ||
/* Hierarchical Cross-Realm */
- { int i;
+ {
krb5_data lrealm;
krb5_data *realm = krb5_princ_realm(context, req->ticket->enc_part2->client);
krb5_transited *trans = &(req->ticket->enc_part2->transited);
*/
+#define NEED_WINSOCK_H
#include "k5-int.h"
-#ifndef _MSDOS
+
#include "com_err.h"
#include <errno.h>
#include <stdio.h>
#include <string.h>
+#ifndef _WINSOCKAPI_
#include <netinet/in.h>
+#endif
extern krb5_flags krb5_kdc_default_options;
krb5_xfree(authdat);
return 0;
}
-
-#endif
const krb5_cksumtype sumtype;
krb5_const_principal sname;
krb5_address * const * addrs;
- const krb5_authdata ** authorization_data;
+ krb5_authdata * const * authorization_data;
krb5_pa_data * const * padata;
const krb5_data * second_ticket;
krb5_creds * in_cred;
/* need to encrypt it in the request */
krb5_encrypt_block eblock;
- if (retval = encode_krb5_authdata(authorization_data, &scratch))
+ if (retval = encode_krb5_authdata((const krb5_authdata**)authorization_data,
+ &scratch))
return(retval);
krb5_use_cstype(context, &eblock, in_cred->keyblock.etype);
tgsreq.authorization_data.etype = in_cred->keyblock.etype;
* convenience sendauth/recvauth functions
*/
+#define NEED_WINSOCK_H
#include "k5-int.h"
#include "com_err.h"
#include <errno.h>
#include <stdio.h>
#include <string.h>
-#ifdef _MSDOS
-#define ECONNABORTED 53
-#endif
#define WORKING_RCACHE
{
register char *cp, *q;
register int i,j;
- int length, nelem;
+ int length;
+ krb5_int32 nelem;
register int totalsize = 0;
cp = krb5_princ_realm(context, principal)->data;
totalsize++; /* This is for the separator */
nelem = krb5_princ_size(context, principal);
- for (i = 0; i < nelem; i++) {
+ for (i = 0; i < (int) nelem; i++) {
cp = krb5_princ_component(context, principal, i)->data;
length = krb5_princ_component(context, principal, i)->length;
totalsize += length;
q = *name;
- for (i = 0; i < nelem; i++) {
+ for (i = 0; i < (int) nelem; i++) {
cp = krb5_princ_component(context, principal, i)->data;
length = krb5_princ_component(context, principal, i)->length;
for (j=0; j < length; j++,cp++) {