[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: S/MIME with Wanderlust



Ok, great, very clear order ;-)

0. I installed your last edited version of wl in order to make 100% sure! 
I found it here: https://github.com/wanderlust/wanderlust

1. I extracted the smime.p7s attachment by the methods you specified.
Both of dem worked to save the file.

2. I executed the epg-decrypt-file function as you told me.
It worked strait away with the same output to *Messages* as the command line (see posting below)

3. Yes, correctly decrypted string is there to be read in plain text. 
It is exactly "kdlsido gggg” (not very meaningful tough :-)

4. I checked also the temp file created from function as given below.
The file is ok and has exactly the same content as my posting from the *Messages* buffer (see below)

After all, it seems the problem is (still and only) extracting the right section of "Content-Type: text/plain;” .

All best,
mc


byte-code: Beginning of buffer
"Content-Type: multipart/signed;
	boundary=\"Apple-Mail=_51A03F47-92BB-4FDC-BA9B-FFE147223058\";
	protocol=\"application/pkcs7-signature\";
	micalg=sha1


--Apple-Mail=_51A03F47-92BB-4FDC-BA9B-FFE147223058
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=us-ascii

kdlsido gggg
--Apple-Mail=_51A03F47-92BB-4FDC-BA9B-FFE147223058
Content-Disposition: attachment;
	filename=smime.p7s
Content-Type: application/pkcs7-signature;
	name=smime.p7s
Content-Transfer-Encoding: base64

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIFBzCCBQMw
ggProAMCAQICAQcwCwYJKoZIhvcNAQELMIIBHTELMAkGA1UEAwwCTUMxGzAZBgNVBAoMEs6gzpXO
nc6kzpHOpc6bzp/OmTGBlzCBlAYDVQQLDIGMzqDPgc+MzrPPgc6xzrzOvM6xIM6jz4XPg8+Ezq7O
(snip)
K9G78t7qE4EJQEp+GMkA6tTubhjqs508WYeGKJdBWBW7YPSQbuwfb6iG0w26HG2OWW6EVMWl3WAl
8Mej7n3ZkALatTKL/QPOndOo0h4UEGvyvXYNnLOvHA5PlfOpkXZsAAAAAAAA

--Apple-Mail=_51A03F47-92BB-4FDC-BA9B-FFE147223058--
“


On 31.01.2014, at 13:06, Kazuhiro Ito <kzhr@d1.dion.ne.jp> wrote:

>> Now the contents of *WL:Message*-nil is only a section of the
>> complete output of gpgsm, if run on the comand-line.  The visible
>> section displayed in the buffer, however, does not contain all the
>> decoded raw output of gpgsm:
> (snip)
>> Content-Transfer-Encoding: 7bit
>> 
>> Content-Disposition: attachment;
>> filename=smime.p7s
>> 
>> Content-Transfer-Encoding: base64
> 
> This result is very strange.  The first line is a part of header in
> the first text/plain entity and the rest are in the second
> application/pkcs7-signature entity.  Moreover, Content-Type: header
> and its parameter of the second entity are skipped or replaced with a
> blank line.
> 
> Anyway, I guess that EasyPG fails to receive outputs from gpgsm or
> gpgsm's output to stdout is broken.  Please check whether EasyPG +
> gpgsm properly works.
> 
> 1. Extract your application/pkcs7-mime part into file (use
> mime-save-content or wl-mime-save-content instead of
> mime-view-application/pkcs7-mime).
> 
> 2. Evaluate the below code in *scratch* buffer.
> 
> (epg-decrypt-file (epg-make-context 'CMS)
> 		  "/path/to/extracted/smime.p7m" nil)
> 
> 3. Confirm whether correct decrypted string is inserted.
> 
> 4. If inserted string is corrupted, try the below code and confirm
> whther "tempfile" is corrupted.
> 
> (epg-decrypt-file (epg-make-context 'CMS)
> 		  "/path/to/extracted/smime.p7m" "/path/to/tempfile")
> 
> 
> -- 
> Kazuhiro Ito
> 

Attachment: smime.p7s
Description: S/MIME cryptographic signature