rx_securityClass-20021016
[openafs.git] / src / auth / authcon.c
index a177490..f532e45 100644 (file)
@@ -1,36 +1,34 @@
-/* Copyright (C) 1990 Transarc Corporation - All rights reserved */
 /*
- * (C) COPYRIGHT IBM CORPORATION 1988, 1989
- * LICENSED MATERIALS - PROPERTY OF IBM
- */
-/*
- * Revision 2.3  90/08/31  16:11:49
- * Move permit_xprt.h.
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
  * 
- * Revision 2.2  90/08/20  10:05:54
- * Include permit_xprt.h.
- * Use stds.h.
- * 
- * Revision 2.1  90/08/07  18:51:45
- * Start with clean version to sync test and dev trees.
- * */
-/* See RCS log for older history. */
+ * This software has been released under the terms of the IBM Public
+ * License.  For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ */
 
+#include <afsconfig.h>
 #if defined(UKERNEL)
-#include "../afs/param.h"
-#include "../afs/sysincludes.h"
-#include "../afs/afsincludes.h"
-#include "../afs/stds.h"
-#include "../afs/pthread_glock.h"
-#include "../des/des.h"
-#include "../rx/rxkad.h"
-#include "../rx/rx.h"
-#include "../afs/cellconfig.h"
-#include "../afs/keys.h"
-#include "../afs/auth.h"
-#include "../afs/pthread_glock.h"
-#else /* defined(UKERNEL) */
+#include "afs/param.h"
+#else
 #include <afs/param.h>
+#endif
+
+RCSID("$Header$");
+
+#if defined(UKERNEL)
+#include "afs/sysincludes.h"
+#include "afsincludes.h"
+#include "afs/stds.h"
+#include "afs/pthread_glock.h"
+#include "des/des.h"
+#include "rx/rxkad.h"
+#include "rx/rx.h"
+#include "afs/cellconfig.h"
+#include "afs/keys.h"
+#include "afs/auth.h"
+#include "afs/pthread_glock.h"
+#else /* defined(UKERNEL) */
 #include <afs/stds.h>
 #include <afs/pthread_glock.h>
 #include <sys/types.h>
 #include "auth.h"
 #endif /* defined(UKERNEL) */
 
-
-extern afs_int32 afsconf_Authenticate();
-extern int afsconf_GetKey();
-extern struct rx_securityClass *rxkad_NewServerSecurityObject();
-extern struct rx_securityClass *rxkad_NewClientSecurityObject();
-
-/*
- * Note: it is necessary for the #include of permit_xprt.h occur
- * AFTER the above declaration of rxkad_NewClientSecurityObject() --
- * otherwise, depending on the version of permit_xprt.h that gets
- * included, there might be a syntax error.
- */
-
-#if defined(UKERNEL)
-#include "../afs/permit_xprt.h"
-#else /* defined(UKERNEL) */
-#include "../permit_xprt.h"
-#endif /* defined(UKERNEL) */
-
-
-#if !defined(UKERNEL)
-int afsconf_CheckAuth(adir, acall)
-register struct rx_call *acall;
-register struct afsconf_dir *adir; {
-    LOCK_GLOBAL_MUTEX
-    return ((afsconf_SuperUser(adir, acall, (char *)0) == 0)? 10029 : 0);
-    UNLOCK_GLOBAL_MUTEX
-}
-#endif /* !defined(UKERNEL) */
-
 /* return a null security object if nothing else can be done */
 static afs_int32 QuickAuth(astr, aindex)
 struct rx_securityClass **astr;
 afs_int32 *aindex; {
     register struct rx_securityClass *tc;
-    tc = (struct rx_securityClass *) rxnull_NewClientSecurityObject();
+    tc = rxnull_NewClientSecurityObject();
     *astr = tc;
     *aindex = 0;
     return 0;
@@ -101,7 +69,7 @@ afs_int32 *aindex; {
     
     LOCK_GLOBAL_MUTEX
     tclass = (struct rx_securityClass *)
-       rxkad_NewServerSecurityObject(0, adir, afsconf_GetKey, (char *) 0);
+       rxkad_NewServerSecurityObject(0, adir, afsconf_GetKey, NULL);
     if (tclass) {
        *astr = tclass;
        *aindex = 2;    /* kerberos security index */
@@ -125,9 +93,7 @@ rxkad_level enclevel; {
     struct rx_securityClass *tclass;
     afs_int32 kvno;
     afs_int32 ticketLen;
-    struct timeval tv;
-    Key_schedule schedule;
-    register afs_int32 i, code;
+    register afs_int32 code;
     
     /* first, find the right key and kvno to use */
     code = afsconf_GetLatestKey(adir, &kvno, &key);
@@ -168,10 +134,9 @@ rxkad_level enclevel; {
 /* build a fake ticket for 'afs' using keys from adir, returning an
  * appropriate security class and index
  */
-afs_int32 afsconf_ClientAuth(adir, astr, aindex)
-struct afsconf_dir *adir;
-struct rx_securityClass **astr;
-afs_int32 *aindex; {
+afs_int32 afsconf_ClientAuth(struct afsconf_dir *adir, 
+       struct rx_securityClass **astr, afs_int32 *aindex)
+{
     afs_int32 rc;
 
     LOCK_GLOBAL_MUTEX