From 69e112fbd1b44a6f9f3380167c12bbe0f76693a1 Mon Sep 17 00:00:00 2001 From: dequis Date: Fri, 6 Jan 2017 11:20:49 -0300 Subject: [PATCH 01/10] NEWS: Avoid explicitly mentioning freenode in the pinning examples They have proper certs, so using them as an example is wrong. Particularly worse since they started using letsencrypt recently so every server has a different cert and pubkey. We'll figure out how to link this from the release notes later. --- NEWS | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 81c6004c..9604277a 100644 --- a/NEWS +++ b/NEWS @@ -39,16 +39,16 @@ v1.0.0 2017-01-03 The Irssi team values like this: Start by downloading the certificate from a given IRC server: - $ openssl s_client -connect chat.freenode.net:6697 < /dev/null 2>/dev/null | \ - openssl x509 > freenode.cert + $ openssl s_client -connect irc.example.net:6697 < /dev/null 2>/dev/null | \ + openssl x509 > example.cert Find the value for -tls_pinned_cert: - $ openssl x509 -in freenode.cert -fingerprint -sha256 -noout + $ openssl x509 -in example.cert -fingerprint -sha256 -noout Find the value for -tls_pinned_pubkey: - $ openssl x509 -in freenode.cert -pubkey -noout | \ + $ openssl x509 -in example.cert -pubkey -noout | \ openssl pkey -pubin -outform der | \ openssl dgst -sha256 -c | \ tr a-z A-Z From 7c49ed2d17d2325d7bceef632ac38b66a44e8b63 Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Fri, 6 Jan 2017 12:44:02 +0100 Subject: [PATCH 02/10] Merge pull request #602 from McDutchie/master make irssi --with-perl build with separate object directory --- src/perl/common/Makefile.PL.in | 2 +- src/perl/irc/Makefile.PL.in | 2 +- src/perl/textui/Makefile.PL.in | 2 +- src/perl/ui/Makefile.PL.in | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/perl/common/Makefile.PL.in b/src/perl/common/Makefile.PL.in index 84a80403..70b1d258 100644 --- a/src/perl/common/Makefile.PL.in +++ b/src/perl/common/Makefile.PL.in @@ -1,4 +1,4 @@ -use ExtUtils::MakeMaker;our $AM_DEFAULT_VERBOSITY='@AM_DEFAULT_VERBOSITY@';require "../Makefile_silent.pm"; +use ExtUtils::MakeMaker;our $AM_DEFAULT_VERBOSITY='@AM_DEFAULT_VERBOSITY@';require "@top_srcdir@/src/perl/Makefile_silent.pm"; WriteMakefile('NAME' => 'Irssi', 'LIBS' => '', diff --git a/src/perl/irc/Makefile.PL.in b/src/perl/irc/Makefile.PL.in index 0fbc5241..582160a0 100644 --- a/src/perl/irc/Makefile.PL.in +++ b/src/perl/irc/Makefile.PL.in @@ -1,4 +1,4 @@ -use ExtUtils::MakeMaker;our $AM_DEFAULT_VERBOSITY='@AM_DEFAULT_VERBOSITY@';require "../Makefile_silent.pm"; +use ExtUtils::MakeMaker;our $AM_DEFAULT_VERBOSITY='@AM_DEFAULT_VERBOSITY@';require "@top_srcdir@/src/perl/Makefile_silent.pm"; WriteMakefile('NAME' => 'Irssi::Irc', 'LIBS' => '', diff --git a/src/perl/textui/Makefile.PL.in b/src/perl/textui/Makefile.PL.in index 3541f75c..ffdda21a 100644 --- a/src/perl/textui/Makefile.PL.in +++ b/src/perl/textui/Makefile.PL.in @@ -1,4 +1,4 @@ -use ExtUtils::MakeMaker;our $AM_DEFAULT_VERBOSITY='@AM_DEFAULT_VERBOSITY@';require "../Makefile_silent.pm"; +use ExtUtils::MakeMaker;our $AM_DEFAULT_VERBOSITY='@AM_DEFAULT_VERBOSITY@';require "@top_srcdir@/src/perl/Makefile_silent.pm"; WriteMakefile('NAME' => 'Irssi::TextUI', 'LIBS' => '', diff --git a/src/perl/ui/Makefile.PL.in b/src/perl/ui/Makefile.PL.in index ed87d528..ceed51c3 100644 --- a/src/perl/ui/Makefile.PL.in +++ b/src/perl/ui/Makefile.PL.in @@ -1,4 +1,4 @@ -use ExtUtils::MakeMaker;our $AM_DEFAULT_VERBOSITY='@AM_DEFAULT_VERBOSITY@';require "../Makefile_silent.pm"; +use ExtUtils::MakeMaker;our $AM_DEFAULT_VERBOSITY='@AM_DEFAULT_VERBOSITY@';require "@top_srcdir@/src/perl/Makefile_silent.pm"; WriteMakefile('NAME' => 'Irssi::UI', 'LIBS' => '', From 8dbf186ad6e808c269fa10c22444c89df63f2d7d Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Fri, 6 Jan 2017 16:37:09 +0100 Subject: [PATCH 03/10] Merge pull request #604 from dequis/solaris Add OPENSSL_NO_EC for solaris 11.3, see issue #598 --- src/core/network-openssl.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/core/network-openssl.c b/src/core/network-openssl.c index 7a1d6e34..1eb85341 100644 --- a/src/core/network-openssl.c +++ b/src/core/network-openssl.c @@ -646,7 +646,11 @@ static void set_server_temporary_key_info(TLS_REC *tls, SSL *ssl) #ifdef SSL_get_server_tmp_key // Show ephemeral key information. EVP_PKEY *ephemeral_key = NULL; + + // OPENSSL_NO_EC is for solaris 11.3 (2016), github ticket #598 +#ifndef OPENSSL_NO_EC EC_KEY *ec_key = NULL; +#endif char *ephemeral_key_algorithm = NULL; char *cname = NULL; int nid; @@ -658,6 +662,7 @@ static void set_server_temporary_key_info(TLS_REC *tls, SSL *ssl) tls_rec_set_ephemeral_key_size(tls, EVP_PKEY_bits(ephemeral_key)); break; +#ifndef OPENSSL_NO_EC case EVP_PKEY_EC: ec_key = EVP_PKEY_get1_EC_KEY(ephemeral_key); nid = EC_GROUP_get_curve_name(EC_KEY_get0_group(ec_key)); @@ -670,6 +675,7 @@ static void set_server_temporary_key_info(TLS_REC *tls, SSL *ssl) g_free_and_null(ephemeral_key_algorithm); break; +#endif default: tls_rec_set_ephemeral_key_algorithm(tls, "Unknown"); From 3a3b34fc633fe8e045bf4b696c41857c9f8c5ba5 Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Fri, 6 Jan 2017 17:00:09 +0100 Subject: [PATCH 04/10] Merge pull request #606 from or4n/master Fix syntax on /help SERVER example --- docs/help/in/server.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/help/in/server.in b/docs/help/in/server.in index 60870111..44de0efc 100644 --- a/docs/help/in/server.in +++ b/docs/help/in/server.in @@ -64,7 +64,7 @@ /SERVER CONNECT chat.freenode.net /SERVER CONNECT +chat.freenode.net /SERVER ADD -network Freenode -noautosendcmd orwell.freenode.net - /SERVER ADD -! -auto -host staff.irssi.org -port 6667 -4 -network Freenode -noproxy orwell.freenode.net + /SERVER ADD -! -auto -host staff.irssi.org -4 -network Freenode -noproxy orwell.freenode.net 6667 /SERVER MODIFY -network Freenode -noauto orwell.freenode.net /SERVER REMOVE orwell.freenode.net 6667 Freenode /SERVER PURGE From 929c9477477a4ccf03626388499192d8003b96d5 Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Sun, 8 Jan 2017 21:55:39 +0100 Subject: [PATCH 05/10] Merge pull request #608 from tijko/master Follow g_strsplit with call to g_strfreev --- src/irc/core/modes.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/irc/core/modes.c b/src/irc/core/modes.c index 207461cc..cc3d0faf 100644 --- a/src/irc/core/modes.c +++ b/src/irc/core/modes.c @@ -743,6 +743,7 @@ static char *get_nicks(IRC_SERVER_REC *server, WI_ITEM_REC *item, g_hash_table_lookup(optlist, "yes") == NULL) { /* too many matches */ g_string_free(str, TRUE); + g_strfreev(matches); cmd_params_free(free_arg); signal_emit("error command", 1, @@ -756,7 +757,7 @@ static char *get_nicks(IRC_SERVER_REC *server, WI_ITEM_REC *item, if (str->len > 0) g_string_truncate(str, str->len-1); ret = str->str; g_string_free(str, FALSE); - + g_strfreev(matches); cmd_params_free(free_arg); *ret_channel = channel; From d63c93ae1dbb1254a92e8e4fafc39fe8d69d00ae Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Fri, 13 Jan 2017 22:36:44 +0100 Subject: [PATCH 06/10] Merge pull request #613 from ailin-nemui/fix_completion fix regression in completion --- src/fe-common/core/completion.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fe-common/core/completion.c b/src/fe-common/core/completion.c index 76dfbb79..914ba80b 100644 --- a/src/fe-common/core/completion.c +++ b/src/fe-common/core/completion.c @@ -191,7 +191,7 @@ char *word_complete(WINDOW_REC *window, const char *line, int *pos, int erase, i g_strdup_printf("%s%c%s", /* do not accidentally duplicate the word separator */ line == wordstart - 1 ? "" : linestart, - wordstart[-1], word); + old_wordstart[-1], word); g_free(old); g_free(word); From 1f42d2aa950e4d70bf4c4aebae3a7040bd710cf3 Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Sun, 15 Jan 2017 22:33:42 +0100 Subject: [PATCH 07/10] Merge pull request #619 from hannob/master perl_parse needs NULL terminated parameter list. --- src/perl/perl-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/perl/perl-core.c b/src/perl/perl-core.c index 2c61df70..e4bde559 100644 --- a/src/perl/perl-core.c +++ b/src/perl/perl-core.c @@ -41,7 +41,7 @@ GSList *perl_scripts; PerlInterpreter *my_perl; static int print_script_errors; -static char *perl_args[] = {"", "-e", "0"}; +static char *perl_args[] = {"", "-e", "0", NULL}; #define IS_PERL_SCRIPT(file) \ (strlen(file) > 3 && g_strcmp0(file+strlen(file)-3, ".pl") == 0) @@ -123,7 +123,7 @@ void perl_scripts_init(void) my_perl = perl_alloc(); perl_construct(my_perl); - perl_parse(my_perl, xs_init, G_N_ELEMENTS(perl_args), perl_args, NULL); + perl_parse(my_perl, xs_init, G_N_ELEMENTS(perl_args)-1, perl_args, NULL); #if PERL_STATIC_LIBS == 1 perl_eval_pv("Irssi::Core::->boot_Irssi_Core(0.9);", TRUE); #endif From ca5e9bd623862bd9a640bf8799aafa53502b79f6 Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Sat, 21 Jan 2017 03:52:31 +0100 Subject: [PATCH 08/10] Merge pull request #624 from ailin-nemui/mail_pl sync mail.pl --- scripts/mail.pl | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/scripts/mail.pl b/scripts/mail.pl index 190c33af..ded02120 100644 --- a/scripts/mail.pl +++ b/scripts/mail.pl @@ -30,6 +30,7 @@ $VERSION = "2.92"; # Check /mailbox help for help. use Irssi::TextUI; +use Irssi; my $maildirmode = 0; # maildir=1, file(spools)=0 my $old_is_not_new = 0; @@ -37,7 +38,7 @@ my $extprog; my ($last_refresh_time, $refresh_tag); # for mbox caching -my $last_size, $last_mtime, $last_mailcount, $last_mode; +my ($last_size, $last_mtime, $last_mailcount, $last_mode); # list of mailboxes my %mailboxes = (); @@ -101,8 +102,9 @@ sub mbox_count { my $old_is_not_new=Irssi::settings_get_bool('mail_oldnotnew'); if ($extprog ne "") { - $total = `$extprog`; - chomp $unread; + my $total = `$extprog`; + chomp $total; + ($read, $unread) = split ' ', $total, 2; } else { if (!$maildirmode) { if (-f $mailfile) { @@ -115,8 +117,7 @@ sub mbox_count { $last_size = $size; $last_mtime = $mtime; - my $f = gensym; - return 0 if (!open($f, "<", $mailfile)); + return 0 if (!open(my $f, "<", $mailfile)); # count new mails only my $internal_removed = 0; @@ -205,7 +206,7 @@ sub mail { my $total = 0; # check all mailboxes for new email - foreach $name (keys(%mailboxes)) { + foreach my $name (keys(%mailboxes)) { my $box = $mailboxes{$name}; # replace "~/" at the beginning by the user's home dir $box =~ s/^~\//$ENV{'HOME'}\//; @@ -233,7 +234,7 @@ sub mail { # Show this only if there are any new, unread messages. if (Irssi::settings_get_bool('mail_show_message') && $unread > $new_mails_in_box{$name}) { - $new_mails = $unread - $new_mails_in_box{$name}; + my $new_mails = $unread - $new_mails_in_box{$name}; if ($nummailboxes == 1) { Irssi::print("You have $new_mails new message" . ($new_mails != 1 ? "s." : "."), MSGLEVEL_CRAP); } else { @@ -263,11 +264,9 @@ sub add_mailboxes { my $boxstring = $_[0]; my @boxes = split(/,/, $boxstring); - foreach $dbox(@boxes) { - my $name = $dbox; - $name = substr($dbox, 0, index($dbox, '=')); - my $box = $dbox; - $box = substr($dbox, index($dbox, '=') + 1, length($dbox)); + foreach my $dbox(@boxes) { + my $name = substr($dbox, 0, index($dbox, '=')); + my $box = substr($dbox, index($dbox, '=') + 1, length($dbox)); addmailbox($name, $box); } } @@ -306,7 +305,7 @@ sub delmailbox { sub update_settings_string { my $setting; - foreach $name (keys(%mailboxes)) { + foreach my $name (keys(%mailboxes)) { $setting .= $name . "=" . $mailboxes{$name} . ","; } @@ -345,7 +344,7 @@ sub cmd_showmailboxes { return; } Irssi::print("Mailboxes:", MSGLEVEL_CRAP); - foreach $box (keys(%mailboxes)) { + foreach my $box (keys(%mailboxes)) { Irssi::print("$box: " . $mailboxes{$box}, MSGLEVEL_CRAP); } } From 97b182089eec8cc158313c424b453dcaa39e05af Mon Sep 17 00:00:00 2001 From: Nei Date: Fri, 3 Feb 2017 11:49:16 +0000 Subject: [PATCH 09/10] Merge branch 'dub-the-wub' into 'master' Prevent a memory leak during the processing of the SASL response. See merge request !8 --- src/irc/core/sasl.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/irc/core/sasl.c b/src/irc/core/sasl.c index 1021bea4..635b7dfb 100644 --- a/src/irc/core/sasl.c +++ b/src/irc/core/sasl.c @@ -174,10 +174,16 @@ static gboolean sasl_reassemble_incoming(IRC_SERVER_REC *server, const char *fra *decoded = g_string_new_len("", 0); } else { gsize dec_len; - gchar *tmp; + gint state = 0; + guint save = 0; - tmp = (gchar *) g_base64_decode(enc_req->str, &dec_len); - *decoded = g_string_new_len(tmp, dec_len); + /* Since we're not going to use the enc_req GString anymore we + * can perform the decoding in place. */ + dec_len = g_base64_decode_step(enc_req->str, enc_req->len, + (guchar *)enc_req->str, + &state, &save); + /* A copy of the data is made when the GString is created. */ + *decoded = g_string_new_len(enc_req->str, dec_len); } g_string_free(enc_req, TRUE); From 99e3d8a30bdf68775825eb79e5c29f3af12cd255 Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Fri, 3 Feb 2017 20:46:20 +0100 Subject: [PATCH 10/10] tag as 1.0.1 --- NEWS | 9 +++++++++ configure.ac | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 9604277a..f2af5810 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,12 @@ +v1.0.1 2017-02-03 The Irssi team + - Fix Perl compilation in object dir. By Martijn Dekker (#602, #623). + - Disable EC cryptography on Solaris to fix build (#604, #598). + - Fix incorrect HELP SERVER example (#606, #519). + - Correct memory leak in /OP and /VOICE. By Tim Konick (#608). + - Fix regression that broke second level completion (#613, #609). + - Correct missing NULL termination in perl_parse. By Hanno Böck (#619). + - Sync broken mail.pl script (#624, #607). + v1.0.0 2017-01-03 The Irssi team * Removed --disable-ipv6 (#408). * /connect Network now aborts with an error if no servers have been diff --git a/configure.ac b/configure.ac index 4aa1f3cc..4a96920c 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT(irssi, 1.0.0) +AC_INIT(irssi, 1.0.1) AC_CONFIG_SRCDIR([src]) AC_CONFIG_AUX_DIR(build-aux) AC_PREREQ(2.50)