From 017bc3c78c5e1d5d1160eeb0d70c428691f6489e Mon Sep 17 00:00:00 2001 From: John Kohl Date: Mon, 19 Nov 1990 14:05:49 +0000 Subject: [PATCH] changes for narrow/wide prototypes git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1461 dc483132-0cff-0310-8789-dd5450dbe970 --- src/admin/edit/kdb5_edit.c | 5 ++++- src/include/krb5/asn.1/asn1defs.h | 19 +++++++++++++------ src/lib/crypto/des/des_int.h | 7 ++++++- src/lib/kdb/kdb_dbm.c | 4 ++-- src/lib/krb5/keytab/file/ktfile.h | 6 ++++++ src/lib/krb5/krb/rd_req.c | 14 ++++++++++---- src/lib/krb5/krb/rd_req_dec.c | 15 +++++++++++---- 7 files changed, 52 insertions(+), 18 deletions(-) diff --git a/src/admin/edit/kdb5_edit.c b/src/admin/edit/kdb5_edit.c index 7c8e929aa..c970162b2 100644 --- a/src/admin/edit/kdb5_edit.c +++ b/src/admin/edit/kdb5_edit.c @@ -47,14 +47,17 @@ struct mblock { 0 }; +/* krb5_kvno may be narrow */ +#include void add_key PROTOTYPE((char * const *, krb5_const_principal, const krb5_keyblock *, krb5_kvno)); void enter_rnd_key PROTOTYPE((char **, const krb5_principal, krb5_kvno)); void enter_pwd_key PROTOTYPE((char **, krb5_const_principal, krb5_const_principal, krb5_kvno)); - int set_dbname_help PROTOTYPE((char *, char *)); +#include + static void usage(who, status) char *who; diff --git a/src/include/krb5/asn.1/asn1defs.h b/src/include/krb5/asn.1/asn1defs.h index b4a0e5cd2..eb7a80b54 100644 --- a/src/include/krb5/asn.1/asn1defs.h +++ b/src/include/krb5/asn.1/asn1defs.h @@ -138,12 +138,6 @@ struct type_KRB5_KRB__ERROR *krb5_error2KRB5_KRB__ERROR struct type_KRB5_EncTicketPart *krb5_enc_tkt_part2KRB5_EncTicketPart PROTOTYPE((const krb5_enc_tkt_part *, int *)); -/* kkdcr2kdcr.c */ -struct type_KRB5_TGS__REP *krb5_kdc_rep2KRB5_KDC__REP - PROTOTYPE((const krb5_kdc_rep *, - const krb5_msgtype, - int *)); - /* kkey2enck.c */ struct type_KRB5_EncryptionKey *krb5_keyblock2KRB5_EncryptionKey PROTOTYPE((const krb5_keyblock *, int *)); @@ -226,4 +220,17 @@ struct type_KRB5_TicketFlags *krb5_flags2KRB5_TicketFlags krb5_flags KRB5_TicketFlags2krb5_flags PROTOTYPE((const struct type_KRB5_TicketFlags *,int *)); +#include + +/* Only put things which don't have pointers to the narrow types in this + section */ + +/* kkdcr2kdcr.c */ +struct type_KRB5_TGS__REP *krb5_kdc_rep2KRB5_KDC__REP + PROTOTYPE((const krb5_kdc_rep *, + const krb5_msgtype, + int *)); + +#include + #endif /* KRB5_ASN1DEFS__ */ diff --git a/src/lib/crypto/des/des_int.h b/src/lib/crypto/des/des_int.h index dc78917bc..09fb53a7f 100644 --- a/src/lib/crypto/des/des_int.h +++ b/src/lib/crypto/des/des_int.h @@ -91,6 +91,9 @@ typedef struct { #endif /*BITS32*/ +/* widen prototypes, if needed */ +#include + /* cbc_cksum.c */ extern krb5_error_code mit_des_cbc_checksum PROTOTYPE((krb5_pointer, size_t,krb5_pointer,size_t, krb5_checksum * )); @@ -178,5 +181,7 @@ extern unsigned long swap_long_bytes_bit_number PROTOTYPE((unsigned long )); extern void test_set PROTOTYPE((FILE *, const char *, int, const char *, int)); #endif -#undef P +/* and back to normal... */ +#include + #endif /*DES_INTERNAL_DEFS*/ diff --git a/src/lib/kdb/kdb_dbm.c b/src/lib/kdb/kdb_dbm.c index 7499dad01..ff448b3c3 100644 --- a/src/lib/kdb/kdb_dbm.c +++ b/src/lib/kdb/kdb_dbm.c @@ -971,8 +971,8 @@ krb5_pointer func_arg; } krb5_boolean -krb5_dbm_db_set_lockmode(mode) - krb5_boolean mode; +krb5_dbm_db_set_lockmode(DECLARG(krb5_boolean,mode)) +OLDDECLARG(krb5_boolean,mode) { krb5_boolean old = non_blocking; non_blocking = mode; diff --git a/src/lib/krb5/keytab/file/ktfile.h b/src/lib/krb5/keytab/file/ktfile.h index 3c1517ee8..83d9ec2c0 100644 --- a/src/lib/krb5/keytab/file/ktfile.h +++ b/src/lib/krb5/keytab/file/ktfile.h @@ -42,6 +42,10 @@ typedef struct _krb5_ktfile_data { extern struct _krb5_kt_ops krb5_ktf_ops; extern struct _krb5_kt_ops krb5_ktf_writable_ops; + +/* widen prototypes, if needed */ +#include + krb5_error_code krb5_ktfile_resolve PROTOTYPE((char *, krb5_keytab *)); krb5_error_code krb5_ktfile_wresolve PROTOTYPE((char *, @@ -74,5 +78,7 @@ krb5_error_code krb5_ktfileint_read_entry PROTOTYPE((krb5_keytab, krb5_keytab_entry **)); krb5_error_code krb5_ktfileint_write_entry PROTOTYPE((krb5_keytab, krb5_keytab_entry *)); +/* and back to normal... */ +#include #endif /* KRB5_KTFILE__ */ diff --git a/src/lib/krb5/krb/rd_req.c b/src/lib/krb5/krb/rd_req.c index 5ac5411d9..9fb100a8f 100644 --- a/src/lib/krb5/krb/rd_req.c +++ b/src/lib/krb5/krb/rd_req.c @@ -45,6 +45,15 @@ static char rcsid_rd_req_c[] = returns system errors, encryption errors, replay errors */ +/* widen prototypes, if needed */ +#include +typedef krb5_error_code (*rdreq_key_proc) PROTOTYPE((krb5_pointer, + krb5_principal, + krb5_kvno, + krb5_keyblock **)); +/* and back to normal... */ +#include + krb5_error_code krb5_rd_req(inbuf, server, sender_addr, fetchfrom, keyproc, keyprocarg, rcache, authdat) @@ -52,10 +61,7 @@ const krb5_data *inbuf; krb5_const_principal server; const krb5_address *sender_addr; krb5_const_pointer fetchfrom; -krb5_error_code (*keyproc) PROTOTYPE((krb5_pointer, - krb5_principal, - krb5_kvno, - krb5_keyblock **)); +rdreq_key_proc keyproc; krb5_pointer keyprocarg; krb5_rcache rcache; krb5_tkt_authent *authdat; diff --git a/src/lib/krb5/krb/rd_req_dec.c b/src/lib/krb5/krb/rd_req_dec.c index 9592daf0f..40f1a9a24 100644 --- a/src/lib/krb5/krb/rd_req_dec.c +++ b/src/lib/krb5/krb/rd_req_dec.c @@ -49,8 +49,18 @@ static char rcsid_rd_req_dec_c[] = returns system errors, encryption errors, replay errors */ +/* widen prototypes, if needed */ +#include + static krb5_error_code decrypt_authenticator PROTOTYPE((const krb5_ap_req *, krb5_authenticator **)); +typedef krb5_error_code (*rdreq_key_proc) PROTOTYPE((krb5_pointer, + krb5_principal, + krb5_kvno, + krb5_keyblock **)); +/* and back to normal... */ +#include + extern krb5_deltat krb5_clockskew; #define in_clock_skew(date) (abs((date)-currenttime) < krb5_clockskew) @@ -61,10 +71,7 @@ const krb5_ap_req *req; krb5_const_principal server; const krb5_address *sender_addr; krb5_const_pointer fetchfrom; -krb5_error_code (*keyproc) PROTOTYPE((krb5_pointer, - krb5_principal, - krb5_kvno, - krb5_keyblock **)); +rdreq_key_proc keyproc; krb5_pointer keyprocarg; krb5_rcache rcache; krb5_tkt_authent *tktauthent; -- 2.26.2