ALT Linux Sisyphus discussions
 help / color / mirror / Atom feed
From: Dmitriy Shadrinov <shadrinovdd@ystu.ru>
To: ALT Linux Sisyphus discussion list <sisyphus@lists.altlinux.org>
Subject: [sisyphus] OpenSSL
Date: Tue, 15 May 2007 01:45:33 +0400
Message-ID: <200705150145.33777.shadrinovdd@ystu.ru> (raw)

Использую openssl-0.9.8d-alt2 для шифрования некоторых данных, их подписи для
отправки по почте через скрипт. Вот последовательность действий:

openssl enc -a -in source_file -out base64_file
openssl smime -encrypt -in base64_file -out encrypted_file -des3 pub_key_dest.pem
openssl smime -sign -in encrypted_file -out signed_enc_file -signer pub_key_my.pem -inkey private_key_my.key

В результате получается файл в формате MIME, у которого тело имеет переводы
срок CRLF, в то время как остальная часть LF. Это оказалось препятствием для
системы-получателя. Она упорно утверждала, что подпись неверна, пока я вручную
не убрал CR. Да, все исходные файлы не содержать CR.

Удалось выяснить, что добавление CR происходит на последнем шаге - при
добавлении подписи. Так же известно, что на старом OpenSSL-0.9.7a такого не
происходит.

Временно решил проблему использованием ключа -binary.
Вот что получается в результате (без -binary):


MIME-Version: 1.0
Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg=sha1; boundary="----B0829AF6F1A2BD2399ED6ED5B4C66ED4"

This is an S/MIME signed message

------B0829AF6F1A2BD2399ED6ED5B4C66ED4
MIME-Version: 1.0^M
Content-Disposition: attachment; filename="smime.p7m"^M
Content-Type: application/x-pkcs7-mime; smime-type=enveloped-data; name="smime.p7m"^M
Content-Transfer-Encoding: base64^M
^M
MIIKPwYJKoZIhvcNAQcDoIIKMDCCCiwCAQAxggE0MIIBMAIBADCBmDCBkjELMAkG^M
A1UEBhMCUlUxETAPBgNVBAgTCE5vcmRXZXN0MRIwEAYDVQQHEwlZYXJvc2xhdmwx^M
<skipped>
AvDh/PloY/R3QBCN7DhAIJC3CnRE9GbxCTckB4bkzX0ncQGP8SZxP/rwQ8cuhtma^M
th87gg3gjXfy4MFkJyWC3NtImPj27rY7jkKoS8gSdIRd6NI=^M
^M

------B0829AF6F1A2BD2399ED6ED5B4C66ED4
Content-Type: application/x-pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"

MIIEzgYJKoZIhvcNAQcCoIIEvzCCBLsCAQExCzAJBgUrDgMCGgUAMAsGCSqGSIb3
DQEHAaCCAqMwggKfMIICCAIBATANBgkqhkiG9w0BAQQFADCBkjELMAkGA1UEBhMC
<skipped>
eWjK2tEySfz1jj3pTKlRNUOswWWaz2e5dlhmnxV2WTD9gXc1wDFz3a2timmjELJ/
oV/i6KkRwUhVa8NLMMFKBt2JEJy6cG1kfVtfW3F46c2F1A==

------B0829AF6F1A2BD2399ED6ED5B4C66ED4--


             reply	other threads:[~2007-05-14 21:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-14 21:45 Dmitriy Shadrinov [this message]
2007-05-14 21:53 ` Anton Farygin
2007-05-15  7:58   ` Шадринов Дмитрий Дмитриевич

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200705150145.33777.shadrinovdd@ystu.ru \
    --to=shadrinovdd@ystu.ru \
    --cc=sisyphus@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Sisyphus discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/sisyphus/0 sisyphus/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 sisyphus sisyphus/ http://lore.altlinux.org/sisyphus \
		sisyphus@altlinux.ru sisyphus@altlinux.org sisyphus@lists.altlinux.org sisyphus@lists.altlinux.ru sisyphus@lists.altlinux.com sisyphus@linuxteam.iplabs.ru sisyphus@list.linux-os.ru
	public-inbox-index sisyphus

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.sisyphus


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git