* #secure smime signencrypt not working to myself @ 2005-03-01 16:29 David S. Goldberg 2005-03-06 21:14 ` Arne Jørgensen 0 siblings, 1 reply; 6+ messages in thread From: David S. Goldberg @ 2005-03-01 16:29 UTC (permalink / raw) A while back I posted my method for doing smime encryption and signatures by building a multipart around the entire message and call mml-secure-encrypt-smime and mml-secure-sign-smime and going through the headers to insert the appropriate key and cert files. The recent changes made to gnus' smime functionality encouraged me to try to work in a more "standard" fashion so I set up mml-encrypt-alist to use my function to traverse the headers and determine the appropriate key and cert files (I still haven't had much luck with the new ldap interface, probably because I use XEmacs) without prompting when I run mml-secure-message-encrypt-smime and it works mostly great with one exception. Messages either sent to my self via mail or gcc are not readable. I get an error: Could not identify PKCS#7 type. Thunderbird is also unable to read the message so it's not just some weird limitation in gnus. On the command line I'm able to pipe openssl smime -decrypt to openssl smime -verify to read the message. Go figure. mml-signencrypt-style-alist is the default with smime set to separate, but it's apparently not equivalent to having two mode tags in the #secure which is just as well since #secure only seems to be willing to recognize one mode tag anyway. Any thoughts on how to track this down? Thanks, -- Dave Goldberg david.goldberg6@verizon.net ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: #secure smime signencrypt not working to myself 2005-03-01 16:29 #secure smime signencrypt not working to myself David S. Goldberg @ 2005-03-06 21:14 ` Arne Jørgensen 2005-04-13 12:44 ` Ldap certificate retrieval in XEmacs (was: #secure smime signencrypt not working to myself) Arne Jørgensen 0 siblings, 1 reply; 6+ messages in thread From: Arne Jørgensen @ 2005-03-06 21:14 UTC (permalink / raw) Sorry for not answering earlier but I've been in Scotland for a few days. david.goldberg6@verizon.net (David S. Goldberg) writes: > (I still haven't had much luck with the new ldap interface, probably > because I use XEmacs) Yes. XEmacs' ldap support is very different from Emacs'. I don't use XEmacs my self, but will have a look at it anyhow. It will probably have to wait until eastern because I'm going to Finland on Wednesday. > without prompting when I run > mml-secure-message-encrypt-smime and it works mostly great with one > exception. Messages either sent to my self via mail or gcc are not > readable. I get an error: Could not identify PKCS#7 type. > Thunderbird is also unable to read the message so it's not just some > weird limitation in gnus. On the command line I'm able to pipe > openssl smime -decrypt to openssl smime -verify to read the message. > Go figure. mml-signencrypt-style-alist is the default with smime set > to separate, but it's apparently not equivalent to having two mode > tags in the #secure which is just as well since #secure only seems to > be willing to recognize one mode tag anyway. Any thoughts on how to > track this down? Not really. Is it only when sending mails/copies to your self? Could you try sending an encrypted and/or signed mail to me? (you can get the certificate from http://certifikat.arnested.dk/). Kind regards, -- Arne Jørgensen <http://arnested.dk/> ^ permalink raw reply [flat|nested] 6+ messages in thread
* Ldap certificate retrieval in XEmacs (was: #secure smime signencrypt not working to myself) 2005-03-06 21:14 ` Arne Jørgensen @ 2005-04-13 12:44 ` Arne Jørgensen 2005-04-14 11:27 ` Ldap certificate retrieval in XEmacs Arne Jørgensen 2005-04-14 11:41 ` Arne Jørgensen 0 siblings, 2 replies; 6+ messages in thread From: Arne Jørgensen @ 2005-04-13 12:44 UTC (permalink / raw) [-- Attachment #1: Type: text/plain, Size: 821 bytes --] Arne Jørgensen <arne@arnested.dk> writes: > david.goldberg6@verizon.net (David S. Goldberg) writes: > >> (I still haven't had much luck with the new ldap interface, probably >> because I use XEmacs) > > Yes. XEmacs' ldap support is very different from Emacs'. I don't use > XEmacs my self, but will have a look at it anyhow. It will probably > have to wait until eastern because I'm going to Finland on Wednesday. We are several weeks past eastern, but I didn't have the time to look at this before today. It actually seems quite simpel to fix. That is if the attached patch works (I don't have a working XEmacs/Gnus combination). Will someone please try the attached patch to see if it is possible to retrieve a certificate for S/MIME encryption in XEmacs? Kind regards, -- Arne Jørgensen <http://arnested.dk/> [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: smime-ldap.patch --] [-- Type: text/x-patch, Size: 2531 bytes --] Index: lisp/smime-ldap.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/smime-ldap.el,v retrieving revision 7.3 diff -u -p -r7.3 smime-ldap.el --- lisp/smime-ldap.el 15 Feb 2005 01:58:42 -0000 7.3 +++ lisp/smime-ldap.el 13 Apr 2005 12:44:06 -0000 @@ -35,10 +35,15 @@ ;; smime.el changed to ;; - (require 'smime-ldap) => (require 'ldap) -;; - (smime-ldap-search ...) => (ldap-search ...) +;; - and add +;; (defalias 'smime-ldap-search +;; (if (fboundp 'ldap-search-entries) +;; 'ldap-search-entries +;; 'ldap-search)) ;; If we are running in Emacs 22 or newer it just uses the build-in -;; version of ldap-search. +;; version of ldap-search and if we are running XEmacs it uses the +;; build-in ldap-search-entries. ;;; Code: @@ -57,26 +62,31 @@ its distinguished name WITHDN. Additional search parameters can be specified through `ldap-host-parameters-alist', which see." (interactive "sFilter:") - (if (>= emacs-major-version 22) - (ldap-search filter host attributes attrsonly) - (or host - (setq host ldap-default-host) - (error "No LDAP host specified")) - (let ((host-plist (cdr (assoc host ldap-host-parameters-alist))) - result) - (setq result (smime-ldap-search-internal - (append host-plist - (list 'host host - 'filter filter - 'attributes attributes - 'attrsonly attrsonly - 'withdn withdn)))) - (if ldap-ignore-attribute-codings - result - (mapcar (function - (lambda (record) - (mapcar 'ldap-decode-attribute record))) - result))))) + ;; for XEmacs + (if (fboundp 'ldap-search-entries) + (ldap-search-entries filter host attributes attrsonly) + ;; for Emacs 22 + (if (>= emacs-major-version 22) + (ldap-search filter host attributes attrsonly) + ;; for Emacs 21.x + (or host + (setq host ldap-default-host) + (error "No LDAP host specified")) + (let ((host-plist (cdr (assoc host ldap-host-parameters-alist))) + result) + (setq result (smime-ldap-search-internal + (append host-plist + (list 'host host + 'filter filter + 'attributes attributes + 'attrsonly attrsonly + 'withdn withdn)))) + (if ldap-ignore-attribute-codings + result + (mapcar (function + (lambda (record) + (mapcar 'ldap-decode-attribute record))) + result)))))) (defun smime-ldap-search-internal (search-plist) "Perform a search on a LDAP server. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Ldap certificate retrieval in XEmacs 2005-04-13 12:44 ` Ldap certificate retrieval in XEmacs (was: #secure smime signencrypt not working to myself) Arne Jørgensen @ 2005-04-14 11:27 ` Arne Jørgensen 2005-04-14 11:41 ` Arne Jørgensen 1 sibling, 0 replies; 6+ messages in thread From: Arne Jørgensen @ 2005-04-14 11:27 UTC (permalink / raw) [-- Attachment #1: Type: text/plain, Size: 560 bytes --] Arne Jørgensen <arne@arnested.dk> writes: > It actually seems quite simpel to fix. That is if the attached patch > works (I don't have a working XEmacs/Gnus combination). I managed to get a working XEmacs/Gnus and the patch didn't work. Emacs' ldap-search and Xemacs' ldap-search-entries gives different results although they have identical parameters. An adjusted patch is attach. I have tested it and it works in Emacs 21.3.1, CVS Emacs 22, and Xemacs 21.4.17. So it should be safe to apply it. Kind regards, -- Arne Jørgensen <http://arnested.dk/> [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: smime-ldap.patch --] [-- Type: text/x-patch, Size: 3367 bytes --] Index: lisp/smime.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/smime.el,v retrieving revision 7.10 diff -u -p -r7.10 smime.el --- lisp/smime.el 31 Mar 2005 20:09:53 -0000 7.10 +++ lisp/smime.el 14 Apr 2005 11:22:12 -0000 @@ -577,9 +577,9 @@ A string or a list of strings is returne host '("userCertificate") nil)) (retbuf (generate-new-buffer (format "*certificate for %s*" mail))) cert) - (if (> (length ldapresult) 1) + (if (>= (length ldapresult) 1) (with-current-buffer retbuf - (setq cert (base64-encode-string (nth 1 (car (nth 1 ldapresult))) t)) + (setq cert (base64-encode-string (cadaar ldapresult) t)) (insert "-----BEGIN CERTIFICATE-----\n") (let ((i 0) (len (length cert))) (while (> (- len 64) i) Index: lisp/smime-ldap.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/smime-ldap.el,v retrieving revision 7.3 diff -u -p -r7.3 smime-ldap.el --- lisp/smime-ldap.el 15 Feb 2005 01:58:42 -0000 7.3 +++ lisp/smime-ldap.el 14 Apr 2005 11:22:12 -0000 @@ -31,14 +31,7 @@ ;; made to achieve compatibility with OpenLDAP v2 and to make it ;; possible to retrieve LDAP attributes that are tagged ie ";binary". -;; When Gnus drops support for Emacs 21.x this file can be removed and -;; smime.el changed to - -;; - (require 'smime-ldap) => (require 'ldap) -;; - (smime-ldap-search ...) => (ldap-search ...) - -;; If we are running in Emacs 22 or newer it just uses the build-in -;; version of ldap-search. +;; The file also adds a compatibility layer between Emacs and XEmacs. ;;; Code: @@ -57,26 +50,31 @@ its distinguished name WITHDN. Additional search parameters can be specified through `ldap-host-parameters-alist', which see." (interactive "sFilter:") - (if (>= emacs-major-version 22) - (ldap-search filter host attributes attrsonly) - (or host - (setq host ldap-default-host) - (error "No LDAP host specified")) - (let ((host-plist (cdr (assoc host ldap-host-parameters-alist))) - result) - (setq result (smime-ldap-search-internal - (append host-plist - (list 'host host - 'filter filter - 'attributes attributes - 'attrsonly attrsonly - 'withdn withdn)))) - (if ldap-ignore-attribute-codings - result - (mapcar (function - (lambda (record) - (mapcar 'ldap-decode-attribute record))) - result))))) + ;; for XEmacs + (if (fboundp 'ldap-search-entries) + (ldap-search-entries filter host attributes attrsonly) + ;; for Emacs 22 + (if (>= emacs-major-version 22) + (cdr (ldap-search filter host attributes attrsonly)) + ;; for Emacs 21.x + (or host + (setq host ldap-default-host) + (error "No LDAP host specified")) + (let ((host-plist (cdr (assoc host ldap-host-parameters-alist))) + result) + (setq result (smime-ldap-search-internal + (append host-plist + (list 'host host + 'filter filter + 'attributes attributes + 'attrsonly attrsonly + 'withdn withdn)))) + (cdr (if ldap-ignore-attribute-codings + result + (mapcar (function + (lambda (record) + (mapcar 'ldap-decode-attribute record))) + result))))))) (defun smime-ldap-search-internal (search-plist) "Perform a search on a LDAP server. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Ldap certificate retrieval in XEmacs 2005-04-13 12:44 ` Ldap certificate retrieval in XEmacs (was: #secure smime signencrypt not working to myself) Arne Jørgensen 2005-04-14 11:27 ` Ldap certificate retrieval in XEmacs Arne Jørgensen @ 2005-04-14 11:41 ` Arne Jørgensen 2005-04-26 12:07 ` Arne Jørgensen 1 sibling, 1 reply; 6+ messages in thread From: Arne Jørgensen @ 2005-04-14 11:41 UTC (permalink / raw) [-- Attachment #1: Type: text/plain, Size: 554 bytes --] Arne Jørgensen <arne@arnested.dk> writes: > It actually seems quite simpel to fix. That is if the attached patch > works (I don't have a working XEmacs/Gnus combination). I managed to get a working XEmacs/Gnus and the patch didn't work. Emacs' ldap-search and Xemacs' ldap-search-entries gives diffrent results although they have identical parameters. An adjusted patch is attach. I have tested it and it works in Emacs 21.3.1, CVS Emacs and Xemacs 21.4.17. So it should be safe to apply it. Kind regards, -- Arne Jørgensen <http://arnested.dk/> [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: smime-ldap.patch --] [-- Type: text/x-patch, Size: 3971 bytes --] Index: lisp/smime.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/smime.el,v retrieving revision 7.10 diff -u -p -r7.10 smime.el --- lisp/smime.el 31 Mar 2005 20:09:53 -0000 7.10 +++ lisp/smime.el 14 Apr 2005 11:37:51 -0000 @@ -577,9 +577,9 @@ A string or a list of strings is returne host '("userCertificate") nil)) (retbuf (generate-new-buffer (format "*certificate for %s*" mail))) cert) - (if (> (length ldapresult) 1) + (if (>= (length ldapresult) 1) (with-current-buffer retbuf - (setq cert (base64-encode-string (nth 1 (car (nth 1 ldapresult))) t)) + (setq cert (base64-encode-string (cadaar ldapresult) t)) (insert "-----BEGIN CERTIFICATE-----\n") (let ((i 0) (len (length cert))) (while (> (- len 64) i) Index: lisp/smime-ldap.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/smime-ldap.el,v retrieving revision 7.3 diff -u -p -r7.3 smime-ldap.el --- lisp/smime-ldap.el 15 Feb 2005 01:58:42 -0000 7.3 +++ lisp/smime-ldap.el 14 Apr 2005 11:37:51 -0000 @@ -31,14 +31,7 @@ ;; made to achieve compatibility with OpenLDAP v2 and to make it ;; possible to retrieve LDAP attributes that are tagged ie ";binary". -;; When Gnus drops support for Emacs 21.x this file can be removed and -;; smime.el changed to - -;; - (require 'smime-ldap) => (require 'ldap) -;; - (smime-ldap-search ...) => (ldap-search ...) - -;; If we are running in Emacs 22 or newer it just uses the build-in -;; version of ldap-search. +;; The file also adds a compatibility layer for Emacs and XEmacs. ;;; Code: @@ -57,26 +50,31 @@ its distinguished name WITHDN. Additional search parameters can be specified through `ldap-host-parameters-alist', which see." (interactive "sFilter:") - (if (>= emacs-major-version 22) - (ldap-search filter host attributes attrsonly) - (or host - (setq host ldap-default-host) - (error "No LDAP host specified")) - (let ((host-plist (cdr (assoc host ldap-host-parameters-alist))) - result) - (setq result (smime-ldap-search-internal - (append host-plist - (list 'host host - 'filter filter - 'attributes attributes - 'attrsonly attrsonly - 'withdn withdn)))) - (if ldap-ignore-attribute-codings - result - (mapcar (function - (lambda (record) - (mapcar 'ldap-decode-attribute record))) - result))))) + ;; for XEmacs + (if (fboundp 'ldap-search-entries) + (ldap-search-entries filter host attributes attrsonly) + ;; for Emacs 22 + (if (>= emacs-major-version 22) + (cdr (ldap-search filter host attributes attrsonly)) + ;; for Emacs 21.x + (or host + (setq host ldap-default-host) + (error "No LDAP host specified")) + (let ((host-plist (cdr (assoc host ldap-host-parameters-alist))) + result) + (setq result (smime-ldap-search-internal + (append host-plist + (list 'host host + 'filter filter + 'attributes attributes + 'attrsonly attrsonly + 'withdn withdn)))) + (cdr (if ldap-ignore-attribute-codings + result + (mapcar (function + (lambda (record) + (mapcar 'ldap-decode-attribute record))) + result))))))) (defun smime-ldap-search-internal (search-plist) "Perform a search on a LDAP server. Index: lisp/ChangeLog =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/ChangeLog,v retrieving revision 7.678 diff -u -p -r7.678 ChangeLog --- lisp/ChangeLog 13 Apr 2005 06:41:12 -0000 7.678 +++ lisp/ChangeLog 14 Apr 2005 11:37:54 -0000 @@ -1,3 +1,9 @@ +2005-04-14 Arne J^[,Ax^[(Brgensen <arne@arnested.dk> + + * smime-ldap.el (smime-ldap-search): Add compatibility for XEmacs. + + * smime.el (smime-cert-by-ldap-1): Adjust for the above. + 2005-04-13 Katsumi Yamaoka <yamaoka@jpl.org> * lpath.el: Fbind display-time-event-handler; don't fbind ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Ldap certificate retrieval in XEmacs 2005-04-14 11:41 ` Arne Jørgensen @ 2005-04-26 12:07 ` Arne Jørgensen 0 siblings, 0 replies; 6+ messages in thread From: Arne Jørgensen @ 2005-04-26 12:07 UTC (permalink / raw) [-- Attachment #1: Type: text/plain, Size: 701 bytes --] Arne Jørgensen <arne@arnested.dk> writes: > Arne Jørgensen <arne@arnested.dk> writes: > >> It actually seems quite simpel to fix. That is if the attached patch >> works (I don't have a working XEmacs/Gnus combination). > > I managed to get a working XEmacs/Gnus and the patch didn't work. > Emacs' ldap-search and Xemacs' ldap-search-entries gives diffrent > results although they have identical parameters. > > An adjusted patch is attach. I have tested it and it works in Emacs > 21.3.1, CVS Emacs and Xemacs 21.4.17. So it should be safe to apply > it. There has been no comments to the change so would someone be so kind to commit it? Kind regards, -- Arne Jørgensen <http://arnested.dk/> [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: Patch to fix compability with XEmacs --] [-- Type: text/x-patch, Size: 3978 bytes --] Index: lisp/ChangeLog =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/ChangeLog,v retrieving revision 7.689 diff -u -p -r7.689 ChangeLog --- lisp/ChangeLog 25 Apr 2005 07:22:34 -0000 7.689 +++ lisp/ChangeLog 26 Apr 2005 11:52:43 -0000 @@ -1,3 +1,9 @@ +2005-04-26 Arne J^[,Ax^[(Brgensen <arne@arnested.dk> + + * smime-ldap.el (smime-ldap-search): Add compatibility for XEmacs. + + * smime.el (smime-cert-by-ldap-1): Adjust for the above. + 2005-04-25 Katsumi Yamaoka <yamaoka@jpl.org> * gnus-art.el (article-date-ut): Don't delete X-Sent header when Index: lisp/smime-ldap.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/smime-ldap.el,v retrieving revision 7.3 diff -u -p -r7.3 smime-ldap.el --- lisp/smime-ldap.el 15 Feb 2005 01:58:42 -0000 7.3 +++ lisp/smime-ldap.el 26 Apr 2005 11:52:43 -0000 @@ -31,14 +31,7 @@ ;; made to achieve compatibility with OpenLDAP v2 and to make it ;; possible to retrieve LDAP attributes that are tagged ie ";binary". -;; When Gnus drops support for Emacs 21.x this file can be removed and -;; smime.el changed to - -;; - (require 'smime-ldap) => (require 'ldap) -;; - (smime-ldap-search ...) => (ldap-search ...) - -;; If we are running in Emacs 22 or newer it just uses the build-in -;; version of ldap-search. +;; The file also adds a compatibility layer for Emacs and XEmacs. ;;; Code: @@ -57,26 +50,31 @@ its distinguished name WITHDN. Additional search parameters can be specified through `ldap-host-parameters-alist', which see." (interactive "sFilter:") - (if (>= emacs-major-version 22) - (ldap-search filter host attributes attrsonly) - (or host - (setq host ldap-default-host) - (error "No LDAP host specified")) - (let ((host-plist (cdr (assoc host ldap-host-parameters-alist))) - result) - (setq result (smime-ldap-search-internal - (append host-plist - (list 'host host - 'filter filter - 'attributes attributes - 'attrsonly attrsonly - 'withdn withdn)))) - (if ldap-ignore-attribute-codings - result - (mapcar (function - (lambda (record) - (mapcar 'ldap-decode-attribute record))) - result))))) + ;; for XEmacs + (if (fboundp 'ldap-search-entries) + (ldap-search-entries filter host attributes attrsonly) + ;; for Emacs 22 + (if (>= emacs-major-version 22) + (cdr (ldap-search filter host attributes attrsonly)) + ;; for Emacs 21.x + (or host + (setq host ldap-default-host) + (error "No LDAP host specified")) + (let ((host-plist (cdr (assoc host ldap-host-parameters-alist))) + result) + (setq result (smime-ldap-search-internal + (append host-plist + (list 'host host + 'filter filter + 'attributes attributes + 'attrsonly attrsonly + 'withdn withdn)))) + (cdr (if ldap-ignore-attribute-codings + result + (mapcar (function + (lambda (record) + (mapcar 'ldap-decode-attribute record))) + result))))))) (defun smime-ldap-search-internal (search-plist) "Perform a search on a LDAP server. Index: lisp/smime.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/smime.el,v retrieving revision 7.10 diff -u -p -r7.10 smime.el --- lisp/smime.el 31 Mar 2005 20:09:53 -0000 7.10 +++ lisp/smime.el 26 Apr 2005 11:52:44 -0000 @@ -577,9 +577,9 @@ A string or a list of strings is returne host '("userCertificate") nil)) (retbuf (generate-new-buffer (format "*certificate for %s*" mail))) cert) - (if (> (length ldapresult) 1) + (if (>= (length ldapresult) 1) (with-current-buffer retbuf - (setq cert (base64-encode-string (nth 1 (car (nth 1 ldapresult))) t)) + (setq cert (base64-encode-string (cadaar ldapresult) t)) (insert "-----BEGIN CERTIFICATE-----\n") (let ((i 0) (len (length cert))) (while (> (- len 64) i) ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2005-04-26 12:07 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2005-03-01 16:29 #secure smime signencrypt not working to myself David S. Goldberg 2005-03-06 21:14 ` Arne Jørgensen 2005-04-13 12:44 ` Ldap certificate retrieval in XEmacs (was: #secure smime signencrypt not working to myself) Arne Jørgensen 2005-04-14 11:27 ` Ldap certificate retrieval in XEmacs Arne Jørgensen 2005-04-14 11:41 ` Arne Jørgensen 2005-04-26 12:07 ` Arne Jørgensen
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 NNTP newsgroup(s).