From cc78d5339ce8b9c2c5bf38b89fa9ea3ba748fdd4 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 15 Jul 2017 14:41:44 +0300 Subject: [PATCH] Improve some GnuTL error messages * src/gnutls.c (gnutls_symmetric_aead, gnutls_symmetric): * src/fns.c (Fsecure_hash_algorithms): Fix error messages. --- src/fns.c | 4 ++-- src/gnutls.c | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/fns.c b/src/fns.c index fb1296bc6f0..d849618f2b7 100644 --- a/src/fns.c +++ b/src/fns.c @@ -4931,7 +4931,7 @@ extract_data_from_object (Lisp_Object spec, /* Format: (iv-auto REQUIRED-LENGTH). */ if (! NATNUMP (start)) - error ("Without a length, iv-auto can't be used. See manual."); + error ("Without a length, `iv-auto' can't be used; see ELisp manual"); else { EMACS_INT start_hold = XFASTINT (start); @@ -4942,7 +4942,7 @@ extract_data_from_object (Lisp_Object spec, *end_byte = start_hold; } #else - error ("GnuTLS integration is not available, so iv-auto can't be used."); + error ("GnuTLS is not available, so `iv-auto' can't be used"); #endif } diff --git a/src/gnutls.c b/src/gnutls.c index 7dff0a4cddc..5e14a3af333 100644 --- a/src/gnutls.c +++ b/src/gnutls.c @@ -1950,8 +1950,12 @@ gnutls_symmetric_aead (bool encrypting, gnutls_cipher_algorithm_t gca, memset (storage, 0, storage_length); SAFE_FREE (); gnutls_aead_cipher_deinit (acipher); - error ("GnuTLS AEAD cipher %s %sion failed: %s", - gnutls_cipher_get_name (gca), desc, emacs_gnutls_strerror (ret)); + if (encrypting) + error ("GnuTLS AEAD cipher %s encryption failed: %s", + gnutls_cipher_get_name (gca), emacs_gnutls_strerror (ret)); + else + error ("GnuTLS AEAD cipher %s decryption failed: %s", + gnutls_cipher_get_name (gca), emacs_gnutls_strerror (ret)); } gnutls_aead_cipher_deinit (acipher); @@ -2096,8 +2100,12 @@ gnutls_symmetric (bool encrypting, Lisp_Object cipher, if (ret < GNUTLS_E_SUCCESS) { gnutls_cipher_deinit (hcipher); - error ("GnuTLS cipher %s %sion failed: %s", - gnutls_cipher_get_name (gca), desc, emacs_gnutls_strerror (ret)); + if (encrypting) + error ("GnuTLS cipher %s encryption failed: %s", + gnutls_cipher_get_name (gca), emacs_gnutls_strerror (ret)); + else + error ("GnuTLS cipher %s decryption failed: %s", + gnutls_cipher_get_name (gca), emacs_gnutls_strerror (ret)); } gnutls_cipher_deinit (hcipher); -- 2.39.2