From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/60445 Path: news.gmane.org!not-for-mail From: =?utf-8?Q?Arne_J=C3=B8rgensen?= Newsgroups: gmane.emacs.gnus.general Subject: Re: smime-cert-by-ldap-1 problem Date: Tue, 14 Jun 2005 22:46:06 +0200 Organization: Arne Joergensen -- http://arnested.dk/ Message-ID: <877jgwfz01.fsf@seamus.arnested.dk> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1118781969 25435 80.91.229.2 (14 Jun 2005 20:46:09 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 14 Jun 2005 20:46:09 +0000 (UTC) Original-X-From: ding-owner+M8972@lists.math.uh.edu Tue Jun 14 22:46:08 2005 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DiIHo-00073E-Ef for ding-account@gmane.org; Tue, 14 Jun 2005 22:45:28 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu ident=lists) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1DiIJK-0006yi-00; Tue, 14 Jun 2005 15:47:02 -0500 Original-Received: from util2.math.uh.edu ([129.7.128.23]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1DiIJB-0006ya-00 for ding@lists.math.uh.edu; Tue, 14 Jun 2005 15:46:53 -0500 Original-Received: from quimby.gnus.org ([80.91.224.244]) by util2.math.uh.edu with esmtp (Exim 4.30) id 1DiIJ9-00040u-3y for ding@lists.math.uh.edu; Tue, 14 Jun 2005 15:46:51 -0500 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1DiIJ7-0000VD-00 for ; Tue, 14 Jun 2005 22:46:49 +0200 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1DiIE3-0006PR-Ei for ding@gnus.org; Tue, 14 Jun 2005 22:41:35 +0200 Original-Received: from 213.237.94.152 ([213.237.94.152]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 14 Jun 2005 22:41:35 +0200 Original-Received: from arne by 213.237.94.152 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 14 Jun 2005 22:41:35 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: ding@gnus.org Original-Lines: 48 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 213.237.94.152 X-Face: 5t,7/Y$&<1A_t.$vC2{pWZ{m@3_06;kcm]no{hgEL/}Uz(>XV6cl4}xO\v?-h3%>znNaZtq `~rf,GY1T%r=a.zH`hOb(-]'x)nI088Z&|e;V^h;/TShou User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:j7Yt8Xwvh7136lY2PZsBcgsWXZI= X-Spam-Score: -4.9 (----) Precedence: bulk Original-Sender: ding-owner@lists.math.uh.edu Xref: news.gmane.org gmane.emacs.gnus.general:60445 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:60445 david.goldberg6@verizon.net (David S. Goldberg) writes: > According to this bit from smime.el: > > ;; Certificates on LDAP servers _should_ be in DER format, > ;; but there are some servers out there that distributes the > ;; certificates in PEM format (with or without > ;; header/footer) so we try to handle them anyway. > (if (or (string= (substring (cadaar ldapresult) 0 27) > "-----BEGIN CERTIFICATE-----") > (condition-case nil > (base64-decode-string (cadaar ldapresult)) > (error nil))) > (setq cert > (smime-replace-in-string > (cadaar ldapresult) > (concat "\\(\n\\|\r\\|-----BEGIN CERTIFICATE-----\\|" > "-----END CERTIFICATE-----\\)") > "" t)) > (setq cert (base64-encode-string (cadaar ldapresult) t))) > > then the result of smime-cert-by-ldap should be a base64 encoded block > surrounded by the BEGIN and END CERTIFICATE lines. Correct. > Instead, I get the DER with extra CRs inserted every 64 bytes, > surrounded by the BEGIN and END lines. The problem is that > base64-decode-string does not throw an error, and from what I can > see in base64.el, it's not designed to. Is base64-decode-string on XEmacs different from the one in Emacs? As I remember base64-decode-string does throw an error on Emacs. I will look deeper in to this tomorrow or the day after. > Interesting enough, the DER with the extra CRs seems to work OK though That's weird I think. > I have to wonder if it's related to the CRs that in the magic number > issue I wrote about earlier. I don't think so. Kind regards, -- Arne Jørgensen