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)
Add a debathenify script for alpine. Currently only works for hardy and lenny.
  • imap/Makefile

    diff -ur alpine-1.00+kerberos4/imap/Makefile alpine-1.00+athena-krb4/imap/Makefile
    old new  
    660660        $(TOOLS)/$@ "$(LN)" src/c-client c-client 
    661661        $(TOOLS)/$@ "$(LN)" src/ansilib c-client 
    662662        $(TOOLS)/$@ "$(LN)" src/charset c-client 
     663        sh -c '(test -d src/kerberos) && ($(LN) `pwd`/src/kerberos/* c-client) || true' 
    663664        $(TOOLS)/$@ "$(LN)" src/osdep/$(SYSTEM) c-client 
    664665        $(TOOLS)/$@ "$(LN)" src/mtest mtest 
    665666        $(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  
    2727 * 
    2828 */ 
    2929#include <stdio.h> 
     30#include <stdlib.h> 
    3031#include <string.h> 
    3132#include <netdb.h> 
    3233#include <sys/types.h> 
     
    3637 
    3738#include "acte.h" 
    3839 
    39 extern char *malloc(); 
    40  
    41 extern char *lcase P((char *str)); 
    42  
    4340#ifndef HAVE_KRB_GET_PHOST 
    4441extern char *krb_get_phost P((char *)); 
    4542#endif 
     
    762759} 
    763760#endif /* !NOPRIVACY */ 
    764761 
    765 #ifndef HAVE_AFS_STRING_TO_KEY 
    766  
    767 static afs_string_to_key P((char *str, des_cblock *key, char *cell)); 
    768  
    769 #endif 
    770  
    771762/* 
    772763 * Kerberos set srvtab filename 
    773764 * Accepts: name of srvtab file to use in reading authenticators 
     
    838829        /* Now try andrew string-to-key */ 
    839830        strcpy(cell, realm); 
    840831        lcase(cell); 
    841         afs_string_to_key(passwd, &key, cell); 
     832        afs_string_to_key(passwd, cell, &key); 
    842833     
    843834        result = krb_get_in_tkt(user, "", realm, 
    844835                                "krbtgt", realm, 1, use_key, NULL, key); 
     
    881872    dest_tkt(); 
    882873    return result; 
    883874} 
    884  
    885 /* andrewstk.c -- afs string to key function 
    886  * 
    887  * Code taken from AuthMan from University of Michigan 
    888  */ 
    889  
    890 /* forward declarations */ 
    891 #ifndef HAVE_AFS_STRING_TO_KEY 
    892 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 #endif 
    895  
    896 extern char *crypt(); 
    897  
    898 #ifndef HAVE_AFS_STRING_TO_KEY 
    899  
    900 /* This defines the Andrew string_to_key function.  It accepts a password 
    901  * string as input and converts its via a one-way encryption algorithm to a DES 
    902  * encryption key.  It is compatible with the original Andrew authentication 
    903  * service password database. 
    904  */ 
    905  
    906 static 
    907 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 some 
    929        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.  This 
    933        allows ascii characters with a zero MSB to retain as much significance 
    934        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 static 
    947 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  
    3434# Extended flags needed for additional authenticators.  You may need to modify. 
    3535 
    3636KRBCFLAGS= -I/usr/include/kerberosIV -DHAVE_AFS_STRING_TO_KEY -DHAVE_KRB_GET_PHOST -DHAVE_KRB_REALMOFHOST 
    37 KRBLDFLAGS= -lkrb -ldes 
     37KRBLDFLAGS= -lkrb4 -ldes425 -lkrb5 -lk5crypto -lcom_err 
    3838 
    3939krb:    # Kerberos IV flags 
    4040        echo $(KRBCFLAGS) >> OSCFLAGS 
Note: See TracBrowser for help on using the repository browser.