From 789d240cb40ab36406a7c57ad49897e0bafbb41e Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Wed, 11 Apr 2018 20:35:40 +0200 Subject: gpg: New option --no-symkey-cache. * g10/gpg.c (oNoSymkeyCache): New. (opts): Add that option. (main): Set var. * g10/options.h (struct opt): New field no_symkey_cache. * g10/passphrase.c (passphrase_to_dek): Implement that feature. Signed-off-by: Werner Koch --- NEWS | 3 +++ doc/gpg.texi | 11 ++++++++++- g10/gpg.c | 3 +++ g10/options.h | 4 +++- g10/passphrase.c | 3 +++ 5 files changed, 22 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 8b9d2bcf8..403c2a05f 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,9 @@ Noteworthy changes in version 2.2.7 (unreleased) ------------------------------------------------ + * gpg: New option --no-symkey-cache to disable the passphrase cache + for symmetrical en- and decryption. + Noteworthy changes in version 2.2.6 (2018-04-09) ------------------------------------------------ diff --git a/doc/gpg.texi b/doc/gpg.texi index 086b4fce5..908af7b03 100644 --- a/doc/gpg.texi +++ b/doc/gpg.texi @@ -214,7 +214,10 @@ symmetric cipher used is @value{GPGSYMENCALGO}, but may be chosen with the @option{--encrypt} (for a message that may be decrypted via a secret key or a passphrase), or @option{--sign} and @option{--encrypt} together (for a signed message that may be decrypted via a secret key or a -passphrase). +passphrase). @command{@gpgname} caches the passphrase used for +symmetric encryption so that a decrypt operation may not require that +the user needs to enter the passphrase. The option +@option{--no-symkey-cache} can be used to disable this feature. @item --store @opindex store @@ -3140,6 +3143,12 @@ are: Pinentry the user is not prompted again if he enters a bad password. @end table +@item --no-symkey-cache +@opindex no-symkey-cache +Disable the passphrase cache used for symmetrical en- and decryption. +This cache is based on the message specific salt value +(cf. @option{--s2k-mode}). + @item --request-origin @var{origin} @opindex request-origin Tell gpg to assume that the operation ultimately originated at diff --git a/g10/gpg.c b/g10/gpg.c index 2c93a8380..fbbdd92ba 100644 --- a/g10/gpg.c +++ b/g10/gpg.c @@ -423,6 +423,7 @@ enum cmd_and_opt_values oSender, oKeyOrigin, oRequestOrigin, + oNoSymkeyCache, oNoop }; @@ -888,6 +889,7 @@ static ARGPARSE_OPTS opts[] = { ARGPARSE_s_s (oAutoKeyLocate, "auto-key-locate", "@"), ARGPARSE_s_n (oNoAutoKeyLocate, "no-auto-key-locate", "@"), ARGPARSE_s_n (oNoAutostart, "no-autostart", "@"), + ARGPARSE_s_n (oNoSymkeyCache, "no-symkey-cache", "@"), /* Dummy options with warnings. */ ARGPARSE_s_n (oUseAgent, "use-agent", "@"), @@ -3556,6 +3558,7 @@ main (int argc, char **argv) break; case oNoAutostart: opt.autostart = 0; break; + case oNoSymkeyCache: opt.no_symkey_cache = 1; break; case oDefaultNewKeyAlgo: opt.def_new_key_algo = pargs.r.ret_str; diff --git a/g10/options.h b/g10/options.h index e1bf97fb1..96b76f8f2 100644 --- a/g10/options.h +++ b/g10/options.h @@ -242,7 +242,7 @@ struct unsigned int allow_weak_digest_algos:1; unsigned int large_rsa:1; unsigned int disable_signer_uid:1; - /* Flag to enbale experimental features from RFC4880bis. */ + /* Flag to enable experimental features from RFC4880bis. */ unsigned int rfc4880bis:1; } flags; @@ -275,6 +275,8 @@ struct int unwrap_encryption; int only_sign_text_ids; + + int no_symkey_cache; /* Disable the cache used for --symmetric. */ } opt; /* CTRL is used to keep some global variables we currently can't diff --git a/g10/passphrase.c b/g10/passphrase.c index a498f627b..ffdcdf2bd 100644 --- a/g10/passphrase.c +++ b/g10/passphrase.c @@ -317,6 +317,9 @@ passphrase_to_dek (int cipher_algo, STRING2KEY *s2k, canceled = &dummy_canceled; *canceled = 0; + if (opt.no_symkey_cache) + nocache = 1; /* Force no symmtric key caching. */ + if ( !s2k ) { log_assert (create && !nocache); -- cgit v1.2.3 From bb2680a45ab27427d33861802617211052242a33 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Thu, 12 Apr 2018 10:52:51 +0900 Subject: po: Update Japanese translation. -- Signed-off-by: NIIBE Yutaka --- po/ja.po | 101 ++++++++++++++++++++++++++++++--------------------------------- 1 file changed, 48 insertions(+), 53 deletions(-) diff --git a/po/ja.po b/po/ja.po index 4920e4ed2..d80506696 100644 --- a/po/ja.po +++ b/po/ja.po @@ -4,13 +4,13 @@ # IIDA Yosiaki , 1999, 2000, 2002, 2003, 2004. # Yoshihiro Kajiki , 1999. # Takashi P.KATOH, 2002. -# NIIBE Yutaka , 2013, 2014, 2015, 2016, 2017. +# NIIBE Yutaka , 2013, 2014, 2015, 2016, 2017, 2018. # msgid "" msgstr "" "Project-Id-Version: gnupg 2.2.6\n" "Report-Msgid-Bugs-To: translations@gnupg.org\n" -"PO-Revision-Date: 2018-03-30 19:31+0900\n" +"PO-Revision-Date: 2018-04-12 10:51+0900\n" "Last-Translator: NIIBE Yutaka \n" "Language-Team: none\n" "Language: ja\n" @@ -278,7 +278,7 @@ msgstr "" "避けましょう。" msgid "Warning: You have entered an insecure passphrase." -msgstr "*警告*: 安全とは言えないパスフレーズが入力されました。" +msgstr "警告: 安全とは言えないパスフレーズが入力されました。" #, c-format msgid "Please enter the passphrase to%0Aprotect your new key" @@ -397,7 +397,7 @@ msgstr "選択されたダイジェスト・アルゴリズムは、無効です #, c-format msgid "Note: no default option file '%s'\n" -msgstr "*注意*: デフォルトのオプション・ファイル '%s' がありません\n" +msgstr "注意: デフォルトのオプション・ファイル '%s' がありません\n" #, c-format msgid "option file '%s': %s\n" @@ -409,7 +409,7 @@ msgstr "'%s' からオプションを読み込みます\n" #, c-format msgid "Note: '%s' is not considered an option\n" -msgstr "*注意*: '%s'はオプションとは考えられません\n" +msgstr "注意: '%s'はオプションとは考えられません\n" #, c-format msgid "can't create socket: %s\n" @@ -626,7 +626,7 @@ msgstr "誤り" #, c-format msgid "Note: This passphrase has never been changed.%0APlease change it now." -msgstr "*注意*: パスフレーズは変更されていません。%0A今、変更してください。" +msgstr "注意: パスフレーズは変更されていません。%0A今、変更してください。" #, c-format msgid "" @@ -1195,12 +1195,12 @@ msgstr "*警告*: %s\n" msgid "Note: Outdated servers may lack important security fixes.\n" msgstr "" -"*注意*: 古いサーバは、重要なセキュリティの修正が欠如しているかもしれませ" +"注意: 古いサーバは、重要なセキュリティの修正が欠如しているかもしれませ" "ん。\n" #, c-format msgid "Note: Use the command \"%s\" to restart them.\n" -msgstr "*注意*: \"%s\"コマンドを使って再起動してください。\n" +msgstr "注意: \"%s\"コマンドを使って再起動してください。\n" #, c-format msgid "%s is not compliant with %s mode\n" @@ -1320,9 +1320,9 @@ msgid "" " If the key generation does not succeed, please check the\n" " documentation of your card to see what sizes are allowed.\n" msgstr "" -"*注意*: カードが要求された鍵長をサポートしているという保証はありません。\n" -" 鍵生成が成功しない場合、あなたのカードに関する技術文書を確認し、\n" -" 利用できる鍵長について確認ください。\n" +"注意: カードが要求された鍵長をサポートしているという保証はありません。\n" +" 鍵生成が成功しない場合、あなたのカードに関する技術文書を確認し、\n" +" 利用できる鍵長について確認ください。\n" #, c-format msgid "What keysize do you want? (%u) " @@ -1364,12 +1364,12 @@ msgstr "無効な選択です。\n" #, c-format msgid "The card will now be re-configured to generate a key of %u bits\n" -msgstr "今、%uビットの鍵を生成するようにカードは再コンフィグされました\n" +msgstr "カードは、今、%uビットの鍵を生成するように再コンフィグされます\n" #, c-format msgid "The card will now be re-configured to generate a key of type: %s\n" msgstr "" -"カードは、今、こちらのタイプの鍵を生成するように再コンフィグされました: %s\n" +"カードは、今、こちらのタイプの鍵を生成するように再コンフィグされます: %s\n" #, c-format msgid "error changing key attribute for key %d: %s\n" @@ -1377,7 +1377,7 @@ msgstr "鍵%dの属性を変更する際にエラー: %s\n" #, c-format msgid "error getting card info: %s\n" -msgstr "鍵情報の取得エラー: %s\n" +msgstr "カード情報の取得エラー: %s\n" msgid "This command is not supported by this card\n" msgstr "このカードでは、このコマンドはサポートされていません。\n" @@ -1386,7 +1386,7 @@ msgid "Make off-card backup of encryption key? (Y/n) " msgstr "暗号化鍵のカード外バックアップを作成しますか? (Y/n) " msgid "Note: keys are already stored on the card!\n" -msgstr "*注意*: 秘密鍵はもうカードに保管してあります!\n" +msgstr "注意: 秘密鍵はもうカードに保管してあります!\n" msgid "Replace existing keys? (y/N) " msgstr "既存の鍵を置き換えますか? (y/N) " @@ -1421,7 +1421,7 @@ msgid "KEYTOCARD failed: %s\n" msgstr "KEYTOCARDが失敗しました: %s\n" msgid "Note: This command destroys all keys stored on the card!\n" -msgstr "*注意*: このコマンドはカードに保管してあるすべての鍵を破壊します!\n" +msgstr "注意: このコマンドはカードに保管してあるすべての鍵を破壊します!\n" msgid "Continue? (y/N) " msgstr "続けますか? (y/N) " @@ -1555,7 +1555,7 @@ msgstr "所有者信用情報をクリアしました\n" #, c-format msgid "there is a secret key for public key \"%s\"!\n" -msgstr "この公開鍵にたいする秘密鍵\"%s\"があります!\n" +msgstr "この公開鍵に対する秘密鍵\"%s\"があります!\n" msgid "use option \"--delete-secret-keys\" to delete it first.\n" msgstr "まず\"--delete-secret-keys\"オプションでこれを削除してください。\n" @@ -2091,11 +2091,11 @@ msgstr "(選択肢の一覧には\"help\"を使ってください)\n" #, c-format msgid "Note: old default options file '%s' ignored\n" -msgstr "*注意*: 以前デフォルトだったオプション・ファイル'%s'は、無視されます\n" +msgstr "注意: 以前デフォルトだったオプション・ファイル'%s'は、無視されます\n" #, c-format msgid "Note: %s is not for normal use!\n" -msgstr "*注意*: 普通%sは使いません!\n" +msgstr "注意: 普通%sは使いません!\n" #, c-format msgid "'%s' is not a valid signature expiration\n" @@ -2250,7 +2250,7 @@ msgid "invalid min-cert-level; must be 1, 2, or 3\n" msgstr "無効なmin-cert-level。0か1か2か3でなければなりません\n" msgid "Note: simple S2K mode (0) is strongly discouraged\n" -msgstr "*注意*: 単純なS2Kモード(0)の使用には強く反対します\n" +msgstr "注意: 単純なS2Kモード(0)の使用には強く反対します\n" msgid "invalid S2K mode; must be 0, 1 or 3\n" msgstr "無効なS2Kモード。0か1か3でなければなりません\n" @@ -2350,7 +2350,7 @@ msgstr "'%s'は有効な鍵ID, フィンガープリント、keygripではない msgid "WARNING: no command supplied. Trying to guess what you mean ...\n" msgstr "" -"警告: コマンドが指定されていません。なにを意味しているのか当ててみます ...\n" +"*警告*: コマンドが指定されていません。なにを意味しているのか当ててみます ...\n" msgid "Go ahead and type your message ...\n" msgstr "開始します。メッセージを打ってください ...\n" @@ -2868,7 +2868,7 @@ msgid "" "The self-signature on \"%s\"\n" "is a PGP 2.x-style signature.\n" msgstr "" -"\"%s\"にたいする自己署名は、\n" +"\"%s\"に対する自己署名は、\n" "PGP 2.x形式の署名です。\n" msgid "Do you want to promote it to an OpenPGP self-signature? (y/N) " @@ -2890,7 +2890,7 @@ msgid "" "Your current signature on \"%s\"\n" "is a local signature.\n" msgstr "" -"\"%s\"にたいするあなたの今の署名\n" +"\"%s\"に対するあなたの今の署名\n" "はローカルな署名です。\n" msgid "Do you want to promote it to a full exportable signature? (y/N) " @@ -3467,15 +3467,11 @@ msgstr "主鍵の有効期限を変更します。\n" msgid "You can't change the expiration date of a v3 key\n" msgstr "v3鍵の有効期限は変更できません\n" -#, fuzzy -#| msgid "Changing expiration time for a subkey.\n" msgid "Changing usage of a subkey.\n" -msgstr "副鍵の有効期限を変更します。\n" +msgstr "副鍵の使用法を変更します。\n" -#, fuzzy -#| msgid "Changing expiration time for the primary key.\n" msgid "Changing usage of the primary key.\n" -msgstr "主鍵の有効期限を変更します。\n" +msgstr "主鍵の使用法を変更します。\n" #, c-format msgid "signing subkey %s is already cross-certified\n" @@ -3982,7 +3978,7 @@ msgstr "バックアップ・ファイル'%s'が作成できません: %s\n" #, c-format msgid "Note: backup of card key saved to '%s'\n" -msgstr "*注意*: カード鍵のバックアップが'%s'へ保存されます\n" +msgstr "注意: カード鍵のバックアップが'%s'へ保存されます\n" #, c-format msgid "writing public key to '%s'\n" @@ -4017,7 +4013,7 @@ msgid "" msgstr "鍵は%lu秒未来にできました (時間歪曲か時計の障害でしょう)\n" msgid "Note: creating subkeys for v3 keys is not OpenPGP compliant\n" -msgstr "*注意*: v3鍵に対する副鍵の作成は、OpenPGPに適合しません\n" +msgstr "注意: v3鍵に対する副鍵の作成は、OpenPGPに適合しません\n" msgid "Secret parts of primary key are not available.\n" msgstr "主鍵の秘密部分が利用できません。\n" @@ -4069,7 +4065,7 @@ msgstr[0] "エラーのため%d個の署名を検査しません\n" #, c-format msgid "Warning: %lu key skipped due to its large size\n" msgid_plural "Warning: %lu keys skipped due to their large sizes\n" -msgstr[0] "*警告*: %lu個の鍵がその大きさのためスキップされました\n" +msgstr[0] "警告: %lu個の鍵がその大きさのためスキップされました\n" msgid "Keyring" msgstr "鍵リング" @@ -4262,7 +4258,7 @@ msgid "decryption failed: %s\n" msgstr "復号に失敗しました: %s\n" msgid "Note: sender requested \"for-your-eyes-only\"\n" -msgstr "*注意*: 送信者は\"極秘とする\"ように求めています\n" +msgstr "注意: 送信者は\"極秘とする\"ように求めています\n" #, c-format msgid "original file name='%.*s'\n" @@ -4401,7 +4397,7 @@ msgstr "*警告*: ダイジェスト・アルゴリズム %s は廃止されて #, c-format msgid "Note: signatures using the %s algorithm are rejected\n" -msgstr "*注意*: アルゴリズム %s を用いた署名は拒否されました\n" +msgstr "注意: アルゴリズム %s を用いた署名は拒否されました\n" #, c-format msgid "(reported error: %s)\n" @@ -4725,15 +4721,15 @@ msgid "WARNING: This subkey has been revoked by its owner!\n" msgstr "*警告*: この副鍵は所有者によって失効されています!\n" msgid "Note: This key has been disabled.\n" -msgstr "*注意*: この鍵は使用禁止に設定されています。\n" +msgstr "注意: この鍵は使用禁止に設定されています。\n" #, c-format msgid "Note: Verified signer's address is '%s'\n" -msgstr "*注意*: 確認された署名者のアドレスは'%s'です\n" +msgstr "注意: 確認された署名者のアドレスは'%s'です\n" #, c-format msgid "Note: Signer's address '%s' does not match DNS entry\n" -msgstr "*注意*: 署名者のアドレス'%s'がDNSのエントリと一致しません\n" +msgstr "注意: 署名者のアドレス'%s'がDNSのエントリと一致しません\n" msgid "trustlevel adjusted to FULL due to valid PKA info\n" msgstr "PKA情報が有効のため、信用レベルがFULLに調整されました\n" @@ -4742,7 +4738,7 @@ msgid "trustlevel adjusted to NEVER due to bad PKA info\n" msgstr "PKA情報が無効のため、信用レベルがNEVERに調整されました\n" msgid "Note: This key has expired!\n" -msgstr "*注意*: この鍵は期限切れです!\n" +msgstr "注意: この鍵は期限切れです!\n" msgid "WARNING: This key is not certified with a trusted signature!\n" msgstr "*警告*: この鍵は信用できる署名で証明されていません!\n" @@ -4823,11 +4819,11 @@ msgstr "有効な宛先がありません\n" #, c-format msgid "Note: key %s has no %s feature\n" -msgstr "*注意*: 鍵%sには %s の機能がありません\n" +msgstr "注意: 鍵%sには %s の機能がありません\n" #, c-format msgid "Note: key %s has no preference for %s\n" -msgstr "*注意*: 鍵%sには%sに対する優先指定がありません\n" +msgstr "注意: 鍵%sには%sに対する優先指定がありません\n" msgid "data not saved; use option \"--output\" to save it\n" msgstr "" @@ -4877,10 +4873,10 @@ msgstr "*警告*: 暗号アルゴリズム%sは受取人の優先指定に入っ #, c-format msgid "Note: secret key %s expired at %s\n" -msgstr "*注意*: 秘密鍵%sは%sで期限切れとなります\n" +msgstr "注意: 秘密鍵%sは%sで期限切れとなります\n" msgid "Note: key has been revoked" -msgstr "*注意*: 鍵は失効済みです" +msgstr "注意: 鍵は失効済みです" #, c-format msgid "build_packet failed: %s\n" @@ -5074,28 +5070,27 @@ msgstr[0] "鍵%sは%lu日、未来にできました (時間歪曲か時計の #, c-format msgid "Note: signature key %s expired %s\n" -msgstr "*注意*: 署名鍵%sは%sに期限切れとなります\n" +msgstr "注意: 署名鍵%sは%sに期限切れとなります\n" #, c-format msgid "Note: signature key %s has been revoked\n" -msgstr "*注意*: 鍵 %s は失効済みです\n" +msgstr "注意: 鍵 %s は失効済みです\n" -#, fuzzy, c-format -#| msgid "standalone signature of class 0x%02x\n" +#, c-format msgid "bad key signature from key %s: %s (0x%02x, 0x%x)\n" -msgstr "クラス0x%02xのスタンドアロン署名\n" +msgstr "鍵%sによる不正な鍵への署名: %s (0x%02x, 0x%x)\n" #, c-format msgid "assuming bad signature from key %s due to an unknown critical bit\n" -msgstr "不明のクリティカル・ビットにより、鍵%sの署名を不正とみなします\n" +msgstr "不明のクリティカル・ビットのため、鍵%sによる署名を不正とみなします\n" #, c-format msgid "key %s: no subkey for subkey revocation signature\n" -msgstr "鍵%s: 副鍵失効署名にたいする副鍵がありません\n" +msgstr "鍵%s: 副鍵失効署名に対する副鍵がありません\n" #, c-format msgid "key %s: no subkey for subkey binding signature\n" -msgstr "鍵%s: 副鍵対応への署名にたいする副鍵がありません\n" +msgstr "鍵%s: 副鍵対応への署名に対する副鍵がありません\n" #, c-format msgid "WARNING: unable to %%-expand notation (too large). Using unexpanded.\n" @@ -5225,7 +5220,7 @@ msgid "%s: trustdb created\n" msgstr "%s: 信用データベースができました\n" msgid "Note: trustdb not writable\n" -msgstr "*注意*: 信用データベースが、書き込み不能です\n" +msgstr "注意: 信用データベースが、書き込み不能です\n" #, c-format msgid "%s: invalid trustdb\n" @@ -6089,7 +6084,7 @@ msgid "failed to open '%s': %s\n" msgstr "'%s'が開けません: %s\n" msgid "Note: non-critical certificate policy not allowed" -msgstr "*注意*: クリティカルでない証明書ポリシーは認められません" +msgstr "注意: クリティカルでない証明書ポリシーは認められません" msgid "certificate policy not allowed" msgstr "証明書ポリシーは認められません" @@ -6605,7 +6600,7 @@ msgstr "" #, c-format msgid "Note: won't be able to encrypt to '%s': %s\n" -msgstr "*注意*:'%s'に対して暗号化できません: %s\n" +msgstr "注意:'%s'に対して暗号化できません: %s\n" #, c-format msgid "unknown validation model '%s'\n" -- cgit v1.2.3 From 327fece0aed2c9974659c72304f9fd1f461d460c Mon Sep 17 00:00:00 2001 From: Andre Heinecke Date: Thu, 12 Apr 2018 08:56:00 +0200 Subject: build: Update getswdb version check to 2.2 * build-aux/getswdb.sh: Check for gnupg22_ver gnupg21_ver no longer exists. --- build-aux/getswdb.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build-aux/getswdb.sh b/build-aux/getswdb.sh index 83ecdb2f3..cd419f2bd 100755 --- a/build-aux/getswdb.sh +++ b/build-aux/getswdb.sh @@ -175,9 +175,9 @@ fi # to help detect rollback attacks. # if [ $skip_selfcheck = no ]; then - gnupg_ver=$(awk '$1=="gnupg21_ver" {print $2;exit}' swdb.lst) + gnupg_ver=$(awk '$1=="gnupg22_ver" {print $2;exit}' swdb.lst) if [ -z "$gnupg_ver" ]; then - echo "GnuPG 2.1 version missing in swdb.lst!" >&2 + echo "GnuPG 2.2 version missing in swdb.lst!" >&2 exit 1 fi gnupg_ver_num=$(echo "$gnupg_ver" | cvtver) -- cgit v1.2.3 From bbb5bfacc0d1f179cfec94fd32fee01a09df0f1d Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 12 Apr 2018 11:24:54 +0200 Subject: agent,dirmngr: Add "getenv" to the getinfo command. * agent/command.c (cmd_getinfo): Add sub-command getenv. * dirmngr/server.c (cmd_getinfo): Ditto. -- It is sometimes helpful to be able to inspect certain envvars in a running agent. For example "http_proxy". Signed-off-by: Werner Koch --- agent/command.c | 18 ++++++++++++++++++ dirmngr/server.c | 20 +++++++++++++++++++- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/agent/command.c b/agent/command.c index f2d0389c7..20abb2882 100644 --- a/agent/command.c +++ b/agent/command.c @@ -2825,6 +2825,7 @@ static const char hlp_getinfo[] = " std_env_names - List the names of the standard environment.\n" " std_session_env - List the standard session environment.\n" " std_startup_env - List the standard startup environment.\n" + " getenv NAME - Return value of envvar NAME.\n" " connections - Return number of active connections.\n" " jent_active - Returns OK if Libgcrypt's JENT is active.\n" " restricted - Returns OK if the connection is in restricted mode.\n" @@ -2961,6 +2962,23 @@ cmd_getinfo (assuan_context_t ctx, char *line) } } } + else if (!strncmp (line, "getenv", 6) + && (line[6] == ' ' || line[6] == '\t' || !line[6])) + { + line += 6; + while (*line == ' ' || *line == '\t') + line++; + if (!*line) + rc = gpg_error (GPG_ERR_MISSING_VALUE); + else + { + const char *s = getenv (line); + if (!s) + rc = set_error (GPG_ERR_NOT_FOUND, "No such envvar"); + else + rc = assuan_send_data (ctx, s, strlen (s)); + } + } else if (!strcmp (line, "connections")) { char numbuf[20]; diff --git a/dirmngr/server.c b/dirmngr/server.c index 60d980211..4315c4133 100644 --- a/dirmngr/server.c +++ b/dirmngr/server.c @@ -2489,7 +2489,8 @@ static const char hlp_getinfo[] = "dnsinfo - Return info about the DNS resolver\n" "socket_name - Return the name of the socket.\n" "session_id - Return the current session_id.\n" - "workqueue - Inspect the work queue\n"; + "workqueue - Inspect the work queue\n" + "getenv NAME - Return value of envvar NAME\n"; static gpg_error_t cmd_getinfo (assuan_context_t ctx, char *line) { @@ -2557,6 +2558,23 @@ cmd_getinfo (assuan_context_t ctx, char *line) workqueue_dump_queue (ctrl); err = 0; } + else if (!strncmp (line, "getenv", 6) + && (line[6] == ' ' || line[6] == '\t' || !line[6])) + { + line += 6; + while (*line == ' ' || *line == '\t') + line++; + if (!*line) + err = gpg_error (GPG_ERR_MISSING_VALUE); + else + { + const char *s = getenv (line); + if (!s) + err = set_error (GPG_ERR_NOT_FOUND, "No such envvar"); + else + err = assuan_send_data (ctx, s, strlen (s)); + } + } else err = set_error (GPG_ERR_ASS_PARAMETER, "unknown value for WHAT"); -- cgit v1.2.3 From e2bd152a928d79ddfb95fd2f7911c80a1a8d5a21 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 12 Apr 2018 11:49:36 +0200 Subject: gpg: Relax printing of STATUS_FAILURE. * g10/gpg.c (g10_exit): Print STATUS_FAILURE only based on passed return code and not on the presence of any call to log_error. -- This fixes an actual regression in GPGME where FAILURE is considered for example by a signature verify operation. The operation will simply fail and not just record that that a signature could not be verified. In particular for files with more than one signature a log_error if often called to show that a pubkey is missing for one of the signatures. Using that log_error is correct in that case. Fixes-commit: 0336e5d1a7b9d46e06c838e6a98aecfcc9542882 Signed-off-by: Werner Koch --- g10/gpg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/g10/gpg.c b/g10/gpg.c index fbbdd92ba..aaeddeee2 100644 --- a/g10/gpg.c +++ b/g10/gpg.c @@ -5111,7 +5111,7 @@ g10_exit( int rc ) /* If we had an error but not printed an error message, do it now. * Note that write_status_failure will never print a second failure * status line. */ - if (log_get_errorcount (0)) + if (rc) write_status_failure ("gpg-exit", gpg_error (GPG_ERR_GENERAL)); gcry_control (GCRYCTL_UPDATE_RANDOM_SEED_FILE); -- cgit v1.2.3 From 23a714598c247d78cfda46a6dc338b17e17cc194 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 12 Apr 2018 16:41:05 +0200 Subject: gpg: Extend the ERRSIG status line with a fingerprint. * g10/mainproc.c (issuer_fpr_raw): New. (issuer_fpr_string): Re-implement using issuer_fpr_rtaw. (check_sig_and_print): Don't free ISSUER_FPR. Use ISSUER_FPR_RAW. Use write_status_printf. Extend ERRSIG status. -- Modern OpenPGP implementations put the ISSUER_FPR into the signature to make it easier to discover the, public needed to check the signature. This is also useful in error messages and thus we add it. Signed-off-by: Werner Koch --- NEWS | 3 +++ doc/DETAILS | 13 +++++++++---- g10/mainproc.c | 57 ++++++++++++++++++++++++++++++++++++++------------------- 3 files changed, 50 insertions(+), 23 deletions(-) diff --git a/NEWS b/NEWS index 403c2a05f..cd547a1eb 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,9 @@ Noteworthy changes in version 2.2.7 (unreleased) * gpg: New option --no-symkey-cache to disable the passphrase cache for symmetrical en- and decryption. + * gpg: The ERRSIG status now prints the fingerprint if that is part + of the signature. + Noteworthy changes in version 2.2.6 (2018-04-09) ------------------------------------------------ diff --git a/doc/DETAILS b/doc/DETAILS index e54e8a0f7..2d78fecf7 100644 --- a/doc/DETAILS +++ b/doc/DETAILS @@ -435,14 +435,17 @@ pkd:0:1024:B665B1435F4C2 .... FF26ABB: available. This is the case with CMS and might eventually also be available for OpenPGP. -*** ERRSIG