source:
trunk/debathena/third/alpine/alpine-1.00-krb4-build.patch
@
23068
Revision 23068, 5.6 KB checked in by ghudson, 16 years ago (diff) |
---|
-
imap/Makefile
diff -ur alpine-1.00+kerberos4/imap/Makefile alpine-1.00+athena-krb4/imap/Makefile
old new 660 660 $(TOOLS)/$@ "$(LN)" src/c-client c-client 661 661 $(TOOLS)/$@ "$(LN)" src/ansilib c-client 662 662 $(TOOLS)/$@ "$(LN)" src/charset c-client 663 sh -c '(test -d src/kerberos) && ($(LN) `pwd`/src/kerberos/* c-client) || true' 663 664 $(TOOLS)/$@ "$(LN)" src/osdep/$(SYSTEM) c-client 664 665 $(TOOLS)/$@ "$(LN)" src/mtest mtest 665 666 $(TOOLS)/$@ "$(LN)" src/ipopd ipopd -
imap/src/kerberos/acte_krb.c
diff -ur alpine-1.00+kerberos4/imap/src/kerberos/acte_krb.c alpine-1.00+athena-krb4/imap/src/kerberos/acte_krb.c
old new 27 27 * 28 28 */ 29 29 #include <stdio.h> 30 #include <stdlib.h> 30 31 #include <string.h> 31 32 #include <netdb.h> 32 33 #include <sys/types.h> … … 36 37 37 38 #include "acte.h" 38 39 39 extern char *malloc();40 41 extern char *lcase P((char *str));42 43 40 #ifndef HAVE_KRB_GET_PHOST 44 41 extern char *krb_get_phost P((char *)); 45 42 #endif … … 762 759 } 763 760 #endif /* !NOPRIVACY */ 764 761 765 #ifndef HAVE_AFS_STRING_TO_KEY766 767 static afs_string_to_key P((char *str, des_cblock *key, char *cell));768 769 #endif770 771 762 /* 772 763 * Kerberos set srvtab filename 773 764 * Accepts: name of srvtab file to use in reading authenticators … … 838 829 /* Now try andrew string-to-key */ 839 830 strcpy(cell, realm); 840 831 lcase(cell); 841 afs_string_to_key(passwd, &key, cell);832 afs_string_to_key(passwd, cell, &key); 842 833 843 834 result = krb_get_in_tkt(user, "", realm, 844 835 "krbtgt", realm, 1, use_key, NULL, key); … … 881 872 dest_tkt(); 882 873 return result; 883 874 } 884 885 /* andrewstk.c -- afs string to key function886 *887 * Code taken from AuthMan from University of Michigan888 */889 890 /* forward declarations */891 #ifndef HAVE_AFS_STRING_TO_KEY892 static afs_transarc_StringToKey P((char *str, char *cell, des_cblock *key));893 static afs_cmu_StringToKey P((char *str, char *cell, des_cblock *key));894 #endif895 896 extern char *crypt();897 898 #ifndef HAVE_AFS_STRING_TO_KEY899 900 /* This defines the Andrew string_to_key function. It accepts a password901 * string as input and converts its via a one-way encryption algorithm to a DES902 * encryption key. It is compatible with the original Andrew authentication903 * service password database.904 */905 906 static907 afs_cmu_StringToKey (str, cell, key)908 char *str;909 char *cell; /* cell for password */910 des_cblock *key;911 { char password[8+1]; /* crypt is limited to 8 chars anyway */912 int i;913 int passlen;914 915 memset(key, 0, sizeof(des_cblock));916 memset((void *)password, 0, sizeof(password));917 918 strncpy (password, cell, 8);919 passlen = strlen (str);920 if (passlen > 8) passlen = 8;921 922 for (i=0; i<passlen; i++)923 password[i] = str[i] ^ cell[i];924 925 for (i=0;i<8;i++)926 if (password[i] == '\0') password[i] = 'X';927 928 /* crypt only considers the first 8 characters of password but for some929 reason returns eleven characters of result (plus the two salt chars). */930 strncpy((void *)key, crypt(password, "p1") + 2, sizeof(des_cblock));931 932 /* parity is inserted into the LSB so leftshift each byte up one bit. This933 allows ascii characters with a zero MSB to retain as much significance934 as possible. */935 { char *keybytes = (char *)key;936 unsigned int temp;937 938 for (i = 0; i < 8; i++) {939 temp = (unsigned int) keybytes[i];940 keybytes[i] = (unsigned char) (temp << 1);941 }942 }943 des_fixup_key_parity (key);944 }945 946 static947 afs_transarc_StringToKey (str, cell, key)948 char *str;949 char *cell; /* cell for password */950 des_cblock *key;951 { des_key_schedule schedule;952 char temp_key[8];953 char ivec[8];954 char password[BUFSIZ];955 int passlen;956 957 strncpy (password, str, sizeof(password));958 if ((passlen = strlen (password)) < sizeof(password)-1)959 strncat (password, cell, sizeof(password)-passlen);960 if ((passlen = strlen(password)) > sizeof(password)) passlen = sizeof(password);961 962 memcpy (ivec, "kerberos", 8);963 memcpy (temp_key, "kerberos", 8);964 des_fixup_key_parity ((void *)temp_key);965 des_key_sched (temp_key, schedule);966 des_cbc_cksum (password, ivec, passlen, schedule, ivec);967 968 memcpy (temp_key, ivec, 8);969 des_fixup_key_parity ((void *)temp_key);970 des_key_sched (temp_key, schedule);971 des_cbc_cksum (password, (void *)key, passlen, schedule, ivec);972 973 des_fixup_key_parity (key);974 }975 976 static afs_string_to_key(str, key, cell)977 char *str;978 des_cblock *key;979 char *cell; /* cell for password */980 {981 if (strlen(str) > 8) {982 afs_transarc_StringToKey (str, cell, key);983 }984 else {985 afs_cmu_StringToKey (str, cell, key);986 }987 }988 989 #endif /* ifndef HAVE_AFS_STRING_TO_KEY */990 991 -
imap/src/kerberos/Makefile.krb
diff -ur alpine-1.00+kerberos4/imap/src/kerberos/Makefile.krb alpine-1.00+athena-krb4/imap/src/kerberos/Makefile.krb
old new 34 34 # Extended flags needed for additional authenticators. You may need to modify. 35 35 36 36 KRBCFLAGS= -I/usr/include/kerberosIV -DHAVE_AFS_STRING_TO_KEY -DHAVE_KRB_GET_PHOST -DHAVE_KRB_REALMOFHOST 37 KRBLDFLAGS= -lkrb -ldes37 KRBLDFLAGS= -lkrb4 -ldes425 -lkrb5 -lk5crypto -lcom_err 38 38 39 39 krb: # Kerberos IV flags 40 40 echo $(KRBCFLAGS) >> OSCFLAGS
Note: See TracBrowser
for help on using the repository browser.