#define inc_header_word(tt,field) kawrite ((tt), ((char *)&(cheader.field) - (char *)&cheader), ((cheader.field = (htonl(ntohl(cheader.field)+1))), (char *)&(cheader.field)), sizeof(afs_int32))
-static int index_OK();
+static int index_OK(afs_int32);
afs_int32
-NameHash(aname, ainstance)
- register char *aname;
- register char *ainstance;
+NameHash(register char *aname, register char *ainstance)
{
register unsigned int hash;
register int i;
/* package up seek and write into one procedure for ease of use */
afs_int32
-kawrite(tt, pos, buff, len)
- struct ubik_trans *tt;
- afs_int32 pos;
- char *buff;
- afs_int32 len;
+kawrite(struct ubik_trans *tt, afs_int32 pos, char *buff, afs_int32 len)
{
afs_int32 code;
/* same thing for read */
afs_int32
-karead(tt, pos, buff, len)
- struct ubik_trans *tt;
- afs_int32 pos;
- char *buff;
- afs_int32 len;
+karead(struct ubik_trans *tt, afs_int32 pos, char *buff, afs_int32 len)
{
afs_int32 code;
static int dbfixup = 0;
void
-init_kadatabase(initFlags)
- int initFlags; /* same as init_kaprocs (see which) */
+init_kadatabase(int initFlags)
{
Lock_Init(&cheader_lock);
Lock_Init(&keycache_lock);
manner, to avoid bogusly reinitializing the db. */
afs_int32
-CheckInit(at, db_init)
- struct ubik_trans *at;
- int (*db_init) (); /* procedure to call if rebuilding DB */
+CheckInit(struct ubik_trans *at,
+ int (*db_init) (struct ubik_trans *)) /* procedure to call if rebuilding DB */
{
register afs_int32 code;
afs_int32 iversion;
zeroed entry. If zero is returned, a Ubik I/O error can be assumed. */
afs_int32
-AllocBlock(at, tentry)
- register struct ubik_trans *at;
- struct kaentry *tentry;
+AllocBlock(struct ubik_trans *at, struct kaentry *tentry)
{
register afs_int32 code;
afs_int32 temp;
Returns zero for success or an error code on failure. */
afs_int32
-FreeBlock(at, index)
- struct ubik_trans *at;
- afs_int32 index;
+FreeBlock(struct ubik_trans *at, afs_int32 index)
{
struct kaentry tentry;
int code;
returned. */
afs_int32
-FindBlock(at, aname, ainstance, toP, tentry)
- struct ubik_trans *at;
- char *aname;
- char *ainstance;
- afs_int32 *toP;
- struct kaentry *tentry;
+FindBlock(struct ubik_trans *at, char *aname, char *ainstance, afs_int32 *toP,
+ struct kaentry *tentry)
{
register afs_int32 i, code;
register afs_int32 to;
returns zero if there were no errors. */
afs_int32
-ThreadBlock(at, index, tentry)
- struct ubik_trans *at;
- afs_int32 index;
- struct kaentry *tentry;
+ThreadBlock(struct ubik_trans *at, afs_int32 index,
+ struct kaentry *tentry)
{
int code;
int hi; /* hash index */
error code. */
afs_int32
-UnthreadBlock(at, aentry)
- struct ubik_trans *at;
- struct kaentry *aentry;
+UnthreadBlock(struct ubik_trans *at, struct kaentry *aentry)
{
register afs_int32 i, code;
register afs_int32 to;
remaining count is negative. */
afs_int32
-NextBlock(at, index, tentry, remaining)
- struct ubik_trans *at;
- afs_int32 index;
- struct kaentry *tentry;
- afs_int32 *remaining;
+NextBlock(struct ubik_trans *at, afs_int32 index, struct kaentry *tentry,
+ afs_int32 *remaining)
{
int code;
afs_int32 last;
and pointer to the user entry. */
afs_int32
-ka_NewKey(tt, tentryaddr, tentry, key)
- struct ubik_trans *tt;
- afs_int32 tentryaddr;
- struct kaentry *tentry;
- struct ktc_encryptionKey *key;
+ka_NewKey(struct ubik_trans *tt, afs_int32 tentryaddr,
+ struct kaentry *tentry, struct ktc_encryptionKey *key)
{
struct kaOldKeys okeys; /* old keys block */
afs_int32 okeysaddr, nextaddr; /* offset of old keys block */
}
afs_int32
-ka_DelKey(tt, tentryaddr, tentry)
- struct ubik_trans *tt;
- afs_int32 tentryaddr;
- struct kaentry *tentry;
+ka_DelKey(struct ubik_trans *tt, afs_int32 tentryaddr,
+ struct kaentry *tentry)
{
int code;
struct kaOldKeys okeys; /* old keys block */
afs_int32 okeysaddr, nextaddr; /* offset of old keys block */
afs_int32 prevptr = 0;
- Date now = time(0);
es_Report("DelKey for %s.%s\n", tentry->userID.name,
tentry->userID.instance);
}
void
-ka_debugKeyCache(info)
- struct ka_debugInfo *info;
+ka_debugKeyCache(struct ka_debugInfo *info)
{
int i;
/* Add a key to the key cache, expanding it if necessary. */
void
-ka_Encache(name, inst, kvno, key, superseded)
- char *name;
- char *inst;
- afs_int32 kvno;
- struct ktc_encryptionKey *key;
- Date superseded;
+ka_Encache(char *name, char *inst, afs_int32 kvno,
+ struct ktc_encryptionKey *key, Date superseded)
{
int i;
with tt==0, since Rx can't call Ubik. */
afs_int32
-ka_LookupKvno(tt, name, inst, kvno, key)
- struct ubik_trans *tt;
- char *name;
- char *inst;
- afs_int32 kvno;
- struct ktc_encryptionKey *key;
+ka_LookupKvno(struct ubik_trans *tt, char *name, char *inst, afs_int32 kvno,
+ struct ktc_encryptionKey *key)
{
int i;
int code = 0;
/* Look up the primary key and key version for a principal. */
afs_int32
-ka_LookupKey(tt, name, inst, kvno, key)
- struct ubik_trans *tt;
- char *name;
- char *inst;
- afs_int32 *kvno; /* returned */
- struct ktc_encryptionKey *key; /* copied out */
+ka_LookupKey(struct ubik_trans *tt,
+ char *name,
+ char *inst,
+ afs_int32 *kvno, /* returned */
+ struct ktc_encryptionKey *key) /* copied out */
{
int i;
afs_int32 to;
Ubik needs to use Rx. */
afs_int32
-ka_FillKeyCache(tt)
- struct ubik_trans *tt;
+ka_FillKeyCache(struct ubik_trans *tt)
{
int nfound;
afs_int32 ko;
}
afs_int32
-update_admin_count(tt, delta)
- struct ubik_trans *tt;
- int delta;
+update_admin_count(struct ubik_trans *tt, int delta)
{
afs_int32 to;
afs_int32 code;
}
static int
-index_OK(index)
- afs_int32 index;
+index_OK(afs_int32 index)
{
if ((index < sizeof(cheader)) || (index >= ntohl(cheader.eofPtr))
|| ((index - sizeof(cheader)) % sizeof(kaentry) != 0))
#define LEGALCHARS ".ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"
int
-name_instance_legal(name, instance)
- char *name;
- char *instance;
+name_instance_legal(char *name, char *instance)
{
int code;
return code;
}
+#if 0
static int
-string_legal(str, map)
- char *str;
- char *map;
+string_legal(char *str, char *map)
{
int slen;
return 0; /* with trailing null must fit in data base */
return (slen == strspn(str, map)); /* strspn returns length(str) if all chars in map */
}
+#endif
+
#endif
#include <string.h>
#include <des.h>
+#include <des_prototypes.h>
#include <afs/cellconfig.h>
#include <afs/auth.h>
#include <afs/com_err.h>
#include "kaserver.h"
#include "kalog.h"
#include "kaport.h"
+#include "kauth_internal.h"
#include "afs/audit.h"
extern struct ubik_dbase *KA_dbase;
Date cheaderReadTime; /* time cheader last read in */
extern struct afsconf_dir *KA_conf; /* for getting cell info */
-afs_int32 kamCreateUser(), ChangePassWord(), kamSetPassword(), kamSetFields(),
-kamDeleteUser();
-afs_int32 kamGetEntry(), kamListEntry(), kamGetStats(), kamGetPassword(),
-kamGetRandomKey(), kamDebug();
+afs_int32 kamCreateUser(struct rx_call *call, char *aname, char *ainstance,
+ EncryptionKey ainitpw);
+afs_int32 ChangePassWord(struct rx_call *call, char *aname, char *ainstance,
+ ka_CBS *arequest, ka_BBS *oanswer);
+afs_int32 kamSetPassword(struct rx_call *call, char *aname, char *ainstance,
+ afs_int32 akvno, EncryptionKey apassword);
+afs_int32 kamSetFields(struct rx_call *call, char *aname, char *ainstance,
+ afs_int32 aflags, Date aexpiration,
+ afs_int32 alifetime, afs_int32 amaxAssociates,
+ afs_uint32 misc_auth_bytes, afs_int32 spare2);
+afs_int32 kamDeleteUser(struct rx_call *call, char *aname, char *ainstance);
+afs_int32 kamGetEntry(struct rx_call *call, char *aname, char *ainstance,
+ afs_int32 aversion, kaentryinfo *aentry);
+afs_int32 kamListEntry(struct rx_call *call, afs_int32 previous_index,
+ afs_int32 *index, afs_int32 *count, kaident *name);
+afs_int32 kamGetStats(struct rx_call *call, afs_int32 version,
+ afs_int32 *admin_accounts, kasstats *statics,
+ kadstats *dynamics);
+afs_int32 kamGetPassword(struct rx_call *call, char *name,
+ EncryptionKey *password);
+afs_int32 kamGetRandomKey(struct rx_call *call, EncryptionKey *key);
+afs_int32 kamDebug(struct rx_call *call, afs_int32 version,
+ int checkDB, struct ka_debugInfo *info);
+
char lrealm[MAXKTCREALMLEN];
#ifndef EXPIREPW /* password expiration default yes */
static afs_int32 autoCPWInterval;
static afs_int32 autoCPWUpdates;
-static afs_int32 set_password(); /* forward */
-extern afs_int32 InitAuthServ(); /* forward */
-static afs_int32 impose_reuse_limits(); /* forward */
-static int create_user(); /* forward */
+static afs_int32 set_password(struct ubik_trans *tt, char *name,
+ char *instance, EncryptionKey *password,
+ afs_int32 kvno, afs_int32 caller);
+
+extern afs_int32 InitAuthServ(struct ubik_trans **tt, int lock,
+ int *this_op);
+static afs_int32 impose_reuse_limits(EncryptionKey *password,
+ struct kaentry *tentry);
+static int create_user(struct ubik_trans *tt, char *name, char *instance,
+ EncryptionKey *key, afs_int32 caller,
+ afs_int32 flags);
/* This routine is called whenever an RPC interface needs the time. It uses
the current time to randomize a 128 bit value that is used to change the
ptr should be zero and the return code need not be checked. */
static afs_int32
-get_time(timeP, tt, admin)
- Date *timeP;
- struct ubik_trans *tt; /* tt != 0: a write transaction */
- int admin; /* the caller is an admin user */
+get_time(Date *timeP,
+ struct ubik_trans *tt, /* tt != 0: a write transaction */
+ int admin) /* the caller is an admin user */
{
/* random value used to change Admin & TGS keys, this is at risk during
* multi-threaded operation, but I think the consequences are fairly
/* This variable is protected by the kaprocsInited flag. */
-static int (*rebuildDatabase) ();
+static int (*rebuildDatabase) (struct ubik_trans *);
/* This is called to initialize the database */
static int
-initialize_database(tt)
- struct ubik_trans *tt;
+initialize_database(struct ubik_trans *tt)
{
struct ktc_encryptionKey key;
int code;
parameter passes some information about the command line arguments. */
afs_int32
-init_kaprocs(lclpath, initFlags)
- char *lclpath;
- int initFlags;
+init_kaprocs(char *lclpath, int initFlags)
{
int code;
struct ubik_trans *tt;
init_kadatabase(initFlags);
rebuildDatabase = initialize_database;
- if (code = InitAuthServ(&tt, LOCKREAD, 0)) {
+ if ((code = InitAuthServ(&tt, LOCKREAD, 0))) {
printf("init_kaprocs: InitAuthServ failed: code = %d\n", code);
return code;
}
static char tgsServerPrincipal[256];
void
-save_principal(p, n, i, c)
- char *p, *n, *i, *c;
+save_principal(char *p, char *n, char *i, char *c)
{
int s = 255;
int l;
}
static afs_int32
-check_auth(call, at, admin, acaller_id)
- struct rx_call *call;
- struct ubik_trans *at;
- int admin; /* require caller to be ADMIN */
- afs_int32 *acaller_id;
+check_auth(struct rx_call *call,
+ struct ubik_trans *at,
+ int admin, /* require caller to be ADMIN */
+ afs_int32 *acaller_id)
{
rxkad_level level;
char name[MAXKTCNAMELEN];
}
afs_int32
-AwaitInitialization()
+AwaitInitialization(void)
{
afs_int32 start = 0;
while (!kaprocsInited) {
the database header into core */
afs_int32
-InitAuthServ(tt, lock, this_op)
- struct ubik_trans **tt;
- int lock; /* indicate read/write transaction */
- int *this_op; /* opcode of RPC proc, for COUNT_ABO */
+InitAuthServ(struct ubik_trans **tt,
+ int lock, /* indicate read/write transaction */
+ int *this_op) /* opcode of RPC proc, for COUNT_ABO */
{
int code;
afs_int32 start = 0; /* time started waiting for quorum */
/* Wait for server initialization to finish if not during init_kaprocs */
if (this_op)
- if (code = AwaitInitialization())
+ if ((code = AwaitInitialization()))
return code;
for (code = UNOQUORUM; code == UNOQUORUM;) {
}
if (code)
return code;
- if (code = ubik_SetLock(*tt, 1, 1, lock)) {
+ if ((code = ubik_SetLock(*tt, 1, 1, lock))) {
if (this_op)
COUNT_ABO;
ubik_AbortTrans(*tt);
* in CheckInit before nuking the database. Since this may now get
* a UNOQUORUM we'll just do this from the top.
*/
- if (code = InitAuthServ(tt, LOCKWRITE, this_op))
+ if ((code = InitAuthServ(tt, LOCKWRITE, this_op)))
return code;
- if (code = ubik_EndTrans(*tt))
+ if ((code = ubik_EndTrans(*tt)))
return code;
/* now open the read transaction that was originally requested. */
return InitAuthServ(tt, lock, this_op);
}
} else {
- if (code = CheckInit(*tt, rebuildDatabase)) {
+ if ((code = CheckInit(*tt, rebuildDatabase))) {
if (this_op)
COUNT_ABO;
ubik_AbortTrans(*tt);
/* returns true if name is specially known by AuthServer */
static int
-special_name(name, instance)
- char *name;
- char *instance;
+special_name(char *name, char *instance)
+
{
return ((!strcmp(name, KA_TGS_NAME) && !strcmp(instance, lrealm))
|| (strcmp(name, KA_ADMIN_NAME) == 0));
}
static int
-create_user(tt, name, instance, key, caller, flags)
- struct ubik_trans *tt;
- char *name;
- char *instance;
- EncryptionKey *key;
- afs_int32 caller;
- afs_int32 flags;
+create_user(struct ubik_trans *tt, char *name, char *instance,
+ EncryptionKey *key, afs_int32 caller, afs_int32 flags)
{
register int code;
afs_int32 to;
if (special_name(name, instance)) { /* this overrides key & version */
tentry.flags = htonl(ntohl(tentry.flags) | KAFSPECIAL);
tentry.key_version = htonl(-1); /* don't save this key */
- if (code = ka_NewKey(tt, to, &tentry, key))
+ if ((code = ka_NewKey(tt, to, &tentry, key)))
return code;
} else {
memcpy(&tentry.key, key, sizeof(tentry.key));
/* Put actual stub routines here */
afs_int32
-SKAM_CreateUser(call, aname, ainstance, ainitpw)
- struct rx_call *call;
- char *aname;
- char *ainstance;
- EncryptionKey ainitpw;
+SKAM_CreateUser(struct rx_call *call, char *aname, char *ainstance,
+ EncryptionKey ainitpw)
{
afs_int32 code;
afs_int32
-kamCreateUser(call, aname, ainstance, ainitpw)
- struct rx_call *call;
- char *aname;
- char *ainstance;
- EncryptionKey ainitpw;
+kamCreateUser(struct rx_call *call, char *aname, char *ainstance,
+ EncryptionKey ainitpw)
{
register int code;
struct ubik_trans *tt;
return KABADKEY;
if (!name_instance_legal(aname, ainstance))
return KABADNAME;
- if (code = InitAuthServ(&tt, LOCKWRITE, this_op))
+ if ((code = InitAuthServ(&tt, LOCKWRITE, this_op)))
return code;
code = check_auth(call, tt, 1, &caller);
if (code) {
}
afs_int32
-SKAA_ChangePassword(call, aname, ainstance, arequest, oanswer)
- struct rx_call *call;
- char *aname;
- char *ainstance;
- ka_CBS *arequest;
- ka_BBS *oanswer;
+SKAA_ChangePassword(struct rx_call *call, char *aname, char *ainstance,
+ ka_CBS *arequest, ka_BBS *oanswer)
{
afs_int32 code;
}
afs_int32
-ChangePassWord(call, aname, ainstance, arequest, oanswer)
- struct rx_call *call;
- char *aname;
- char *ainstance;
- ka_CBS *arequest;
- ka_BBS *oanswer;
+ChangePassWord(struct rx_call *call, char *aname, char *ainstance,
+ ka_CBS *arequest, ka_BBS *oanswer)
{
register int code;
struct ubik_trans *tt;
return KABADNAME;
if (strcmp(ainstance, KA_ADMIN_NAME) == 0)
return KABADNAME;
- if (code = InitAuthServ(&tt, LOCKWRITE, this_op))
+ if ((code = InitAuthServ(&tt, LOCKWRITE, this_op)))
return code;
code = FindBlock(tt, aname, ainstance, &to, &tentry);
}
/* decrypt request w/ user password */
- if (code = des_key_sched(&tentry.key, user_schedule))
+ if ((code = des_key_sched(&tentry.key, user_schedule)))
es_Report("In KAChangePassword: key_sched returned %d\n", code);
des_pcbc_encrypt(arequest->SeqBody, &request,
min(arequest->SeqLen, sizeof(request)), user_schedule,
}
static afs_int32
-impose_reuse_limits(password, tentry)
- EncryptionKey *password;
- struct kaentry *tentry;
+impose_reuse_limits(EncryptionKey *password, struct kaentry *tentry)
{
int code;
Date now;
static afs_int32
-set_password(tt, name, instance, password, kvno, caller)
- struct ubik_trans *tt;
- char *name;
- char *instance;
- EncryptionKey *password;
- afs_int32 kvno;
- afs_int32 caller;
+set_password(struct ubik_trans *tt, char *name, char *instance,
+ EncryptionKey *password, afs_int32 kvno, afs_int32 caller)
{
afs_int32 code;
afs_int32 to; /* offset of block */
if (special_name(name, instance)) { /* set key over rides key_version */
tentry.flags = htonl(ntohl(tentry.flags) | KAFSPECIAL);
- if (code = ka_NewKey(tt, to, &tentry, password))
+ if ((code = ka_NewKey(tt, to, &tentry, password)))
return (code);
} else {
memcpy(&tentry.key, password, sizeof(tentry.key));
}
afs_int32
-SKAM_SetPassword(call, aname, ainstance, akvno, apassword)
- struct rx_call *call;
- char *aname;
- char *ainstance;
- afs_int32 akvno;
- EncryptionKey apassword;
+SKAM_SetPassword(struct rx_call *call, char *aname, char *ainstance,
+ afs_int32 akvno, EncryptionKey apassword)
{
afs_int32 code;
}
afs_int32
-kamSetPassword(call, aname, ainstance, akvno, apassword)
- struct rx_call *call;
- char *aname;
- char *ainstance;
- afs_int32 akvno;
- EncryptionKey apassword;
+kamSetPassword(struct rx_call *call, char *aname, char *ainstance,
+ afs_int32 akvno, EncryptionKey apassword)
{
register int code;
struct ubik_trans *tt;
if (!name_instance_legal(aname, ainstance))
return KABADNAME;
- if (code = InitAuthServ(&tt, LOCKWRITE, this_op))
+ if ((code = InitAuthServ(&tt, LOCKWRITE, this_op)))
return code;
code = check_auth(call, tt, 0, &caller);
if (code) {
goto abort;
}
- if (code = karead(tt, caller, &tentry, sizeof(tentry))) {
+ if ((code = karead(tt, caller, &tentry, sizeof(tentry)))) {
code = KAIO;
goto abort;
}
}
static Date
-CoerseLifetime(start, end)
- Date start, end;
+CoerseLifetime(Date start, Date end)
{
unsigned char kerberosV4Life;
kerberosV4Life = time_to_life(start, end);
}
static afs_int32
-GetEndTime(start, reqEnd, expiration, caller, server, endP)
- IN Date start; /* start time of ticket */
- IN Date reqEnd; /* requested end time */
- IN Date expiration; /* authorizing ticket's expiration */
- IN struct kaentry *caller;
- IN struct kaentry *server;
- OUT Date *endP; /* actual end time */
+GetEndTime(Date start, /* start time of ticket */
+ Date reqEnd, /* requested end time */
+ Date expiration, /* authorizing ticket's expiration */
+ struct kaentry *caller,
+ struct kaentry *server,
+ Date *endP) /* actual end time */
{
Date cExp, sExp;
Date cLife, sLife;
}
static afs_int32
-PrepareTicketAnswer(oanswer, challenge, ticket, ticketLen, sessionKey, start,
- end, caller, server, cell, label)
- ka_BBS *oanswer;
- afs_int32 challenge;
- char *ticket;
- afs_int32 ticketLen;
- struct ktc_encryptionKey *sessionKey;
- Date start, end;
- struct kaentry *caller, *server;
- char *cell;
- char *label;
+PrepareTicketAnswer(ka_BBS *oanswer, afs_int32 challenge, char *ticket,
+ afs_int32 ticketLen, struct ktc_encryptionKey *sessionKey,
+ Date start, Date end, struct kaentry *caller,
+ struct kaentry *server, char *cell, char *label)
{
afs_int32 code;
struct ka_ticketAnswer *answer;
is normally disabled for these two principals. */
static afs_int32
-Authenticate(version, call, aname, ainstance, start, end, arequest, oanswer)
- int version;
- struct rx_call *call;
- char *aname;
- char *ainstance;
- Date start, end;
- ka_CBS *arequest;
- ka_BBS *oanswer;
+Authenticate(int version, struct rx_call *call, char *aname, char *ainstance,
+ Date start, Date end, ka_CBS *arequest, ka_BBS *oanswer)
{
int code;
struct ubik_trans *tt;
COUNT_REQ(Authenticate);
if (!name_instance_legal(aname, ainstance))
return KABADNAME;
- if (code = InitAuthServ(&tt, LOCKREAD, this_op))
+ if ((code = InitAuthServ(&tt, LOCKREAD, this_op)))
return code;
get_time(&now, 0, 0);
save_principal(authPrincipal, aname, ainstance, 0);
/* decrypt request w/ user password */
- if (code = des_key_sched(&tentry.key, user_schedule))
+ if ((code = des_key_sched(&tentry.key, user_schedule)))
es_Report("In KAAuthenticate: key_sched returned %d\n", code);
des_pcbc_encrypt(arequest->SeqBody, &request,
min(arequest->SeqLen, sizeof(request)), user_schedule,
}
afs_int32
-SKAA_Authenticate_old(call, aname, ainstance, start, end, arequest, oanswer)
- struct rx_call *call;
- char *aname;
- char *ainstance;
- Date start, end;
- ka_CBS *arequest;
- ka_BBS *oanswer;
+SKAA_Authenticate_old(struct rx_call *call, char *aname, char *ainstance,
+ Date start, Date end, ka_CBS *arequest,
+ ka_BBS *oanswer)
{
int code;
}
afs_int32
-SKAA_Authenticate(call, aname, ainstance, start, end, arequest, oanswer)
- struct rx_call *call;
- char *aname;
- char *ainstance;
- Date start, end;
- ka_CBS *arequest;
- ka_BBS *oanswer;
+SKAA_Authenticate(struct rx_call *call, char *aname, char *ainstance,
+ Date start, Date end, ka_CBS *arequest, ka_BBS *oanswer)
{
int code;
}
afs_int32
-SKAA_AuthenticateV2(call, aname, ainstance, start, end, arequest, oanswer)
- struct rx_call *call;
- char *aname;
- char *ainstance;
- Date start, end;
- ka_CBS *arequest;
- ka_BBS *oanswer;
+SKAA_AuthenticateV2(struct rx_call *call, char *aname, char *ainstance,
+ Date start, Date end, ka_CBS *arequest, ka_BBS *oanswer)
{
int code;
}
afs_int32
-SKAM_SetFields(call, aname, ainstance, aflags, aexpiration, alifetime,
- amaxAssociates, misc_auth_bytes, spare2)
- struct rx_call *call;
- char *aname;
- char *ainstance;
- afs_int32 aflags;
- Date aexpiration;
- afs_int32 alifetime;
- afs_int32 amaxAssociates;
- afs_uint32 misc_auth_bytes; /* 4 bytes, each 0 means unspecified */
- afs_int32 spare2;
+SKAM_SetFields(struct rx_call *call,
+ char *aname,
+ char *ainstance,
+ afs_int32 aflags,
+ Date aexpiration,
+ afs_int32 alifetime,
+ afs_int32 amaxAssociates,
+ afs_uint32 misc_auth_bytes, /* 4 bytes, each 0 means unspecified */
+ afs_int32 spare2)
{
afs_int32 code;
}
afs_int32
-kamSetFields(call, aname, ainstance, aflags, aexpiration, alifetime,
- amaxAssociates, misc_auth_bytes, spare2)
- struct rx_call *call;
- char *aname;
- char *ainstance;
- afs_int32 aflags;
- Date aexpiration;
- afs_int32 alifetime;
- afs_int32 amaxAssociates;
- afs_uint32 misc_auth_bytes; /* 4 bytes, each 0 means unspecified */
- afs_int32 spare2;
+kamSetFields(struct rx_call *call,
+ char *aname,
+ char *ainstance,
+ afs_int32 aflags,
+ Date aexpiration,
+ afs_int32 alifetime,
+ afs_int32 amaxAssociates,
+ afs_uint32 misc_auth_bytes, /* 4 bytes, each 0 means unspecified */
+ afs_int32 spare2)
{
afs_int32 code;
Date now;
return KABADARGUMENT; /* arguments no good */
if (!name_instance_legal(aname, ainstance))
return KABADNAME;
- if (code = InitAuthServ(&tt, LOCKWRITE, this_op))
+ if ((code = InitAuthServ(&tt, LOCKWRITE, this_op)))
return code;
code = check_auth(call, tt, 1, &caller);
if (code) {
delta = -1;
else
delta = 1;
- if (code = update_admin_count(tt, delta))
+ if ((code = update_admin_count(tt, delta)))
goto abort;
}
tentry.flags =
htonl((ntohl(tentry.flags) & ~KAF_SETTABLE_FLAGS) | aflags);
}
- if (code = get_time(&now, tt, 1))
+ if ((code = get_time(&now, tt, 1)))
goto abort;
if (aexpiration) {
tentry.user_expiration = htonl(aexpiration);
/* delete a user */
afs_int32
-SKAM_DeleteUser(call, aname, ainstance)
- struct rx_call *call;
- char *aname;
- char *ainstance;
+SKAM_DeleteUser(struct rx_call *call, char *aname, char *ainstance)
{
afs_int32 code;
}
afs_int32
-kamDeleteUser(call, aname, ainstance)
- struct rx_call *call;
- char *aname;
- char *ainstance;
+kamDeleteUser(struct rx_call *call, char *aname, char *ainstance)
{
register int code;
struct ubik_trans *tt;
COUNT_REQ(DeleteUser);
if (!name_instance_legal(aname, ainstance))
return KABADNAME;
- if (code = InitAuthServ(&tt, LOCKWRITE, this_op))
+ if ((code = InitAuthServ(&tt, LOCKWRITE, this_op)))
return code;
code = check_auth(call, tt, 1, &caller);
if (code) {
/* track all AuthServer identities */
if (special_name(aname, ainstance))
- if (code = ka_DelKey(tt, to, &tentry))
+ if ((code = ka_DelKey(tt, to, &tentry)))
goto abort;
if (ntohl(tentry.flags) & KAFADMIN) /* keep admin count up-to-date */
- if (code = update_admin_count(tt, -1))
+ if ((code = update_admin_count(tt, -1)))
goto abort;
if ((code = UnthreadBlock(tt, &tentry)) || (code = FreeBlock(tt, to)) || (code = get_time(0, tt, 1)) /* update randomness */
* will be unlocked.
*/
afs_int32
-SKAM_GetEntry(call, aname, ainstance, aversion, aentry)
- struct rx_call *call;
- char *aname;
- char *ainstance;
- afs_int32 aversion; /* major version assumed by caller */
- kaentryinfo *aentry; /* entry data copied here */
+SKAM_GetEntry(struct rx_call *call,
+ char *aname,
+ char *ainstance,
+ afs_int32 aversion, /* major version assumed by caller */
+ kaentryinfo *aentry) /* entry data copied here */
{
afs_int32 code;
}
afs_int32
-kamGetEntry(call, aname, ainstance, aversion, aentry)
- struct rx_call *call;
- char *aname;
- char *ainstance;
- afs_int32 aversion; /* major version assumed by caller */
- kaentryinfo *aentry; /* entry data copied here */
+kamGetEntry(struct rx_call *call,
+ char *aname,
+ char *ainstance,
+ afs_int32 aversion, /* major version assumed by caller */
+ kaentryinfo *aentry) /* entry data copied here */
{
register afs_int32 code;
struct ubik_trans *tt;
return KAOLDINTERFACE;
if (!name_instance_legal(aname, ainstance))
return KABADNAME;
- if (code = InitAuthServ(&tt, LOCKREAD, this_op))
+ if ((code = InitAuthServ(&tt, LOCKREAD, this_op)))
return code;
code = check_auth(call, tt, 0, &callerIndex);
if (code) {
code = KANOENT;
goto abort;
} else {
- if (code = karead(tt, callerIndex, &caller, sizeof(caller))) {
+ if ((code = karead(tt, callerIndex, &caller, sizeof(caller)))) {
code = KAIO;
goto abort;
}
}
afs_int32
-SKAM_ListEntry(call, previous_index, index, count, name)
- struct rx_call *call;
- afs_int32 previous_index; /* last entry ret'd or 0 for first */
- afs_int32 *index; /* index of this entry */
- afs_int32 *count; /* total entries in database */
- kaident *name; /* name & instance of this entry */
+SKAM_ListEntry(struct rx_call *call,
+ afs_int32 previous_index, /* last entry ret'd or 0 for first */
+ afs_int32 *index, /* index of this entry */
+ afs_int32 *count, /* total entries in database */
+ kaident *name) /* name & instance of this entry */
{
afs_int32 code;
afs_int32
-kamListEntry(call, previous_index, index, count, name)
- struct rx_call *call;
- afs_int32 previous_index; /* last entry ret'd or 0 for first */
- afs_int32 *index; /* index of this entry */
- afs_int32 *count; /* total entries in database */
- kaident *name; /* name & instance of this entry */
+kamListEntry(struct rx_call *call,
+ afs_int32 previous_index, /* last entry ret'd or 0 for first */
+ afs_int32 *index, /* index of this entry */
+ afs_int32 *count, /* total entries in database */
+ kaident *name) /* name & instance of this entry */
{
register int code;
struct ubik_trans *tt;
struct kaentry tentry;
COUNT_REQ(ListEntry);
- if (code = InitAuthServ(&tt, LOCKREAD, this_op))
+ if ((code = InitAuthServ(&tt, LOCKREAD, this_op)))
return code;
code = check_auth(call, tt, 1, &caller);
if (code) {
}
static afs_int32
-GetTicket(version, call, kvno, authDomain, aticket, sname, sinstance, atimes,
- oanswer)
- int version;
- struct rx_call *call;
- afs_int32 kvno;
- char *authDomain;
- ka_CBS *aticket;
- char *sname;
- char *sinstance;
- ka_CBS *atimes; /* encrypted start & end time */
- ka_BBS *oanswer;
+GetTicket(int version,
+ struct rx_call *call,
+ afs_int32 kvno,
+ char *authDomain,
+ ka_CBS *aticket,
+ char *sname,
+ char *sinstance,
+ ka_CBS *atimes, /* encrypted start & end time */
+ ka_BBS *oanswer)
{
afs_int32 code;
int import, export;
return KABADNAME;
if (atimes->SeqLen != sizeof(times))
return KABADARGUMENT;
- if (code = InitAuthServ(&tt, LOCKREAD, this_op))
+ if ((code = InitAuthServ(&tt, LOCKREAD, this_op)))
return code;
export = import = 0;
}
save_principal(tgsPrincipal, name, instance, cell);
- if (code = get_time(&now, 0, 0))
+ if ((code = get_time(&now, 0, 0)))
goto abort;
code = tkt_CheckTimes(start, expiration, now);
}
afs_int32
-SKAT_GetTicket_old(call, kvno, authDomain, aticket, sname, sinstance, atimes,
- oanswer)
- struct rx_call *call;
- afs_int32 kvno;
- char *authDomain;
- ka_CBS *aticket;
- char *sname;
- char *sinstance;
- ka_CBS *atimes; /* encrypted start & end time */
- ka_BBS *oanswer;
+SKAT_GetTicket_old(struct rx_call *call,
+ afs_int32 kvno,
+ char *authDomain,
+ ka_CBS *aticket,
+ char *sname,
+ char *sinstance,
+ ka_CBS *atimes, /* encrypted start & end time */
+ ka_BBS *oanswer)
{
int code;
}
afs_int32
-SKAT_GetTicket(call, kvno, authDomain, aticket, sname, sinstance, atimes,
- oanswer)
- struct rx_call *call;
- afs_int32 kvno;
- char *authDomain;
- ka_CBS *aticket;
- char *sname;
- char *sinstance;
- ka_CBS *atimes; /* encrypted start & end time */
- ka_BBS *oanswer;
+SKAT_GetTicket(struct rx_call *call,
+ afs_int32 kvno,
+ char *authDomain,
+ ka_CBS *aticket,
+ char *sname,
+ char *sinstance,
+ ka_CBS *atimes, /* encrypted start & end time */
+ ka_BBS *oanswer)
{
int code;
}
afs_int32
-SKAM_GetStats(call, version, admin_accounts, statics, dynamics)
- struct rx_call *call;
- afs_int32 version;
- afs_int32 *admin_accounts;
- kasstats *statics;
- kadstats *dynamics;
+SKAM_GetStats(struct rx_call *call, afs_int32 version,
+ afs_int32 *admin_accounts, kasstats *statics,
+ kadstats *dynamics)
{
afs_int32 code;
}
afs_int32
-kamGetStats(call, version, admin_accounts, statics, dynamics)
- struct rx_call *call;
- afs_int32 version;
- afs_int32 *admin_accounts;
- kasstats *statics;
- kadstats *dynamics;
+kamGetStats(struct rx_call *call, afs_int32 version,
+ afs_int32 *admin_accounts, kasstats *statics,
+ kadstats *dynamics)
{
afs_int32 code;
struct ubik_trans *tt;
COUNT_REQ(GetStats);
if (version != KAMAJORVERSION)
return KAOLDINTERFACE;
- if (code = InitAuthServ(&tt, LOCKREAD, this_op))
+ if ((code = InitAuthServ(&tt, LOCKREAD, this_op)))
return code;
code = check_auth(call, tt, 1, &caller);
if (code) {
}
afs_int32
-SKAM_GetPassword(call, name, password)
- struct rx_call *call;
- char *name;
- EncryptionKey *password;
+SKAM_GetPassword(struct rx_call *call, char *name, EncryptionKey *password)
{
afs_int32 code;
}
afs_int32
-kamGetPassword(call, name, password)
- struct rx_call *call;
- char *name;
- EncryptionKey *password;
+kamGetPassword(struct rx_call *call, char *name, EncryptionKey *password)
{
int code = KANOAUTH;
COUNT_REQ(GetPassword);
}
afs_int32
-SKAM_GetRandomKey(call, key)
- struct rx_call *call;
- EncryptionKey *key;
+SKAM_GetRandomKey(struct rx_call *call, EncryptionKey *key)
{
afs_int32 code;
}
afs_int32
-kamGetRandomKey(call, key)
- struct rx_call *call;
- EncryptionKey *key;
+kamGetRandomKey(struct rx_call *call, EncryptionKey *key)
{
int code;
COUNT_REQ(GetRandomKey);
- if (code = AwaitInitialization())
+ if ((code = AwaitInitialization()))
return code;
code = des_random_key(key);
if (code)
}
afs_int32
-SKAM_Debug(call, version, checkDB, info)
- struct rx_call *call;
- afs_int32 version;
- int checkDB; /* start a transaction to examine DB */
- struct ka_debugInfo *info;
+SKAM_Debug(struct rx_call *call,
+ afs_int32 version,
+ int checkDB, /* start a transaction to examine DB */
+ struct ka_debugInfo *info)
{
afs_int32 code;
}
afs_int32
-kamDebug(call, version, checkDB, info)
- struct rx_call *call;
- afs_int32 version;
- int checkDB; /* start a transaction to examine DB */
- struct ka_debugInfo *info;
+kamDebug(struct rx_call *call,
+ afs_int32 version,
+ int checkDB, /* start a transaction to examine DB */
+ struct ka_debugInfo *info)
{
/* COUNT_REQ (Debug); */
if (sizeof(struct kaentry) != sizeof(struct kaOldKeys))
* a tacked-on-the-side data file.
* prob'ly ought to check the noauth flag.
*/
-#define ABORTIF(A) {if(code= A){goto abort;}}
+#define ABORTIF(A) {if((code = A)){goto abort;}}
afs_int32
-SKAM_Unlock(call, aname, ainstance, spare1, spare2, spare3, spare4)
- struct rx_call *call;
- char *aname;
- char *ainstance;
- afs_int32 spare1, spare2, spare3, spare4;
+SKAM_Unlock(struct rx_call *call,
+ char *aname,
+ char *ainstance,
+ afs_int32 spare1,
+ afs_int32 spare2,
+ afs_int32 spare3,
+ afs_int32 spare4)
{
register int code;
struct ubik_trans *tt;
code = KABADNAME;
goto exit;
}
- if (code = InitAuthServ(&tt, LOCKREAD, this_op))
+ if ((code = InitAuthServ(&tt, LOCKREAD, this_op)))
goto exit;
ABORTIF(check_auth(call, tt, 1, &caller));
}
afs_int32
-SKAM_LockStatus(call, aname, ainstance, lockeduntil, spare1, spare2, spare3,
- spare4)
- struct rx_call *call;
- char *aname;
- char *ainstance;
- afs_int32 *lockeduntil;
- afs_int32 spare1, spare2, spare3, spare4;
+SKAM_LockStatus(struct rx_call *call,
+ char *aname,
+ char *ainstance,
+ afs_int32 *lockeduntil,
+ afs_int32 spare1,
+ afs_int32 spare2,
+ afs_int32 spare3,
+ afs_int32 spare4)
{
register int code;
struct ubik_trans *tt;
code = KABADNAME;
goto exit;
}
- if (code = InitAuthServ(&tt, LOCKREAD, this_op))
+ if ((code = InitAuthServ(&tt, LOCKREAD, this_op)))
goto exit;
- if (code = check_auth(call, tt, 0, &callerIndex))
+ if ((code = check_auth(call, tt, 0, &callerIndex)))
goto abort;
if (!noAuthenticationRequired && callerIndex) {
}
}
- if (code = FindBlock(tt, aname, ainstance, &to, &tentry))
+ if ((code = FindBlock(tt, aname, ainstance, &to, &tentry)))
goto abort;
if (to == 0) {