Gnus development mailing list
 help / color / mirror / Atom feed
* smime-cert-by-ldap-1 problem
@ 2005-06-14 18:26 David S. Goldberg
  2005-06-14 20:46 ` Arne Jørgensen
  0 siblings, 1 reply; 6+ messages in thread
From: David S. Goldberg @ 2005-06-14 18:26 UTC (permalink / raw)


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.  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.

My XEmacs is:

XEmacs 21.4 (patch 17) "Jumbo Shrimp" [Lucid] (i686-pc-cygwin, Mule)
of Wed Jun 1 2005 on mm117419-pc

with the 5/2005 sumo.

Interesting enough, the DER with the extra CRs seems to work OK though
I have to wonder if it's related to the CRs that in the magic number
issue I wrote about earlier.

I discovered this because I want to save the ldap search results to
the local file convention I've developed for myself but having the
slightly messed up DER format messes up my certificate verification
checks.

Thanks,
-- 
Dave Goldberg
david.goldberg6@verizon.net






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

end of thread, other threads:[~2005-06-16 13:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-14 18:26 smime-cert-by-ldap-1 problem David S. Goldberg
2005-06-14 20:46 ` Arne Jørgensen
2005-06-16  9:05   ` Arne Jørgensen
2005-06-16 12:40     ` Simon Josefsson
2005-06-16 12:51       ` Arne Jørgensen
2005-06-16 13:52         ` David S. Goldberg

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).