unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#22603: 24.5; `mml2015-epg-check-user-id' uses `equal' to compare strings
@ 2016-02-08 22:06 David Edmondson
  2016-02-08 22:14 ` bug#22603: [PATCH v1] Compare recipients and key addresses case insensitively David Edmondson
  0 siblings, 1 reply; 3+ messages in thread
From: David Edmondson @ 2016-02-08 22:06 UTC (permalink / raw)
  To: 22603

When testing whether or not a particular OpenPGP key is a match for an
email recipient the domain part should be checked case-insensitively
(i.e. "dme@dme.org" should match "dme@DME.ORG").

Because `mml2015-epg-check-user-id' uses `equal' to perform the
comparison, this is not what happens.

It's arguable whether or not "dme@dme.org" should match "DME@dme.org"
(i.e. should the local part be checked case-insensitively or not).

From a usability perspective, it seems more useful to compare the
complete strings in a case-insensitive manner.


In GNU Emacs 24.5.1 (x86_64-apple-darwin15.0.0, NS apple-appkit-1404.11)
 of 2015-10-05 on heart-of-gold
Windowing system distributor `Apple', version 10.3.1404
Configured using:
 `configure --prefix=/usr/local/Cellar/emacs/24.5
 --enable-locallisppath=/usr/local/share/emacs/site-lisp
 --infodir=/usr/local/Cellar/emacs/24.5/share/info/emacs --with-xml2
 --without-dbus --with-gnutls --with-imagemagick --with-ns
 --disable-ns-self-contained'

Important settings:
  locale-coding-system: utf-8-unix

Major mode: notmuch-search

Minor modes in effect:
  semantic-minor-modes-format: ((:eval (if (or semantic-highlight-edits-mode semantic-show-unmatched-syntax-mode)  S)))
  magit-auto-revert-mode: t
  global-git-commit-mode: t
  async-bytecomp-package-mode: t
  TeX-PDF-mode: t
  ido-vertical-mode: t
  ido-everywhere: t
  shell-dirtrack-mode: t
  erc-track-mode: t
  erc-track-minor-mode: t
  erc-spelling-mode: t
  erc-ring-mode: t
  erc-netsplit-mode: t
  erc-list-mode: t
  erc-fill-mode: t
  erc-pcomplete-mode: t
  erc-autojoin-mode: t
  erc-match-mode: t
  erc-stamp-mode: t
  erc-irccontrols-mode: t
  erc-noncommands-mode: t
  erc-keep-place-mode: t
  erc-move-to-prompt-mode: t
  hl-line-mode: t
  diff-auto-refine-mode: t
  show-paren-mode: t
  pdf-occur-global-minor-mode: t
  winner-mode: t
  icomplete-mode: t
  override-global-mode: t
  tooltip-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
Window Switching Mode On...
Window Switching Mode Off.
Mark set [4 times]
Sending...
Mark set [4 times]
Sending via mail...
Sending...done
Mark set [7 times]
command-execute: Command attempted to use minibuffer while in minibuffer
Mark set [2 times]

Load-path shadows:
/Users/dme/.emacs.d/elpa/magit-20160117.2129/magit-popup hides /Users/dme/.emacs.d/elpa/magit-popup-20160117.1513/magit-popup
/Users/dme/.emacs.d/elpa/let-alist-1.0.4/let-alist hides /usr/local/share/emacs/site-lisp/let-alist/let-alist
/Users/dme/.emacs.d/elpa/pdf-tools-20151224.1159/pdf-virtual hides /usr/local/share/emacs/site-lisp/pdf-tools/pdf-virtual
/Users/dme/.emacs.d/elpa/pdf-tools-20151224.1159/pdf-view hides /usr/local/share/emacs/site-lisp/pdf-tools/pdf-view
/Users/dme/.emacs.d/elpa/pdf-tools-20151224.1159/pdf-util hides /usr/local/share/emacs/site-lisp/pdf-tools/pdf-util
/Users/dme/.emacs.d/elpa/pdf-tools-20151224.1159/pdf-tools hides /usr/local/share/emacs/site-lisp/pdf-tools/pdf-tools
/Users/dme/.emacs.d/elpa/pdf-tools-20151224.1159/pdf-sync hides /usr/local/share/emacs/site-lisp/pdf-tools/pdf-sync
/Users/dme/.emacs.d/elpa/pdf-tools-20151224.1159/pdf-outline hides /usr/local/share/emacs/site-lisp/pdf-tools/pdf-outline
/Users/dme/.emacs.d/elpa/pdf-tools-20151224.1159/pdf-occur hides /usr/local/share/emacs/site-lisp/pdf-tools/pdf-occur
/Users/dme/.emacs.d/elpa/pdf-tools-20151224.1159/pdf-misc hides /usr/local/share/emacs/site-lisp/pdf-tools/pdf-misc
/Users/dme/.emacs.d/elpa/pdf-tools-20151224.1159/pdf-links hides /usr/local/share/emacs/site-lisp/pdf-tools/pdf-links
/Users/dme/.emacs.d/elpa/pdf-tools-20151224.1159/pdf-isearch hides /usr/local/share/emacs/site-lisp/pdf-tools/pdf-isearch
/Users/dme/.emacs.d/elpa/pdf-tools-20151224.1159/pdf-info hides /usr/local/share/emacs/site-lisp/pdf-tools/pdf-info
/Users/dme/.emacs.d/elpa/pdf-tools-20151224.1159/pdf-history hides /usr/local/share/emacs/site-lisp/pdf-tools/pdf-history
/Users/dme/.emacs.d/elpa/pdf-tools-20151224.1159/pdf-dev hides /usr/local/share/emacs/site-lisp/pdf-tools/pdf-dev
/Users/dme/.emacs.d/elpa/pdf-tools-20151224.1159/pdf-cache hides /usr/local/share/emacs/site-lisp/pdf-tools/pdf-cache
/Users/dme/.emacs.d/elpa/pdf-tools-20151224.1159/pdf-annot hides /usr/local/share/emacs/site-lisp/pdf-tools/pdf-annot
/Users/dme/.emacs.d/elpa/tablist-20150618.2218/tablist hides /usr/local/share/emacs/site-lisp/tablist/tablist
/Users/dme/.emacs.d/elpa/tablist-20150618.2218/tablist-filter hides /usr/local/share/emacs/site-lisp/tablist/tablist-filter
/Users/dme/.emacs.d/elpa/emms-20151211.1153/tq hides /usr/local/Cellar/emacs/24.5/share/emacs/24.5/lisp/emacs-lisp/tq

