GnuPGの進化:インポートされたにもかかわらず、「公開鍵をインポートしない」

GnuPGの進化:インポートされたにもかかわらず、「公開鍵をインポートしない」

私は電子メールを暗号化するためにDebianバスター(テスト)amd64でEvolutionを実行するGnuPGを使用しています。私のGPG秘密鍵は、GPGスマートカードとして機能するYubiKeyにあります。 EvolutionではCalDAVを使用してカレンダーをロードできないため進化リセット。 CalDAVは現在正常に動作しています。

しかし、リセット後に別の問題が発生しました。 GPG暗号化/署名が機能しなくなったことです。電子メールの復号化に問題はありません。

また、GPGキーを正しくインポートして次に一覧表示しても、アカウント設定で自分のGPGキーを選択することはできませんgpg -K

ここに画像の説明を入力してください。

これでキーを選択できます。

暗号化された電子メールを送信しようとすると失敗し、Evolutionは次のエラーを表示します。

Could not create message.
You may need to select different mail options.
Detailed error: Failed to encrypt: Invalid recipient <[email protected]>  specified. A common issue is that the gpg2 doesn’t have imported public key for this recipient.

しかし、私の公開鍵はい輸入。オプションを無効にしても同じことが起こりますAlways encrypt to myself when sending encrypted messages with this account。その後、エラーは次のようになります

Detailed error: Failed to encrypt: Invalid recipient <[email protected]> specified. A common issue is that the gpg2 doesn’t have imported public key for this recipient.

コマンドを使用してコマンドラインで暗号化/署名するgpgことが有効です。スマートカードにない秘密鍵を使用することは機能しません。 GPGとEvolutionをリセットしても効果はありません。

私は今何をすべきかわかりません。みんなありがとうございます:)

編集するstrace -p $(pidof evolution) -f -e trace=execve復号時の出力(うまく機能):

[pid  4613] execve("/usr/local/bin/gpg2", ["gpg2", "--verbose", "--no-secmem-warning", "--no-greeting", "--no-tty", "--status-fd=66", "--command-fd=67", "--verify-options", "show-photos", "--photo-viewer", "/usr/lib/evolution/camel-gpg-pho"..., "--decrypt", "--output", "-"], [/* 34 vars */]) = -1 ENOENT (No such file or directory)
[pid  4613] execve("/usr/bin/gpg2", ["gpg2", "--verbose", "--no-secmem-warning", "--no-greeting", "--no-tty", "--status-fd=66", "--command-fd=67", "--verify-options", "show-photos", "--photo-viewer", "/usr/lib/evolution/camel-gpg-pho"..., "--decrypt", "--output", "-"], [/* 34 vars */]) = 0

暗号化時(失敗):

[pid  4537] execve("/usr/local/bin/gpg2", ["gpg2", "--verbose", "--no-secmem-warning", "--no-greeting", "--no-tty", "--batch", "--yes", "--status-fd=67", "--encrypt", "--armor", "-u", "[email protected]", "-r", "<[email protected]>", "--output", "-"], [/* 34 vars */]) = -1 ENOENT (No such file or directory)
[pid  4537] execve("/usr/bin/gpg2", ["gpg2", "--verbose", "--no-secmem-warning", "--no-greeting", "--no-tty", "--batch", "--yes", "--status-fd=67", "--encrypt", "--armor", "-u", "[email protected]", "-r", "<[email protected]>", "--output", "-"], [/* 34 vars */]) = 0

ファイルが/usr/local/bin/gpg2存在せず、存在しないようです。Debian パッケージの一部

編集2:@Hauke Lagingこのコメントに投稿したコマンドは機能しますが、操作を実行するかどうかを対話的に確認する必要があります(コマンドラインを使用して手動で暗号化する場合など)。

echo foo | /usr/bin/gpg2 --status-fd=1 --encrypt --armor -u [email protected] -r [email protected] --output -

Evolutionが実行しようとしたコマンドは失敗しましたが(<>zshに問題を引き起こすコマンドを削除しました):

➜  ~  gpg2 --verbose --no-secmem-warning --no-greeting --no-tty --batch --yes --status-fd=67 --encrypt --armor -u [email protected] -r [email protected] --output
gpg: Fatal: status-fd is invalid: Bad file descriptor

