[23068] | 1 | diff -ur alpine-1.00+kerberos4/imap/Makefile alpine-1.00+athena-krb4/imap/Makefile |
---|
| 2 | --- alpine-1.00+kerberos4/imap/Makefile 2007-12-20 17:18:28.000000000 -0500 |
---|
| 3 | +++ alpine-1.00+athena-krb4/imap/Makefile 2008-04-16 16:08:10.000000000 -0400 |
---|
| 4 | @@ -660,6 +660,7 @@ |
---|
| 5 | $(TOOLS)/$@ "$(LN)" src/c-client c-client |
---|
| 6 | $(TOOLS)/$@ "$(LN)" src/ansilib c-client |
---|
| 7 | $(TOOLS)/$@ "$(LN)" src/charset c-client |
---|
| 8 | + sh -c '(test -d src/kerberos) && ($(LN) `pwd`/src/kerberos/* c-client) || true' |
---|
| 9 | $(TOOLS)/$@ "$(LN)" src/osdep/$(SYSTEM) c-client |
---|
| 10 | $(TOOLS)/$@ "$(LN)" src/mtest mtest |
---|
| 11 | $(TOOLS)/$@ "$(LN)" src/ipopd ipopd |
---|
| 12 | diff -ur alpine-1.00+kerberos4/imap/src/kerberos/acte_krb.c alpine-1.00+athena-krb4/imap/src/kerberos/acte_krb.c |
---|
| 13 | --- alpine-1.00+kerberos4/imap/src/kerberos/acte_krb.c 2002-01-16 21:36:02.000000000 -0500 |
---|
| 14 | +++ alpine-1.00+athena-krb4/imap/src/kerberos/acte_krb.c 2008-04-16 16:08:10.000000000 -0400 |
---|
| 15 | @@ -27,6 +27,7 @@ |
---|
| 16 | * |
---|
| 17 | */ |
---|
| 18 | #include <stdio.h> |
---|
| 19 | +#include <stdlib.h> |
---|
| 20 | #include <string.h> |
---|
| 21 | #include <netdb.h> |
---|
| 22 | #include <sys/types.h> |
---|
| 23 | @@ -36,10 +37,6 @@ |
---|
| 24 | |
---|
| 25 | #include "acte.h" |
---|
| 26 | |
---|
| 27 | -extern char *malloc(); |
---|
| 28 | - |
---|
| 29 | -extern char *lcase P((char *str)); |
---|
| 30 | - |
---|
| 31 | #ifndef HAVE_KRB_GET_PHOST |
---|
| 32 | extern char *krb_get_phost P((char *)); |
---|
| 33 | #endif |
---|
| 34 | @@ -762,12 +759,6 @@ |
---|
| 35 | } |
---|
| 36 | #endif /* !NOPRIVACY */ |
---|
| 37 | |
---|
| 38 | -#ifndef HAVE_AFS_STRING_TO_KEY |
---|
| 39 | - |
---|
| 40 | -static afs_string_to_key P((char *str, des_cblock *key, char *cell)); |
---|
| 41 | - |
---|
| 42 | -#endif |
---|
| 43 | - |
---|
| 44 | /* |
---|
| 45 | * Kerberos set srvtab filename |
---|
| 46 | * Accepts: name of srvtab file to use in reading authenticators |
---|
| 47 | @@ -838,7 +829,7 @@ |
---|
| 48 | /* Now try andrew string-to-key */ |
---|
| 49 | strcpy(cell, realm); |
---|
| 50 | lcase(cell); |
---|
| 51 | - afs_string_to_key(passwd, &key, cell); |
---|
| 52 | + afs_string_to_key(passwd, cell, &key); |
---|
| 53 | |
---|
| 54 | result = krb_get_in_tkt(user, "", realm, |
---|
| 55 | "krbtgt", realm, 1, use_key, NULL, key); |
---|
| 56 | @@ -881,111 +872,3 @@ |
---|
| 57 | dest_tkt(); |
---|
| 58 | return result; |
---|
| 59 | } |
---|
| 60 | - |
---|
| 61 | -/* andrewstk.c -- afs string to key function |
---|
| 62 | - * |
---|
| 63 | - * Code taken from AuthMan from University of Michigan |
---|
| 64 | - */ |
---|
| 65 | - |
---|
| 66 | -/* forward declarations */ |
---|
| 67 | -#ifndef HAVE_AFS_STRING_TO_KEY |
---|
| 68 | -static afs_transarc_StringToKey P((char *str, char *cell, des_cblock *key)); |
---|
| 69 | -static afs_cmu_StringToKey P((char *str, char *cell, des_cblock *key)); |
---|
| 70 | -#endif |
---|
| 71 | - |
---|
| 72 | -extern char *crypt(); |
---|
| 73 | - |
---|
| 74 | -#ifndef HAVE_AFS_STRING_TO_KEY |
---|
| 75 | - |
---|
| 76 | -/* This defines the Andrew string_to_key function. It accepts a password |
---|
| 77 | - * string as input and converts its via a one-way encryption algorithm to a DES |
---|
| 78 | - * encryption key. It is compatible with the original Andrew authentication |
---|
| 79 | - * service password database. |
---|
| 80 | - */ |
---|
| 81 | - |
---|
| 82 | -static |
---|
| 83 | -afs_cmu_StringToKey (str, cell, key) |
---|
| 84 | -char *str; |
---|
| 85 | -char *cell; /* cell for password */ |
---|
| 86 | -des_cblock *key; |
---|
| 87 | -{ char password[8+1]; /* crypt is limited to 8 chars anyway */ |
---|
| 88 | - int i; |
---|
| 89 | - int passlen; |
---|
| 90 | - |
---|
| 91 | - memset(key, 0, sizeof(des_cblock)); |
---|
| 92 | - memset((void *)password, 0, sizeof(password)); |
---|
| 93 | - |
---|
| 94 | - strncpy (password, cell, 8); |
---|
| 95 | - passlen = strlen (str); |
---|
| 96 | - if (passlen > 8) passlen = 8; |
---|
| 97 | - |
---|
| 98 | - for (i=0; i<passlen; i++) |
---|
| 99 | - password[i] = str[i] ^ cell[i]; |
---|
| 100 | - |
---|
| 101 | - for (i=0;i<8;i++) |
---|
| 102 | - if (password[i] == '\0') password[i] = 'X'; |
---|
| 103 | - |
---|
| 104 | - /* crypt only considers the first 8 characters of password but for some |
---|
| 105 | - reason returns eleven characters of result (plus the two salt chars). */ |
---|
| 106 | - strncpy((void *)key, crypt(password, "p1") + 2, sizeof(des_cblock)); |
---|
| 107 | - |
---|
| 108 | - /* parity is inserted into the LSB so leftshift each byte up one bit. This |
---|
| 109 | - allows ascii characters with a zero MSB to retain as much significance |
---|
| 110 | - as possible. */ |
---|
| 111 | - { char *keybytes = (char *)key; |
---|
| 112 | - unsigned int temp; |
---|
| 113 | - |
---|
| 114 | - for (i = 0; i < 8; i++) { |
---|
| 115 | - temp = (unsigned int) keybytes[i]; |
---|
| 116 | - keybytes[i] = (unsigned char) (temp << 1); |
---|
| 117 | - } |
---|
| 118 | - } |
---|
| 119 | - des_fixup_key_parity (key); |
---|
| 120 | -} |
---|
| 121 | - |
---|
| 122 | -static |
---|
| 123 | -afs_transarc_StringToKey (str, cell, key) |
---|
| 124 | -char *str; |
---|
| 125 | -char *cell; /* cell for password */ |
---|
| 126 | -des_cblock *key; |
---|
| 127 | -{ des_key_schedule schedule; |
---|
| 128 | - char temp_key[8]; |
---|
| 129 | - char ivec[8]; |
---|
| 130 | - char password[BUFSIZ]; |
---|
| 131 | - int passlen; |
---|
| 132 | - |
---|
| 133 | - strncpy (password, str, sizeof(password)); |
---|
| 134 | - if ((passlen = strlen (password)) < sizeof(password)-1) |
---|
| 135 | - strncat (password, cell, sizeof(password)-passlen); |
---|
| 136 | - if ((passlen = strlen(password)) > sizeof(password)) passlen = sizeof(password); |
---|
| 137 | - |
---|
| 138 | - memcpy (ivec, "kerberos", 8); |
---|
| 139 | - memcpy (temp_key, "kerberos", 8); |
---|
| 140 | - des_fixup_key_parity ((void *)temp_key); |
---|
| 141 | - des_key_sched (temp_key, schedule); |
---|
| 142 | - des_cbc_cksum (password, ivec, passlen, schedule, ivec); |
---|
| 143 | - |
---|
| 144 | - memcpy (temp_key, ivec, 8); |
---|
| 145 | - des_fixup_key_parity ((void *)temp_key); |
---|
| 146 | - des_key_sched (temp_key, schedule); |
---|
| 147 | - des_cbc_cksum (password, (void *)key, passlen, schedule, ivec); |
---|
| 148 | - |
---|
| 149 | - des_fixup_key_parity (key); |
---|
| 150 | -} |
---|
| 151 | - |
---|
| 152 | -static afs_string_to_key(str, key, cell) |
---|
| 153 | -char *str; |
---|
| 154 | -des_cblock *key; |
---|
| 155 | -char *cell; /* cell for password */ |
---|
| 156 | -{ |
---|
| 157 | - if (strlen(str) > 8) { |
---|
| 158 | - afs_transarc_StringToKey (str, cell, key); |
---|
| 159 | - } |
---|
| 160 | - else { |
---|
| 161 | - afs_cmu_StringToKey (str, cell, key); |
---|
| 162 | - } |
---|
| 163 | -} |
---|
| 164 | - |
---|
| 165 | -#endif /* ifndef HAVE_AFS_STRING_TO_KEY */ |
---|
| 166 | - |
---|
| 167 | - |
---|
| 168 | diff -ur alpine-1.00+kerberos4/imap/src/kerberos/Makefile.krb alpine-1.00+athena-krb4/imap/src/kerberos/Makefile.krb |
---|
| 169 | --- alpine-1.00+kerberos4/imap/src/kerberos/Makefile.krb 2000-02-03 10:58:29.000000000 -0500 |
---|
| 170 | +++ alpine-1.00+athena-krb4/imap/src/kerberos/Makefile.krb 2008-04-16 16:08:10.000000000 -0400 |
---|
| 171 | @@ -34,7 +34,7 @@ |
---|
| 172 | # Extended flags needed for additional authenticators. You may need to modify. |
---|
| 173 | |
---|
| 174 | KRBCFLAGS= -I/usr/include/kerberosIV -DHAVE_AFS_STRING_TO_KEY -DHAVE_KRB_GET_PHOST -DHAVE_KRB_REALMOFHOST |
---|
| 175 | -KRBLDFLAGS= -lkrb -ldes |
---|
| 176 | +KRBLDFLAGS= -lkrb4 -ldes425 -lkrb5 -lk5crypto -lcom_err |
---|
| 177 | |
---|
| 178 | krb: # Kerberos IV flags |
---|
| 179 | echo $(KRBCFLAGS) >> OSCFLAGS |
---|