Features:
(shadow emacsbug edebug mail-status flow-fill gnus-fun git-rebase nndoc
debbugs-gnu debbugs soap-client warnings xml eieio-opt speedbar sb-image
ezimage dframe smiley gnus-cite gnus-async gnus-bcklg gnus-ml disp-table
nnfolder nndraft nnmh gnus-agent gnus-srvr gnus-score score-mode
nnvirtual gnus-msg gnus-cache gnus-topic utf-7 nnimap utf7 netrc nnnil
nntp mailto nnir filladapt nnmairix nnml vc-annotate tramp-cache
epa-file epa derived epg whitespace log-view cc-langs grep linum
magit-blame magit-stash magit-bisect magit-remote magit-commit
magit-sequence magit magit-apply magit-wip magit-log magit-diff
magit-core magit-autorevert magit-process magit-popup magit-mode
magit-git magit-section magit-utils git-commit with-editor
async-bytecomp async tramp-sh tramp tramp-compat tramp-loaddefs trampver
dash apropos man texmathp preview prv-emacs tex-buf font-latex latex
tex-style tex tex-mode latexenc wdired win-switch windmove tabify
image-file erc-log descr-text iso-transl help-mode cal-china lunar solar
cal-dst cal-bahai cal-islam cal-hebrew holidays hol-loaddefs cal-iso
view parse-time smerge-mode conf-mode pcmpl-unix smex ido-vertical-mode
ido log-edit pcvs-util add-log vc vc-dispatcher sh-script smie
executable shell vc-git url-http url-gw url-auth url-queue url-cache url
url-proxy url-privacy url-expand url-methods url-history url-cookie
url-domsuf gnus-art gnus-sum nnoo gnus-group gnus-undo nnmail
mail-source gnus-start gnus-spec gnus-int gnus-range gnus-win gnus
gnus-ems pdf-sync pdf-annot pdf-outline pdf-links pdf-history misearch
multi-isearch dired-aux autorevert filenotify url-handlers ffap sendmail
mm-archive mm-uu mml2015 nnheader mail-extr sort org-table org-element
org-indent org-rmail org-mhe org-irc org-info org-gnus org-docview
doc-view org-bibtex bibtex org-bbdb org-w3m org-notmuch org-protocol
org-capture org-location-google-maps org-agenda google-maps
google-maps-static url-util url-parse url-vars google-maps-geocode
google-maps-base json org org-macro org-footnote org-pcomplete org-list
org-faces org-entities org-version ob-emacs-lisp ob ob-tangle ob-ref
ob-lob ob-table ob-exp org-src ob-keys ob-comint ob-core ob-eval
org-compat org-macs org-loaddefs find-func company-files company-oddmuse
company-keywords company-etags etags company-gtags company-dabbrev-code
company-dabbrev company-capf company-cmake company-xcode company-clang
company-semantic company-eclim company-template company-css company-nxml
company-bbdb company pcase qp gnutls network-stream starttls tls
erc-track erc-spelling erc-ring erc-netsplit erc-list erc-fill
erc-pcomplete pcomplete erc-join erc-match erc-stamp erc-goodies erc
erc-backend erc-compat auth-source gnus-util shr-color color shr
browse-url notmuch-config notmuch hl-line notmuch-message
notmuch-maildir-fcc notmuch-tree notmuch-show notmuch-print
notmuch-crypto notmuch-wash diff-mode coolj notmuch-query goto-addr
icalendar diary-lib diary-loaddefs cal-menu calendar cal-loaddefs
notmuch-tag crm server paren pdf-occur ibuf-ext ibuffer tablist
tablist-filter semantic/wisent/comp semantic/wisent
semantic/wisent/wisent semantic/util-modes semantic/util semantic
semantic/tag semantic/lex semantic/fw eieio eieio-core mode-local cedet
pdf-isearch let-alist pdf-misc imenu pdf-tools compile comint ansi-color
cus-edit cus-start cus-load pdf-view mule-util bookmark pp jka-compr
pdf-cache pdf-info tq pdf-util image-mode cl-macs notmuch-jump
notmuch-hello notmuch-mua notmuch-address notmuch-company notmuch-parser
wid-edit notmuch-lib cl gv mm-view mml-smime smime password-cache dig
mailcap message idna format-spec rfc822 mml mml-sec mm-decode mm-bodies
mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mm-util
mail-prsvr mailabbrev mail-utils gmm-utils mailheader footnote cc-mode
cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars
cc-defs markdown-mode thingatpt noutline outline paredit flyspell ispell
git-annex byte-opt advice winner ring icomplete finder-inf eldoc
help-fns edmacro kmacro dired exec-path-from-shell use-package diminish
bytecomp byte-compile cl-extra cconv bind-key easy-mmode cl-loaddefs
cl-lib tex-site info easymenu package epg-config time-date tooltip
electric uniquify ediff-hook vc-hooks lisp-float-type mwheel ns-win
tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment
lisp-mode prog-mode register page menu-bar rfn-eshadow timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham
georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese hebrew greek romanian slovak czech european ethiopic
indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple
abbrev minibuffer nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
cocoa ns multi-tty emacs)

