aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Kangas2019-09-16 10:45:14 +0200
committerStefan Kangas2019-09-20 20:47:47 +0200
commit6d50010b34dbbcb90a7b4512f97e07fd8beceea5 (patch)
treecc43618d3626c667c9658c4a69db8cf784563bac /src
parentb8e9baac9ada62c2ea7437579df4be9d4f437fda (diff)
downloademacs-6d50010b34dbbcb90a7b4512f97e07fd8beceea5.tar.gz
emacs-6d50010b34dbbcb90a7b4512f97e07fd8beceea5.zip
Recommend against SHA-1 and MD5 for security
* doc/lispref/text.texi (Checksum/Hash): * src/fns.c (Fmd5, Fsecure_hash): * lisp/subr.el (sha1): Doc fix to recommend against SHA-1 and MD5 for security-related applications, since they are not collision resistant. (Bug#37420)
Diffstat (limited to 'src')
-rw-r--r--src/fns.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/fns.c b/src/fns.c
index f45c729cfaf..2314b4699e7 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -5376,7 +5376,10 @@ If OBJECT is a string, the most preferred coding system (see the
5376command `prefer-coding-system') is used. 5376command `prefer-coding-system') is used.
5377 5377
5378If NOERROR is non-nil, silently assume the `raw-text' coding if the 5378If NOERROR is non-nil, silently assume the `raw-text' coding if the
5379guesswork fails. Normally, an error is signaled in such case. */) 5379guesswork fails. Normally, an error is signaled in such case.
5380
5381Note that MD5 is not collision resistant and should not be used for
5382anything security-related. See `secure-hash' for alternatives. */)
5380 (Lisp_Object object, Lisp_Object start, Lisp_Object end, Lisp_Object coding_system, Lisp_Object noerror) 5383 (Lisp_Object object, Lisp_Object start, Lisp_Object end, Lisp_Object coding_system, Lisp_Object noerror)
5381{ 5384{
5382 return secure_hash (Qmd5, object, start, end, coding_system, noerror, Qnil); 5385 return secure_hash (Qmd5, object, start, end, coding_system, noerror, Qnil);
@@ -5393,7 +5396,11 @@ whole OBJECT.
5393 5396
5394The full list of algorithms can be obtained with `secure-hash-algorithms'. 5397The full list of algorithms can be obtained with `secure-hash-algorithms'.
5395 5398
5396If BINARY is non-nil, returns a string in binary form. */) 5399If BINARY is non-nil, returns a string in binary form.
5400
5401Note that MD5 and SHA-1 are not collision resistant and should not be
5402used for anything security-related. For these applications, use one
5403of the other hash types instead, e.g. sha256 or sha512. */)
5397 (Lisp_Object algorithm, Lisp_Object object, Lisp_Object start, Lisp_Object end, Lisp_Object binary) 5404 (Lisp_Object algorithm, Lisp_Object object, Lisp_Object start, Lisp_Object end, Lisp_Object binary)
5398{ 5405{
5399 return secure_hash (algorithm, object, start, end, Qnil, Qnil, binary); 5406 return secure_hash (algorithm, object, start, end, Qnil, Qnil, binary);