From: Eli Zaretskii Date: Sat, 15 Jul 2017 11:41:44 +0000 (+0300) Subject: Improve some GnuTL error messages X-Git-Tag: emacs-26.0.90~518^2~95 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=cc78d5339ce8b9c2c5bf38b89fa9ea3ba748fdd4;p=emacs.git Improve some GnuTL error messages * src/gnutls.c (gnutls_symmetric_aead, gnutls_symmetric): * src/fns.c (Fsecure_hash_algorithms): Fix error messages. --- 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);