Memory information:
((conses 16 2377794 268545)
 (symbols 48 163363 0)
 (miscs 40 12390 20188)
 (strings 32 370453 60168)
 (string-bytes 1 60105795)
 (vectors 16 79621)
 (vector-slots 8 2041040 142286)
 (floats 8 25653 2430)
 (intervals 56 216242 3568)
 (buffers 960 349))





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#22603: [PATCH v1] Compare recipients and key addresses case insensitively
  2016-02-08 22:06 bug#22603: 24.5; `mml2015-epg-check-user-id' uses `equal' to compare strings David Edmondson
@ 2016-02-08 22:14 ` David Edmondson
  2016-02-08 23:27   ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: David Edmondson @ 2016-02-08 22:14 UTC (permalink / raw)
  To: 22603

* lisp/gnus/mml2015.el: (mml-secure-check-user-id): When comparing a
  recipient address with that from a key, do so in a case insensitive
  manner.
---
 lisp/gnus/mml-sec.el | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lisp/gnus/mml-sec.el b/lisp/gnus/mml-sec.el
index 48e6384..3ac3da0 100644
--- a/lisp/gnus/mml-sec.el
+++ b/lisp/gnus/mml-sec.el
@@ -655,10 +655,10 @@ mml-secure-check-user-id
     (catch 'break
       (dolist (uid uids nil)
 	(if (and (stringp (epg-user-id-string uid))
-		 (equal (car (mail-header-parse-address
-			      (epg-user-id-string uid)))
-			(car (mail-header-parse-address
-			      recipient)))
+		 (equal (downcase (car (mail-header-parse-address
+					(epg-user-id-string uid))))
+			(downcase (car (mail-header-parse-address
+					recipient))))
 		 (not (memq (epg-user-id-validity uid)
 			    '(revoked expired))))
 	    (throw 'break t))))))
-- 
2.6.3






^ permalink raw reply related	[flat|nested] 3+ messages in thread

* bug#22603: [PATCH v1] Compare recipients and key addresses case insensitively
  2016-02-08 22:14 ` bug#22603: [PATCH v1] Compare recipients and key addresses case insensitively David Edmondson
@ 2016-02-08 23:27   ` Lars Ingebrigtsen
  0 siblings, 0 replies; 3+ messages in thread
From: Lars Ingebrigtsen @ 2016-02-08 23:27 UTC (permalink / raw)
  To: David Edmondson; +Cc: 22603

David Edmondson <dme@dme.org> writes:

> * lisp/gnus/mml2015.el: (mml-secure-check-user-id): When comparing a
>   recipient address with that from a key, do so in a case insensitive
>   manner.

Thanks; applied to emacs-25.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-02-08 23:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-08 22:06 bug#22603: 24.5; `mml2015-epg-check-user-id' uses `equal' to compare strings David Edmondson
2016-02-08 22:14 ` bug#22603: [PATCH v1] Compare recipients and key addresses case insensitively David Edmondson
2016-02-08 23:27   ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).