aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2017-07-18 00:37:03 -0700
committerPaul Eggert2017-07-18 00:37:32 -0700
commit1a62721f2d82f7a35a9fc84864f6df0ede2c05c5 (patch)
tree2315cbb781025bce0e48eedac7b0a66799ceb26f /src
parent0083123499cc29e301c197218d3809b225675e57 (diff)
downloademacs-1a62721f2d82f7a35a9fc84864f6df0ede2c05c5.tar.gz
emacs-1a62721f2d82f7a35a9fc84864f6df0ede2c05c5.zip
Port gnutls.c to older (buggier?) GnuTLS
Problem reported for GnuTLS 3.2.1 by Glenn Morris in: http://lists.gnu.org/archive/html/emacs-devel/2017-07/msg00716.html http://lists.gnu.org/archive/html/emacs-devel/2017-07/msg00742.html Although I don't see how this bug can occur with vanilla GnuTLS 3.2.1, perhaps hydra was using a modified GnuTLS. * src/gnutls.c (Fgnutls_ciphers): Don't assume GNUTLS_CIPHER_NULL is at the end of the list returned by gnutls_cipher_list, or that the earlier ciphers all have non-null names.
Diffstat (limited to 'src')
-rw-r--r--src/gnutls.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gnutls.c b/src/gnutls.c
index 9fbaea2f405..e406d665190 100644
--- a/src/gnutls.c
+++ b/src/gnutls.c
@@ -1854,12 +1854,17 @@ The alist key is the cipher name. */)
1854 1854
1855#ifdef HAVE_GNUTLS3_CIPHER 1855#ifdef HAVE_GNUTLS3_CIPHER
1856 const gnutls_cipher_algorithm_t *gciphers = gnutls_cipher_list (); 1856 const gnutls_cipher_algorithm_t *gciphers = gnutls_cipher_list ();
1857 for (ptrdiff_t pos = 0; gciphers[pos] != GNUTLS_CIPHER_NULL; pos++) 1857 for (ptrdiff_t pos = 0; gciphers[pos] != 0; pos++)
1858 { 1858 {
1859 gnutls_cipher_algorithm_t gca = gciphers[pos]; 1859 gnutls_cipher_algorithm_t gca = gciphers[pos];
1860 if (gca == GNUTLS_CIPHER_NULL)
1861 continue;
1862 char const *cipher_name = gnutls_cipher_get_name (gca);
1863 if (!cipher_name)
1864 continue;
1860 1865
1861 /* A symbol representing the GnuTLS cipher. */ 1866 /* A symbol representing the GnuTLS cipher. */
1862 Lisp_Object cipher_symbol = intern (gnutls_cipher_get_name (gca)); 1867 Lisp_Object cipher_symbol = intern (cipher_name);
1863 1868
1864 ptrdiff_t cipher_tag_size = gnutls_cipher_get_tag_size (gca); 1869 ptrdiff_t cipher_tag_size = gnutls_cipher_get_tag_size (gca);
1865 1870