Changes in / [168f8a9:633db30]


Ignore:
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • Makefile.am

    r3d9f4d3 r191d5e7  
    55     owl.h owl_perl.h config.h \
    66     owl.c \
    7      libzcrypt.a \
    87     $(GEN_C) $(GEN_H)
    98
    10 barnowl_bin_LDADD = libfaim/libfaim.a libzcrypt.a
     9barnowl_bin_LDADD = libfaim/libfaim.a
    1110
    1211tester_SOURCES = $(BASE_SRCS) \
    1312     owl.h owl_perl.h config.h \
    14      libzcrypt.a \
    1513     $(GEN_C) $(GEN_H) \
    1614     tester.c
    1715
    18 tester_LDADD = libfaim/libfaim.a libzcrypt.a
     16tester_LDADD = libfaim/libfaim.a
    1917
    2018TESTS=runtests.sh
    21 
    22 noinst_LIBRARIES = libzcrypt.a
    23 
    24 libzcrypt_a_SOURCES = zcrypt.c
    25 libzcrypt_a_CFLAGS  = -w
    2619
    2720CPPFLAGS = -I$(top_srcdir)/ \
     
    3225     perlconfig.c keys.c functions.c zwrite.c viewwin.c help.c filter.c \
    3326     regex.c history.c view.c dict.c variable.c filterelement.c pair.c \
    34      keypress.c keymap.c keybinding.c cmd.c context.c \
     27     keypress.c keymap.c keybinding.c cmd.c context.c zcrypt.c \
    3528     aim.c buddy.c buddylist.c style.c errqueue.c \
    3629     zbuddylist.c popexec.c obarray.c select.c wcwidth.c \
     
    5750        $(AM_V_GEN)perl $< $(filter-out $<,$+) > $@
    5851
    59 owl_prototypes.h.new: codelist.pl varstubs.c $(BASE_SRCS) zcrypt.c
     52owl_prototypes.h.new: codelist.pl varstubs.c $(BASE_SRCS)
    6053        $(AM_V_GEN)perl $< $(filter-out $<,$+) > $@
    6154
  • commands.c

    r3e96ff0 rfea5ddf  
    19871987#else
    19881988  owl_function_makemsg("This Owl does not support zcrypt");
     1989  return NULL;
    19891990#endif
    19901991}
  • configure.ac

    rd7cc50b r1c89df8  
    88AC_PROG_CC
    99
    10 dnl Check for Athena
    11 AC_MSG_CHECKING(for /usr/athena/include)
    12 if test -d /usr/athena/include; then
    13         CFLAGS=${CFLAGS}\ -I/usr/athena/include
    14         CPPFLAGS=${CPPFLAGS}\ -I/usr/athena/include
    15         AC_MSG_RESULT(yes)
    16 else
    17         AC_MSG_RESULT(no)
    18 fi
    19 AC_MSG_CHECKING(for /usr/athena/lib)
    20 if test -d /usr/athena/lib; then
    21         LDFLAGS=${LDFLAGS}\ -L/usr/athena/lib
    22         AC_MSG_RESULT(yes)
    23 else
    24         AC_MSG_RESULT(no)
    25 fi
    26 
    27 dnl Check for kerberosIV include
    28 AC_MSG_CHECKING(for kerberosIV)
    29 if test -d /usr/include/kerberosIV; then
    30         CFLAGS=${CFLAGS}\ -I/usr/include/kerberosIV
    31         CPPFLAGS=${CPPFLAGS}\ -I/usr/include/kerberosIV
    32         AC_MSG_RESULT(yes)
    33 elif test -d /usr/local/include/kerberosIV; then
    34         CFLAGS=${CFLAGS}\ -I/usr/local/include/kerberosIV
    35         CPPFLAGS=${CPPFLAGS}\ -I/usr/local/include/kerberosIV
    36         AC_MSG_RESULT(yes)
    37 elif test -d /usr/include/openssl; then
    38         CFLAGS=${CFLAGS}\ -I/usr/include/openssl
    39         CPPFLAGS=${CPPFLAGS}\ -I/usr/include/openssl
    40         AC_MSG_RESULT(OpenSSL DES found instead)
    41 else
    42         AC_MSG_RESULT(no)
    43 fi
    44 
    4510AC_ARG_WITH([stack-protector],
    4611  [AS_HELP_STRING([--with-stack-protector],
     
    5015
    5116AS_IF([test "x$with_stack_protector" != xno],
    52   [
    53     SAVE_CFLAGS=$CFLAGS
    54     CFLAGS="$CFLAGS -fstack-protector"
    55     AC_MSG_CHECKING(whether protection cflags work)
    56     AC_COMPILE_IFELSE(int i;,
    57         [AC_MSG_RESULT(yes)],
    58         [AC_MSG_RESULT(no)
    59         CFLAGS=$SAVE_CFLAGS
    60         if test "x$with_stack_protector" != xcheck; then
    61           AC_MSG_FAILURE([--with-stack-protector selected, but gcc does support it.])
    62         fi])
    63     AC_CHECK_LIB(ssp, __stack_chk_guard)
    64   ])
     17  [AX_C_CHECK_FLAG([-fstack-protector],[],[],
     18    [CFLAGS="$CFLAGS -fstack-protector"],
     19    [if test "x$with_stack_protector" != xcheck; then
     20       AC_MSG_FAILURE([--with-stack-protector selected, but gcc does support it.])
     21     fi
     22    ])])
    6523
    6624AC_CHECK_LIB(ncursesw, initscr,, AC_MSG_ERROR(No libncursesw found.))
    67 AC_CHECK_LIB(com_err, com_err)
    68 AC_CHECK_LIB(nsl, gethostbyname)
    69 AC_CHECK_LIB(socket, socket)
    70 dnl AC_CHECK_LIB(des425, req_act_vno)
    71 AC_CHECK_LIB(des425, des_cbc_encrypt,,AC_CHECK_LIB(crypto,DES_cbc_encrypt))
    72 AC_CHECK_LIB(resolv, res_search)
     25AC_SEARCH_LIBS([gethostbyname], [nsl])
     26AC_SEARCH_LIBS([socket], [socket])
     27AC_SEARCH_LIBS([res_search], [resolv])
    7328
    7429AC_ARG_WITH([zephyr],
     
    7934
    8035AS_IF([test "x$with_zephyr" != xno],
    81   [AC_CHECK_LIB([zephyr], [ZGetSender],
     36  [AC_MSG_CHECKING([for Kerberos IV])
     37   AS_IF([krb5-config krb4 --libs >/dev/null 2>&1],
     38     [AC_MSG_RESULT([yes])
     39      AC_DEFINE([HAVE_KERBEROS_IV], [1], [Define if you have kerberos IV])
     40      CFLAGS="${CFLAGS} `krb5-config krb4 --cflags`"
     41      LIBS="${LIBS} `krb5-config krb4 --libs`"
     42     ],
     43     [AC_MSG_RESULT([no])
     44      PKG_CHECK_MODULES([LIBCRYPTO], [libcrypto])
     45      CFLAGS="${CFLAGS} ${LIBCRYPTO_CFLAGS}"
     46      LIBS="${LIBS} ${LIBCRYPTO_LIBS}"
     47     ])
     48   AC_CHECK_LIB([zephyr], [ZGetSender],
    8249   [LIBS="$LIBS -lzephyr"
    8350    AC_DEFINE([HAVE_LIBZEPHYR], [1],
     
    8653      AC_DEFINE([HAVE_LIBZEPHYR_ZINITLOCATIONINFO], [1],
    8754                [Have ZInitLocationInfo]),)
     55    AC_CHECK_LIB([com_err], [com_err])
     56    AC_CHECK_HEADERS([com_err.h])
    8857   ],
    8958   [if test "x$with_zephyr" != xcheck; then
     
    9362   ])])
    9463
    95 AC_CHECK_FUNCS(use_default_colors resizeterm des_string_to_key des_key_sched des_ecb_encrypt)
    96 AC_CHECK_FUNCS(                            DES_string_to_key  DES_ecb_encrypt DES_key_sched)
    97 
    98 AC_MSG_CHECKING(for des_ecb_encrypt prototype)
    99 AC_TRY_COMPILE([#include <des.h>
    100 int des_ecb_encrypt(char foo[], char bar[], des_key_schedule baz, int qux);],
    101 [int foo = des_ecb_encrypt(0,0,0,0);],
    102 ac_cv_des_ecb_encrypt_proto=no,
    103 ac_cv_des_ecb_encrypt_proto=yes)
    104 AC_MSG_RESULT($ac_cv_des_ecb_encrypt_proto)
    105 if test "$ac_cv_des_ecb_encrypt_proto" = yes; then
    106         AC_DEFINE([HAVE_DES_ECB_ENCRYPT_PROTO], [], [have proto for des_ecb_encrypt])
    107 fi
     64AC_CHECK_FUNCS([use_default_colors resizeterm])
     65AC_CHECK_FUNCS([des_string_to_key des_key_sched des_ecb_encrypt])
     66AC_CHECK_FUNCS([DES_string_to_key DES_ecb_encrypt DES_key_sched])
    10867
    10968dnl Checks for header files.
    11069AC_HEADER_STDC
    11170AC_HEADER_SYS_WAIT
    112 AC_CHECK_HEADERS(strings.h sys/ioctl.h sys/filio.h unistd.h com_err.h)
     71AC_CHECK_HEADERS(strings.h sys/ioctl.h sys/filio.h unistd.h)
    11372
    11473dnl Add CFLAGS for embeded perl
    115 FOO=`perl -MExtUtils::Embed -e ccopts`
    116 AC_MSG_NOTICE([Adding perl CFLAGS ${FOO}])
    117 CFLAGS=${CFLAGS}\ ${FOO}
     74PERL_CFLAGS=`perl -MExtUtils::Embed -e ccopts`
     75AC_MSG_NOTICE([Adding perl CFLAGS ${PERL_CFLAGS}])
     76CFLAGS="${CFLAGS} ${PERL_CFLAGS}"
    11877
    11978dnl Find the location of perl XSUBPP
     
    154113dnl Checks for typedefs, structures, and compiler characteristics.
    155114
     115AX_CFLAGS_WARN_ALL
     116
     117AX_C_CHECK_FLAG([-Wno-pointer-sign],[],[],
     118  [LIBFAIM_CFLAGS="$LIBFAIM_CFLAGS -Wno-pointer-sign"])
     119
     120AC_SUBST([LIBFAIM_CFLAGS])
     121
    156122AC_SUBST(XSUBPPDIR)
    157123AC_SUBST(XSUBPPFLAGS)
  • libfaim/Makefile.am

    red62482 r215c119  
    1010     aim_cbtypes.h  aim.h  aim_internal.h  faimconfig.h md5.h
    1111
     12libfaim_a_CFLAGS = $(LIBFAIM_CFLAGS)
    1213libfaim_a_CPPFLAGS = -DAIM_BUILDDATE=\"x\" -DAIM_BUILDTIME=\"x\" \
    1314                     -I${top_srcdir}/libfaim
  • perlconfig.c

    reea72a1 r2693b12  
    2626{
    2727  SV *ret = newSVpv(str, 0);
    28   if(is_utf8_string(str, strlen(str))) {
     28  if(is_utf8_string((U8*)str, strlen(str))) {
    2929    SvUTF8_on(ret);
    3030  } else {
  • zcrypt.c

    r36486be r3daca13  
    2323#include <unistd.h>
    2424#include <sys/types.h>
    25 #include <des.h>
     25
     26#ifdef HAVE_KERBEROS_IV
     27#include <kerberosIV/des.h>
     28#else
     29#include <openssl/des.h>
     30#endif
    2631
    2732#define MAX_KEY 128
     
    5156char *GetZephyrVarKeyFile(const char *whoami, const char *class, const char *instance);
    5257
    53 #ifndef HAVE_DES_ECB_ENCRYPT_PROTO
    54 int des_ecb_encrypt(char [], char [], des_key_schedule, int);
    55 #endif
    56 
    5758#define M_NONE            0
    5859#define M_ZEPHYR_ENCRYPT  1
     
    6162#define M_RANDOMIZE       4
    6263#define M_SETKEY          5
     64
     65static void owl_zcrypt_string_to_schedule(char *keystring, des_key_schedule schedule) {
     66#ifdef HAVE_KERBEROS_IV
     67  des_cblock key;
     68#else
     69  des_cblock _key, *key = &_key;
     70#endif
     71
     72  des_string_to_key(keystring, key);
     73  des_key_sched(key, schedule);
     74}
    6375
    6476/* The 'owl_zcrypt_decrypt' function was written by kretch for Owl.
     
    7385  char *fname, keystring[MAX_KEY];
    7486  FILE *fkey;
    75   des_cblock key;
    7687  des_key_schedule schedule;
    77   char input[8], output[9];
     88  unsigned char input[8], output[8];
    7889  int i, c1, c2;
    7990 
     
    8293  fkey=fopen(fname, "r");
    8394  if (!fkey) return(-1);
    84   fgets(keystring, MAX_KEY-1, fkey);
     95  if (!fgets(keystring, MAX_KEY-1, fkey)) {
     96    fclose(fkey);
     97    return -1;
     98  }
    8599  fclose(fkey);
    86100
     
    88102
    89103  output[0] = '\0';    /* In case no message at all                 */
    90   output[8] = '\0';    /* NULL at end will limit string length to 8 */
    91 
    92   des_string_to_key(keystring, key);
    93   des_key_sched(key, schedule);
     104
     105  owl_zcrypt_string_to_schedule(keystring, schedule);
    94106
    95107  inptr=in;
     
    102114      inptr+=2;
    103115    }
    104     des_ecb_encrypt(input, output, schedule, FALSE);
    105     strcat(out, output);
    106   }
    107 
    108   if (output[0]) {
    109     if (output[strlen(output)-1] != '\n') {
    110       strcat(out, "\n");
    111     }
    112   } else {
     116    des_ecb_encrypt(&input, &output, schedule, FALSE);
     117    strncat(out, (const char *)output, 8);
     118  }
     119
     120  if (out[0] && out[strlen(out) - 1] != '\n')
    113121    strcat(out, "\n");
    114   }
    115122  return(0);
    116123}
     
    119126  char *fname, keystring[MAX_KEY];
    120127  FILE *fkey;
    121   des_cblock key;
    122128  des_key_schedule schedule;
    123   char input[8], output[8];
     129  unsigned char input[8], output[8];
    124130  int size, length, i;
    125131  const char *inbuff = NULL, *inptr;
     
    131137  fkey=fopen(fname, "r");
    132138  if (!fkey) return(-1);
    133   fgets(keystring, MAX_KEY-1, fkey);
     139  if (!fgets(keystring, MAX_KEY-1, fkey)) {
     140    fclose(fkey);
     141    return -1;
     142  }
    134143  fclose(fkey);
    135144
    136   des_string_to_key(keystring, key);
    137   des_key_sched(key, schedule);
     145  owl_zcrypt_string_to_schedule(keystring, schedule);
    138146
    139147  inbuff=in;
     
    167175
    168176    /* Encrypt and output the block */
    169     des_ecb_encrypt(input, output, schedule, TRUE);
     177    des_ecb_encrypt(&input, &output, schedule, TRUE);
    170178
    171179    for (i = 0; i < 8; i++) {
     
    216224    /* Scan file for a match */
    217225    while (!feof(fsearch)) {
    218       fgets(buffer, MAX_BUFF - 3, fsearch);
     226      if (!fgets(buffer, MAX_BUFF - 3, fsearch)) break;
    219227      for (i = 0; i < numsearch; i++) {
    220228        if (strncasecmp(varname[i], buffer, length[i]) == 0) {
     
    262270}
    263271
    264 static pid_t zephyrpipe_pid = 0;
    265 
    266 #endif
     272#endif
Note: See TracChangeset for help on using the changeset viewer.