Remove DUX/OSF code
[openafs.git] / src / kauth / user.c
index e9b32e6..14cd1b0 100644 (file)
 
 #include <afsconfig.h>
 #include <afs/param.h>
+#include <afs/stds.h>
 
+#include <roken.h>
+
+#include <hcrypto/des.h>
+#include <hcrypto/ui.h>
 
-#include <afs/stds.h>
-#include <signal.h>
 #include <afs/com_err.h>
-#ifdef AFS_NT40_ENV
-#include <winsock2.h>
-#else
-#include <netinet/in.h>
-#include <unistd.h>
-#endif
-#include <string.h>
-#include <stdio.h>
 #include <afs/cellconfig.h>
 #include <afs/auth.h>
 #include <afs/ptint.h>
 #include <afs/ptuser.h>
 #include <afs/ptserver.h>
 #include <afs/afsutil.h>
-
-#ifndef UKERNEL
 #include <afs/sys_prototypes.h>
-#endif
 
-#include <des.h>
-#include <des_prototypes.h>
 #include <rx/rx.h>
 #include <rx/rx_globals.h>
 #include <rx/rxkad.h>          /* max ticket lifetime */
+#include <rx/rxkad_convert.h>
+
 #include "kauth.h"
 #include "kautils.h"
 #include <afs/ktc.h>
 
-
 afs_int32
 GetTickets(char *name, char *instance, char *realm,
           struct ktc_encryptionKey * key, Date lifetime,
@@ -141,9 +132,6 @@ ka_UserAuthenticateGeneral(afs_int32 flags, char *name, char *instance,
     int remainingTime = 0;
     struct ktc_encryptionKey key;
     afs_int32 code, dosetpag = 0;
-#if !defined(AFS_NT40_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_USR_LINUX20_ENV) && !defined(AFS_XBSD_ENV) || defined(AFS_FBSD_ENV)
-    void (*old)(int);
-#endif
 
     if (reasonP)
        *reasonP = "";
@@ -161,7 +149,7 @@ ka_UserAuthenticateGeneral(afs_int32 flags, char *name, char *instance,
     ka_StringToKey(password, realm, &key);
 
 /*
- * alarm is set by klogin and kpasswd only so ignore for
+ * alarm is set by kpasswd only so ignore for
  * NT
  */
 
@@ -177,29 +165,21 @@ ka_UserAuthenticateGeneral(afs_int32 flags, char *name, char *instance,
 
 #if !defined(AFS_NT40_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_USR_LINUX20_ENV) && (!defined(AFS_XBSD_ENV) || defined(AFS_FBSD_ENV))
     /* handle smoothly the case where no AFS system calls exists (yet) */
-    old = signal(SIGSYS, SIG_IGN);
+    (void)signal(SIGSYS, SIG_IGN);
 #endif
-#ifdef AFS_DECOSF_ENV
-    (void)signal(SIGTRAP, SIG_IGN);
-#endif /* AFS_DECOSF_ENV */
     if (instance == 0)
        instance = "";
     if (flags & KA_USERAUTH_ONLY_VERIFY) {
        code = ka_VerifyUserToken(name, instance, realm, &key);
        if (code == KABADREQUEST) {
-           des_string_to_key(password, ktc_to_cblockptr(&key));
+           DES_string_to_key(password, ktc_to_cblockptr(&key));
            code = ka_VerifyUserToken(name, instance, realm, &key);
        }
     } else {
-#ifdef AFS_DUX40_ENV
-       if (flags & KA_USERAUTH_DOSETPAG)
-           afs_setpag();
-#else
-#if !defined(UKERNEL) && !defined(AFS_NT40_ENV)
+#if !defined(AFS_NT40_ENV)
        if (flags & KA_USERAUTH_DOSETPAG)
            setpag();
 #endif
-#endif
        if (flags & KA_USERAUTH_DOSETPAG2)
            dosetpag = 1;
 #ifdef AFS_KERBEROS_ENV
@@ -212,7 +192,7 @@ ka_UserAuthenticateGeneral(afs_int32 flags, char *name, char *instance,
            GetTickets(name, instance, realm, &key, lifetime,
                       password_expires, dosetpag);
        if (code == KABADREQUEST) {
-           des_string_to_key(password, ktc_to_cblockptr(&key));
+           DES_string_to_key(password, ktc_to_cblockptr(&key));
            code =
                GetTickets(name, instance, realm, &key, lifetime,
                           password_expires, dosetpag);
@@ -253,7 +233,6 @@ ka_UserAuthenticate(char *name, char *instance, char *realm, char *password,
                                      reasonP);
 }
 
-#if !defined(UKERNEL)
 afs_int32
 ka_UserReadPassword(char *prompt, char *password, int plen, char **reasonP)
 {
@@ -264,7 +243,7 @@ ka_UserReadPassword(char *prompt, char *password, int plen, char **reasonP)
     code = ka_Init(0);
     if (code)
        return code;
-    code = read_pw_string(password, plen, prompt, 0);
+    code = UI_UTIL_read_pw_string(password, plen, prompt, 0);
     if (code)
        code = KAREADPW;
     else if (strlen(password) == 0)
@@ -277,7 +256,6 @@ ka_UserReadPassword(char *prompt, char *password, int plen, char **reasonP)
     }
     return code;
 }
-#endif /* !defined(UKERNEL) */
 
 afs_int32
 ka_VerifyUserPassword(afs_int32 version, char *name, char *instance,