--status-fd=1他のエラーのため、インストールは失敗し続けます。

➜  ~ echo "foo" | gpg2 --verbose --no-secmem-warning --no-greeting --no-tty --batch --yes --status-fd=1 --encrypt --armor -u [email protected] -r [email protected] --output -
[GNUPG:] KEY_CONSIDERED <recipient's key fingerprint> 0
gpg: using pgp trust model
gpg: using subkey <recipient's encryption subkey id> instead of primary key <recipient's primary key id>
[GNUPG:] KEY_CONSIDERED <recipient's key fingerprint> 0
gpg: automatically retrieved '[email protected]' via Local
gpg: <recipient's encryption subkey id>: There is no assurance this key belongs to the named user
[GNUPG:] INV_RECP 10 [email protected]
[GNUPG:] FAILURE encrypt 53
gpg: [stdin]: encryption failed: Unusable public key

編集3:今テストしました。 Evolutionのメッセージに署名することは、メッセージを復号化するのと同じように機能します。

コマンドラインを使用してメッセージを手動で暗号化すると、次のメッセージが表示されます。これが問題の原因であると考えられます。

➜  ~ echo "foo" | gpg --encrypt -r [email protected] --armor
gpg: automatically retrieved '[email protected]' via Local
gpg: <recipient's encryption subkey id>: There is no assurance this key belongs to the named user
sub  rsa4096/<recipient's encryption subkey id> 2015-10-14 Recipient's Name <[email protected]>
 Primary key fingerprint: <recipient's key fingerprint>
      Subkey fingerprint: <recipient's encryption subkey fingerprint>

It is NOT certain that the key belongs to the person named
in the user ID.  If you *really* know what you are doing,
you may answer the next question with yes.

Use this key anyway? (y/N) y
-----BEGIN PGP MESSAGE-----
[...]
-----END PGP MESSAGE-----

編集4gpg --edit-key:上記のメッセージは、所有者の信頼が欠落しているため(少なくともそうだと思います)、以下を使用して受信者の所有者の信頼(以前に設定されていない)を設定したいと思います。

gpg> trust 
pub  rsa4096/<some key id>
     created: <some date in the past>  expires: <some date in the future>  usage: SCA 
     trust: unknown       validity: unknown
sub  rsa4096/<some other key id>
     created: <some date in the past>  expires: <some date in the future>  usage: E   
[ unknown] (1). Pecipient's Name <[email protected]>

Please decide how far you trust this user to correctly verify other users' keys
(by looking at passports, checking fingerprints from different sources, etc.)

  1 = I don't know or won't say
  2 = I do NOT trust
  3 = I trust marginally
  4 = I trust fully
  5 = I trust ultimately
  m = back to the main menu

Your decision? 3

pub  rsa4096/<some key id>
     created: <some date in the past>  expires: <some date in the future>  usage: SCA 
     trust: marginal      validity: unknown
sub  rsa4096/<some other key id>
     created: <some date in the past>  expires: <some date in the future>  usage: E   
[ unknown] (1). Pecipient's Name <[email protected]>

それで、受信者のownertrustを設定しましたが、なぜこれが[ unknown]起こるのでしょうか?

ベストアンサー1

OpenPGPの妥当性スキームがどのように機能するかはまだ理解されていません。しかし、それ以上に、アプリケーションは無効なキーの使用に問題があってはなりません(したがって、Evolution開発者に苦情を申し立てることができます)。

証明書を有効にする方法は2つあります(標準モードでGnuPGを使用)。

  1. 所有者の信頼は最終信頼に設定されます。
  2. 最終所有者が信頼する鍵の有効な(期限切れのない)署名があります。

つまり、最終所有者の信頼を持つキーリングに証明書がないと、自動的に失敗します。

または、次のコマンドを使用して信頼モデルを変更できます。

--trust-model direct

その後、試しても有効性を直接設定できます。ただし、証明書は「完全に有効」でなければなりません。限界妥当性が十分ではありません。

私のウェブサイトでこれについて詳しく説明しました。

http://www.hauke-laging.de/sicherheit/openpgp.html#wot

テキストはドイツ語ですが、ブロックには理解を助けるためのいくつかの画像があります。

おすすめ記事