Changes in / [168f8a9:633db30]
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile.am
r3d9f4d3 r191d5e7 5 5 owl.h owl_perl.h config.h \ 6 6 owl.c \ 7 libzcrypt.a \8 7 $(GEN_C) $(GEN_H) 9 8 10 barnowl_bin_LDADD = libfaim/libfaim.a libzcrypt.a9 barnowl_bin_LDADD = libfaim/libfaim.a 11 10 12 11 tester_SOURCES = $(BASE_SRCS) \ 13 12 owl.h owl_perl.h config.h \ 14 libzcrypt.a \15 13 $(GEN_C) $(GEN_H) \ 16 14 tester.c 17 15 18 tester_LDADD = libfaim/libfaim.a libzcrypt.a16 tester_LDADD = libfaim/libfaim.a 19 17 20 18 TESTS=runtests.sh 21 22 noinst_LIBRARIES = libzcrypt.a23 24 libzcrypt_a_SOURCES = zcrypt.c25 libzcrypt_a_CFLAGS = -w26 19 27 20 CPPFLAGS = -I$(top_srcdir)/ \ … … 32 25 perlconfig.c keys.c functions.c zwrite.c viewwin.c help.c filter.c \ 33 26 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 \ 35 28 aim.c buddy.c buddylist.c style.c errqueue.c \ 36 29 zbuddylist.c popexec.c obarray.c select.c wcwidth.c \ … … 57 50 $(AM_V_GEN)perl $< $(filter-out $<,$+) > $@ 58 51 59 owl_prototypes.h.new: codelist.pl varstubs.c $(BASE_SRCS) zcrypt.c52 owl_prototypes.h.new: codelist.pl varstubs.c $(BASE_SRCS) 60 53 $(AM_V_GEN)perl $< $(filter-out $<,$+) > $@ 61 54 -
commands.c
r3e96ff0 rfea5ddf 1987 1987 #else 1988 1988 owl_function_makemsg("This Owl does not support zcrypt"); 1989 return NULL; 1989 1990 #endif 1990 1991 } -
configure.ac
rd7cc50b r1c89df8 8 8 AC_PROG_CC 9 9 10 dnl Check for Athena11 AC_MSG_CHECKING(for /usr/athena/include)12 if test -d /usr/athena/include; then13 CFLAGS=${CFLAGS}\ -I/usr/athena/include14 CPPFLAGS=${CPPFLAGS}\ -I/usr/athena/include15 AC_MSG_RESULT(yes)16 else17 AC_MSG_RESULT(no)18 fi19 AC_MSG_CHECKING(for /usr/athena/lib)20 if test -d /usr/athena/lib; then21 LDFLAGS=${LDFLAGS}\ -L/usr/athena/lib22 AC_MSG_RESULT(yes)23 else24 AC_MSG_RESULT(no)25 fi26 27 dnl Check for kerberosIV include28 AC_MSG_CHECKING(for kerberosIV)29 if test -d /usr/include/kerberosIV; then30 CFLAGS=${CFLAGS}\ -I/usr/include/kerberosIV31 CPPFLAGS=${CPPFLAGS}\ -I/usr/include/kerberosIV32 AC_MSG_RESULT(yes)33 elif test -d /usr/local/include/kerberosIV; then34 CFLAGS=${CFLAGS}\ -I/usr/local/include/kerberosIV35 CPPFLAGS=${CPPFLAGS}\ -I/usr/local/include/kerberosIV36 AC_MSG_RESULT(yes)37 elif test -d /usr/include/openssl; then38 CFLAGS=${CFLAGS}\ -I/usr/include/openssl39 CPPFLAGS=${CPPFLAGS}\ -I/usr/include/openssl40 AC_MSG_RESULT(OpenSSL DES found instead)41 else42 AC_MSG_RESULT(no)43 fi44 45 10 AC_ARG_WITH([stack-protector], 46 11 [AS_HELP_STRING([--with-stack-protector], … … 50 15 51 16 AS_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 ])]) 65 23 66 24 AC_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) 25 AC_SEARCH_LIBS([gethostbyname], [nsl]) 26 AC_SEARCH_LIBS([socket], [socket]) 27 AC_SEARCH_LIBS([res_search], [resolv]) 73 28 74 29 AC_ARG_WITH([zephyr], … … 79 34 80 35 AS_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], 82 49 [LIBS="$LIBS -lzephyr" 83 50 AC_DEFINE([HAVE_LIBZEPHYR], [1], … … 86 53 AC_DEFINE([HAVE_LIBZEPHYR_ZINITLOCATIONINFO], [1], 87 54 [Have ZInitLocationInfo]),) 55 AC_CHECK_LIB([com_err], [com_err]) 56 AC_CHECK_HEADERS([com_err.h]) 88 57 ], 89 58 [if test "x$with_zephyr" != xcheck; then … … 93 62 ])]) 94 63 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 64 AC_CHECK_FUNCS([use_default_colors resizeterm]) 65 AC_CHECK_FUNCS([des_string_to_key des_key_sched des_ecb_encrypt]) 66 AC_CHECK_FUNCS([DES_string_to_key DES_ecb_encrypt DES_key_sched]) 108 67 109 68 dnl Checks for header files. 110 69 AC_HEADER_STDC 111 70 AC_HEADER_SYS_WAIT 112 AC_CHECK_HEADERS(strings.h sys/ioctl.h sys/filio.h unistd.h com_err.h)71 AC_CHECK_HEADERS(strings.h sys/ioctl.h sys/filio.h unistd.h) 113 72 114 73 dnl Add CFLAGS for embeded perl 115 FOO=`perl -MExtUtils::Embed -e ccopts`116 AC_MSG_NOTICE([Adding perl CFLAGS ${ FOO}])117 CFLAGS= ${CFLAGS}\ ${FOO}74 PERL_CFLAGS=`perl -MExtUtils::Embed -e ccopts` 75 AC_MSG_NOTICE([Adding perl CFLAGS ${PERL_CFLAGS}]) 76 CFLAGS="${CFLAGS} ${PERL_CFLAGS}" 118 77 119 78 dnl Find the location of perl XSUBPP … … 154 113 dnl Checks for typedefs, structures, and compiler characteristics. 155 114 115 AX_CFLAGS_WARN_ALL 116 117 AX_C_CHECK_FLAG([-Wno-pointer-sign],[],[], 118 [LIBFAIM_CFLAGS="$LIBFAIM_CFLAGS -Wno-pointer-sign"]) 119 120 AC_SUBST([LIBFAIM_CFLAGS]) 121 156 122 AC_SUBST(XSUBPPDIR) 157 123 AC_SUBST(XSUBPPFLAGS) -
libfaim/Makefile.am
red62482 r215c119 10 10 aim_cbtypes.h aim.h aim_internal.h faimconfig.h md5.h 11 11 12 libfaim_a_CFLAGS = $(LIBFAIM_CFLAGS) 12 13 libfaim_a_CPPFLAGS = -DAIM_BUILDDATE=\"x\" -DAIM_BUILDTIME=\"x\" \ 13 14 -I${top_srcdir}/libfaim -
perlconfig.c
reea72a13 r2693b12 26 26 { 27 27 SV *ret = newSVpv(str, 0); 28 if(is_utf8_string( str, strlen(str))) {28 if(is_utf8_string((U8*)str, strlen(str))) { 29 29 SvUTF8_on(ret); 30 30 } else { -
zcrypt.c
r36486be r3daca13 23 23 #include <unistd.h> 24 24 #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 26 31 27 32 #define MAX_KEY 128 … … 51 56 char *GetZephyrVarKeyFile(const char *whoami, const char *class, const char *instance); 52 57 53 #ifndef HAVE_DES_ECB_ENCRYPT_PROTO54 int des_ecb_encrypt(char [], char [], des_key_schedule, int);55 #endif56 57 58 #define M_NONE 0 58 59 #define M_ZEPHYR_ENCRYPT 1 … … 61 62 #define M_RANDOMIZE 4 62 63 #define M_SETKEY 5 64 65 static 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 } 63 75 64 76 /* The 'owl_zcrypt_decrypt' function was written by kretch for Owl. … … 73 85 char *fname, keystring[MAX_KEY]; 74 86 FILE *fkey; 75 des_cblock key;76 87 des_key_schedule schedule; 77 char input[8], output[9];88 unsigned char input[8], output[8]; 78 89 int i, c1, c2; 79 90 … … 82 93 fkey=fopen(fname, "r"); 83 94 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 } 85 99 fclose(fkey); 86 100 … … 88 102 89 103 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); 94 106 95 107 inptr=in; … … 102 114 inptr+=2; 103 115 } 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') 113 121 strcat(out, "\n"); 114 }115 122 return(0); 116 123 } … … 119 126 char *fname, keystring[MAX_KEY]; 120 127 FILE *fkey; 121 des_cblock key;122 128 des_key_schedule schedule; 123 char input[8], output[8];129 unsigned char input[8], output[8]; 124 130 int size, length, i; 125 131 const char *inbuff = NULL, *inptr; … … 131 137 fkey=fopen(fname, "r"); 132 138 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 } 134 143 fclose(fkey); 135 144 136 des_string_to_key(keystring, key); 137 des_key_sched(key, schedule); 145 owl_zcrypt_string_to_schedule(keystring, schedule); 138 146 139 147 inbuff=in; … … 167 175 168 176 /* Encrypt and output the block */ 169 des_ecb_encrypt( input,output, schedule, TRUE);177 des_ecb_encrypt(&input, &output, schedule, TRUE); 170 178 171 179 for (i = 0; i < 8; i++) { … … 216 224 /* Scan file for a match */ 217 225 while (!feof(fsearch)) { 218 fgets(buffer, MAX_BUFF - 3, fsearch);226 if (!fgets(buffer, MAX_BUFF - 3, fsearch)) break; 219 227 for (i = 0; i < numsearch; i++) { 220 228 if (strncasecmp(varname[i], buffer, length[i]) == 0) { … … 262 270 } 263 271 264 static pid_t zephyrpipe_pid = 0; 265 266 #endif 272 #endif
Note: See TracChangeset
for help on using the changeset viewer.