aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2017-07-15 14:41:44 +0300
committerEli Zaretskii2017-07-15 14:41:44 +0300
commitcc78d5339ce8b9c2c5bf38b89fa9ea3ba748fdd4 (patch)
treed91c9fa308b133daf6dfcae5ec2d0d408dade875 /src
parent1f161104ce4e275b056b5987976f9f2adb421221 (diff)
downloademacs-cc78d5339ce8b9c2c5bf38b89fa9ea3ba748fdd4.tar.gz
emacs-cc78d5339ce8b9c2c5bf38b89fa9ea3ba748fdd4.zip
Improve some GnuTL error messages
* src/gnutls.c (gnutls_symmetric_aead, gnutls_symmetric): * src/fns.c (Fsecure_hash_algorithms): Fix error messages.
Diffstat (limited to 'src')
-rw-r--r--src/fns.c4
-rw-r--r--src/gnutls.c16
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,
4931 /* Format: (iv-auto REQUIRED-LENGTH). */ 4931 /* Format: (iv-auto REQUIRED-LENGTH). */
4932 4932
4933 if (! NATNUMP (start)) 4933 if (! NATNUMP (start))
4934 error ("Without a length, iv-auto can't be used. See manual."); 4934 error ("Without a length, `iv-auto' can't be used; see ELisp manual");
4935 else 4935 else
4936 { 4936 {
4937 EMACS_INT start_hold = XFASTINT (start); 4937 EMACS_INT start_hold = XFASTINT (start);
@@ -4942,7 +4942,7 @@ extract_data_from_object (Lisp_Object spec,
4942 *end_byte = start_hold; 4942 *end_byte = start_hold;
4943 } 4943 }
4944#else 4944#else
4945 error ("GnuTLS integration is not available, so iv-auto can't be used."); 4945 error ("GnuTLS is not available, so `iv-auto' can't be used");
4946#endif 4946#endif
4947 } 4947 }
4948 4948
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,
1950 memset (storage, 0, storage_length); 1950 memset (storage, 0, storage_length);
1951 SAFE_FREE (); 1951 SAFE_FREE ();
1952 gnutls_aead_cipher_deinit (acipher); 1952 gnutls_aead_cipher_deinit (acipher);
1953 error ("GnuTLS AEAD cipher %s %sion failed: %s", 1953 if (encrypting)
1954 gnutls_cipher_get_name (gca), desc, emacs_gnutls_strerror (ret)); 1954 error ("GnuTLS AEAD cipher %s encryption failed: %s",
1955 gnutls_cipher_get_name (gca), emacs_gnutls_strerror (ret));
1956 else
1957 error ("GnuTLS AEAD cipher %s decryption failed: %s",
1958 gnutls_cipher_get_name (gca), emacs_gnutls_strerror (ret));
1955 } 1959 }
1956 1960
1957 gnutls_aead_cipher_deinit (acipher); 1961 gnutls_aead_cipher_deinit (acipher);
@@ -2096,8 +2100,12 @@ gnutls_symmetric (bool encrypting, Lisp_Object cipher,
2096 if (ret < GNUTLS_E_SUCCESS) 2100 if (ret < GNUTLS_E_SUCCESS)
2097 { 2101 {
2098 gnutls_cipher_deinit (hcipher); 2102 gnutls_cipher_deinit (hcipher);
2099 error ("GnuTLS cipher %s %sion failed: %s", 2103 if (encrypting)
2100 gnutls_cipher_get_name (gca), desc, emacs_gnutls_strerror (ret)); 2104 error ("GnuTLS cipher %s encryption failed: %s",
2105 gnutls_cipher_get_name (gca), emacs_gnutls_strerror (ret));
2106 else
2107 error ("GnuTLS cipher %s decryption failed: %s",
2108 gnutls_cipher_get_name (gca), emacs_gnutls_strerror (ret));
2101 } 2109 }
2102 2110
2103 gnutls_cipher_deinit (hcipher); 2111 gnutls_cipher_deinit (hcipher);