Fixed patch for certificates comparison

This commit is contained in:
Honza Horák 2013-10-21 12:34:04 +02:00
parent dc12fb607d
commit a65ef542cd
2 changed files with 15 additions and 11 deletions

View File

@ -1,21 +1,22 @@
diff -up mutt-1.5.21/mutt_ssl_gnutls.c.debug mutt-1.5.21/mutt_ssl_gnutls.c
--- mutt-1.5.21/mutt_ssl_gnutls.c.debug 2011-11-03 15:56:29.992235238 +0100
+++ mutt-1.5.21/mutt_ssl_gnutls.c 2011-11-03 16:23:42.960123578 +0100
@@ -434,9 +434,16 @@ static int tls_compare_certificates (con
return 0;
Upstream fix:
http://dev.mutt.org/trac/ticket/3547
--- a/mutt_ssl_gnutls.c
+++ b/mutt_ssl_gnutls.c
@@ -440,6 +440,14 @@
}
- ptr = (unsigned char *)strstr((char*)b64_data.data, CERT_SEP) + 1;
- ptr = (unsigned char *)strstr((char*)ptr, CERT_SEP);
+ ptr = (unsigned char *)memmem((char*)b64_data.data, b64_data.size, CERT_SEP, sizeof(CERT_SEP-1));
+ if (ptr == NULL)
+ /* find start of cert, skipping junk */
+ ptr = (unsigned char *)strstr((char*)b64_data.data, CERT_SEP);
+ if (!ptr)
+ {
+ gnutls_free(cert.data);
+ FREE (&b64_data_data);
+ return 0;
+ }
+ /* find start of next cert */
+ ptr = (unsigned char *)strstr((char*)ptr + 1, CERT_SEP);
+ ptr += 1;
+ ptr = (unsigned char *)memmem((char*)ptr, b64_data.size - (ptr - b64_data.data), CERT_SEP, sizeof(CERT_SEP-1));
b64_data.size = b64_data.size - (ptr - b64_data.data);
b64_data.data = ptr;

View File

@ -18,7 +18,7 @@
Summary: A text mode mail user agent
Name: mutt
Version: 1.5.21
Release: 25%{?dist}
Release: 26%{?dist}
Epoch: 5
# The entire source code is GPLv2+ except
# pgpewrap.c setenv.c sha1.c wcwidth.c which are Public Domain
@ -181,6 +181,9 @@ ln -sf ./muttrc.5 $RPM_BUILD_ROOT%{_mandir}/man5/muttrc.local.5
%{_mandir}/man5/muttrc.*
%changelog
* Mon Oct 21 Honza Horak <hhorak@redhat.com> - 5:1.5.21-26
- Fixed patch for certificates comparison
* Mon Sep 23 2013 Miroslav Lichvar <mlichvar@redhat.com> - 5:1.5.21-25
- Revert to packaging only selected doc files