Changeset 35cdda2
- Timestamp:
- Feb 3, 2019, 9:00:15 PM (5 years ago)
- Parents:
- 9a0d25d (diff), f0bd871 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - git-author:
- Adam Glasgall <adam@crossproduct.net> (02/03/19 21:00:15)
- git-committer:
- GitHub <noreply@github.com> (02/03/19 21:00:15)
- Files:
-
- 4 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
perl/lib/BarnOwl.pm
reea7bed4 r6ee496b 9 9 zephyr_getsender zephyr_getrealm zephyr_zwrite 10 10 zephyr_stylestrip zephyr_smartstrip_user zephyr_getsubs 11 queue_message admin_message11 queue_message get_message_by_id admin_message 12 12 start_edit 13 13 start_question start_password start_edit_win -
perl/lib/BarnOwl/Message.pm
r4fd3c04 rcc6de81 102 102 my $s; 103 103 for my $f (keys %$this) { 104 105 106 107 108 109 110 111 112 113 114 115 104 my $val = $this->{$f}; 105 if (ref($val) eq "ARRAY") { 106 for my $i (0..@$val-1) { 107 my $aval; 108 $aval = $val->[$i]; 109 $aval =~ s/\n/\n$f.$i: /g; 110 $s .= "$f.$i: $aval\n"; 111 } 112 } else { 113 $val =~ s/\n/\n$f: /g; 114 $s .= "$f: $val\n"; 115 } 116 116 } 117 117 return $s; … … 304 304 $BarnOwl::auth = $m->auth ; 305 305 if ($m->fields) { 306 307 306 @BarnOwl::fields = @{$m->fields}; 307 @main::fields = @{$m->fields}; 308 308 } else { 309 310 309 @BarnOwl::fields = undef; 310 @main::fields = undef; 311 311 } 312 312 } … … 331 331 332 332 1; 333 334 # Local Variables: 335 # indent-tabs-mode: nil 336 # End: -
perl/modules/Makefile.am
r268c7e8 r20fb602 1 MODULES = Jabber IRC WordWrap Twitter Facebook Kerberos 1 MODULES = Jabber IRC WordWrap Twitter Facebook Kerberos Zulip 2 2 3 3 EXTRA_DIST = $(MODULES:=/Makefile.PL) $(MODULES:=/lib) -
perlglue.xs
rd2ba33c r6ee496b 60 60 OUTPUT: 61 61 RETVAL 62 62 63 63 int 64 64 getnumcols() … … 156 156 RETVAL 157 157 158 SV * 159 get_message_by_id(id) 160 int id 161 PREINIT: 162 owl_message *m; 163 owl_messagelist *ml; 164 CODE: 165 { 166 ml = owl_global_get_msglist(&g); 167 m = owl_messagelist_get_by_id(ml, id); 168 if(!m) { 169 croak("No message with id %d!", id); 170 } 171 RETVAL = owl_perlconfig_message2hashref(m); 172 } 173 OUTPUT: 174 RETVAL 175 176 158 177 void 159 178 admin_message(header, body) -
configure.ac
r4fd3c04 r9a0d25d 54 54 [with_zephyr=check]) 55 55 56 AC_ARG_WITH([krb4],57 AS_HELP_STRING([--with-krb4],58 [Build with kerberos IV]))59 60 56 AS_IF([test "x$with_zephyr" != xno], 61 [have_krb4=no 62 63 AS_IF([test "x$with_krb4" != "xno"], 64 [AC_MSG_CHECKING([for Kerberos IV]) 65 AS_IF([krb5-config krb4 --libs >/dev/null 2>&1], 66 [AC_MSG_RESULT([yes]) 67 have_krb4=yes 68 AC_DEFINE([HAVE_KERBEROS_IV], [1], [Define if you have kerberos IV]) 69 AM_CFLAGS="${AM_CFLAGS} `krb5-config krb4 --cflags`" 70 LIBS="${LIBS} `krb5-config krb4 --libs`" 71 ], 72 [AC_MSG_RESULT([no]) 73 AS_IF([test "x$with_krb4" = "xyes"], 74 [AC_MSG_ERROR([Kerberos IV requested but not found])])])]) 75 76 AS_IF([test "x$have_krb4" != xyes], 77 [PKG_CHECK_MODULES([LIBCRYPTO], [libcrypto], 78 [AM_CFLAGS="${AM_CFLAGS} ${LIBCRYPTO_CFLAGS}" 79 LIBS="${LIBS} ${LIBCRYPTO_LIBS}" 80 ], 81 [PKG_CHECK_MODULES([OPENSSL], [openssl], 82 [AM_CFLAGS="${AM_CFLAGS} ${OPENSSL_CFLAGS}" 83 LIBS="${LIBS} ${OPENSSL_LIBS}" 84 ])])]) 57 [PKG_CHECK_MODULES([LIBCRYPTO], [libcrypto], 58 [AM_CFLAGS="${AM_CFLAGS} ${LIBCRYPTO_CFLAGS}" 59 LIBS="${LIBS} ${LIBCRYPTO_LIBS}" 60 ], 61 [PKG_CHECK_MODULES([OPENSSL], [openssl], 62 [AM_CFLAGS="${AM_CFLAGS} ${OPENSSL_CFLAGS}" 63 LIBS="${LIBS} ${OPENSSL_LIBS}" 64 ])]) 85 65 86 66 AC_CHECK_LIB([zephyr], [ZGetSender], … … 102 82 AC_CHECK_FUNCS([use_default_colors]) 103 83 AC_CHECK_FUNCS([resizeterm], [], [AC_MSG_ERROR([No resizeterm found])]) 104 AC_CHECK_FUNCS([ des_string_to_keyDES_string_to_key], [HAVE_DES_STRING_TO_KEY=1])105 AC_CHECK_FUNCS([ des_ecb_encryptDES_ecb_encrypt], [HAVE_DES_ECB_ENCRYPT=1])106 AC_CHECK_FUNCS([ des_key_schedDES_key_sched], [HAVE_DES_KEY_SCHED=1])84 AC_CHECK_FUNCS([DES_string_to_key], [HAVE_DES_STRING_TO_KEY=1]) 85 AC_CHECK_FUNCS([DES_ecb_encrypt], [HAVE_DES_ECB_ENCRYPT=1]) 86 AC_CHECK_FUNCS([DES_key_sched], [HAVE_DES_KEY_SCHED=1]) 107 87 108 88 dnl Checks for header files. … … 181 161 182 162 AM_CFLAGS="$AM_CFLAGS -D_XOPEN_SOURCE=600" 183 dnl Define _BSD_SOURCE because zephyr needs caddr_t.184 AM_CFLAGS="$AM_CFLAGS -D_BSD_SOURCE "163 dnl Define _BSD_SOURCE/_DEFAULT_SOURCE because zephyr needs caddr_t. 164 AM_CFLAGS="$AM_CFLAGS -D_BSD_SOURCE -D_DEFAULT_SOURCE" 185 165 dnl Define __EXTENSIONS__ for strcasecmp on Solaris. 186 166 AM_CFLAGS="$AM_CFLAGS -D__EXTENSIONS__" -
filter.c
r7dcef03 r9e596f5 16 16 owl_filter *owl_filter_new(const char *name, int argc, const char *const *argv) 17 17 { 18 return owl_filter_new_colored(name, argc, argv, OWL_COLOR_DEFAULT, OWL_COLOR_DEFAULT); 19 } 20 21 owl_filter *owl_filter_new_colored(const char *name, int argc, const char *const *argv, int fgcolor, int bgcolor) 22 { 18 23 owl_filter *f; 19 24 … … 21 26 22 27 f->name=g_strdup(name); 23 f->fgcolor=OWL_COLOR_DEFAULT; 24 f->bgcolor=OWL_COLOR_DEFAULT; 25 26 /* first take arguments that have to come first */ 27 /* set the color */ 28 while ( argc>=2 && ( !strcmp(argv[0], "-c") || 29 !strcmp(argv[0], "-b") ) ) { 30 if (owl_util_string_to_color(argv[1])==OWL_COLOR_INVALID) { 31 owl_function_error("The color '%s' is not available, using default.", argv[1]); 32 } else { 33 switch (argv[0][1]) { 34 case 'c': 35 f->fgcolor=owl_util_string_to_color(argv[1]); 36 break; 37 case 'b': 38 f->bgcolor=owl_util_string_to_color(argv[1]); 39 break; 40 } 41 } 42 argc-=2; 43 argv+=2; 44 } 28 f->fgcolor = fgcolor; 29 f->bgcolor = bgcolor; 45 30 46 31 if (!(f->root = owl_filter_parse_expression(argc, argv, NULL))) { -
functions.c
r4fd3c04 r9e596f5 1980 1980 const owl_view *v; 1981 1981 int inuse = 0; 1982 int i = 2; 1983 int fgcolor = OWL_COLOR_DEFAULT; 1984 bool set_fgcolor = false; 1985 int bgcolor = OWL_COLOR_DEFAULT; 1986 bool set_bgcolor = false; 1982 1987 1983 1988 if (argc < 2) { … … 1996 2001 } 1997 2002 1998 /* deal with the case of trying change the filter color */ 1999 if (argc==4 && !strcmp(argv[2], "-c")) { 2003 /* set the color */ 2004 while (i + 2 <= argc && (!strcmp(argv[i], "-c") || 2005 !strcmp(argv[i], "-b"))) { 2006 int color = owl_util_string_to_color(argv[i + 1]); 2007 if (color == OWL_COLOR_INVALID) { 2008 owl_function_error("The color '%s' is not available.", argv[i + 1]); 2009 } else if (argv[i][1] == 'c') { 2010 fgcolor = color; 2011 set_fgcolor = true; 2012 } else { 2013 bgcolor = color; 2014 set_bgcolor = true; 2015 } 2016 i += 2; 2017 } 2018 2019 if (i > 2 && i == argc) { 2000 2020 f=owl_global_get_filter(&g, argv[1]); 2001 2021 if (!f) { … … 2003 2023 return false; 2004 2024 } 2005 if (owl_util_string_to_color(argv[3])==OWL_COLOR_INVALID) { 2006 owl_function_error("The color '%s' is not available.", argv[3]); 2025 if (!set_fgcolor && !set_bgcolor) 2007 2026 return false; 2008 } 2009 owl_filter_set_fgcolor(f, owl_util_string_to_color(argv[3])); 2010 owl_mainwin_redisplay(owl_global_get_mainwin(&g)); 2011 return false; 2012 } 2013 if (argc==4 && !strcmp(argv[2], "-b")) { 2014 f=owl_global_get_filter(&g, argv[1]); 2015 if (!f) { 2016 owl_function_error("The filter '%s' does not exist.", argv[1]); 2017 return false; 2018 } 2019 if (owl_util_string_to_color(argv[3])==OWL_COLOR_INVALID) { 2020 owl_function_error("The color '%s' is not available.", argv[3]); 2021 return false; 2022 } 2023 owl_filter_set_bgcolor(f, owl_util_string_to_color(argv[3])); 2027 if (set_fgcolor) 2028 owl_filter_set_fgcolor(f, fgcolor); 2029 if (set_bgcolor) 2030 owl_filter_set_bgcolor(f, bgcolor); 2024 2031 owl_mainwin_redisplay(owl_global_get_mainwin(&g)); 2025 2032 return true; … … 2027 2034 2028 2035 /* create the filter and check for errors */ 2029 f = owl_filter_new (argv[1], argc-2, argv+2);2036 f = owl_filter_new_colored(argv[1], argc - i, argv + i, fgcolor, bgcolor); 2030 2037 if (f == NULL) { 2031 2038 owl_function_error("Invalid filter: %s", argv[1]); -
zcrypt.c
rca1fb26a r9a0d25d 21 21 #include <config.h> 22 22 23 #ifdef HAVE_KERBEROS_IV24 #include <kerberosIV/des.h>25 #else26 23 #include <openssl/des.h> 27 #endif28 24 29 25 #include "filterproc.h" … … 99 95 }; 100 96 101 static void owl_zcrypt_string_to_schedule(char *keystring, des_key_schedule *schedule) { 102 #ifdef HAVE_KERBEROS_IV 103 des_cblock key; 104 #else 105 des_cblock _key, *key = &_key; 106 #endif 107 108 des_string_to_key(keystring, key); 109 des_key_sched(key, *schedule); 97 static void owl_zcrypt_string_to_schedule(char *keystring, DES_key_schedule *schedule) { 98 DES_cblock key; 99 100 DES_string_to_key(keystring, &key); 101 DES_key_sched(&key, schedule); 110 102 } 111 103 … … 728 720 int do_encrypt_des(const char *keyfile, const char *in, int length, FILE *outfile) 729 721 { 730 des_key_schedule schedule;722 DES_key_schedule schedule; 731 723 unsigned char input[8], output[8]; 732 724 const char *inptr; … … 774 766 775 767 /* Encrypt and output the block */ 776 des_ecb_encrypt(&input, &output,schedule, TRUE);768 DES_ecb_encrypt(&input, &output, &schedule, TRUE); 777 769 block_to_ascii(output, outfile); 778 770 … … 790 782 char *out; 791 783 int err, status; 784 int tried_gpg1 = FALSE; 792 785 const char *argv[] = { 793 "gpg ",786 "gpg1", 794 787 "--symmetric", 795 788 "--no-options", … … 805 798 NULL 806 799 }; 807 err = call_filter(argv, in, &out, &status); 800 while ((err = call_filter(argv, in, &out, &status)) && !out && !tried_gpg1) { 801 tried_gpg1 = TRUE; 802 argv[0] = "gpg"; 803 } 808 804 if(err || status) { 809 805 g_free(out); … … 874 870 char *in, *out; 875 871 int length; 872 int tried_gpg1 = FALSE; 876 873 const char *argv[] = { 877 "gpg ",874 "gpg1", 878 875 "--decrypt", 879 876 "--no-options", … … 892 889 if(!in) return FALSE; 893 890 894 err = call_filter(argv, in, &out, &status); 891 while ((err = call_filter(argv, in, &out, &status)) && !out && !tried_gpg1) { 892 tried_gpg1 = TRUE; 893 argv[0] = "gpg"; 894 } 895 895 free(in); 896 896 if(err || status) { … … 905 905 906 906 int do_decrypt_des(const char *keyfile) { 907 des_key_schedule schedule;907 DES_key_schedule schedule; 908 908 unsigned char input[8], output[8]; 909 909 char tmp[9]; … … 915 915 have a NULL-terminated string we can call printf/strlen on. 916 916 917 We don't pass 'tmp' to des_ecb_encrypt directly, because it's917 We don't pass 'tmp' to DES_ecb_encrypt directly, because it's 918 918 prototyped as taking 'unsigned char[8]', and this avoids a stupid 919 919 cast. … … 933 933 while (read_ascii_block(input)) 934 934 { 935 des_ecb_encrypt(&input, &output,schedule, FALSE);935 DES_ecb_encrypt(&input, &output, &schedule, FALSE); 936 936 memcpy(tmp, output, 8); 937 937 printf("%s", tmp);
Note: See TracChangeset
for help on using the changeset viewer.