diff options
author | Werner Koch <[email protected]> | 2014-06-10 12:54:55 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2014-06-23 07:25:45 +0000 |
commit | 4239780d5a8418d675884309416aa3f71b5b8faa (patch) | |
tree | d1f51d2eeb22c6bbc92aef09844619b276424d05 | |
parent | doc: Remove outdated Russian man page. (diff) | |
download | gnupg-4239780d5a8418d675884309416aa3f71b5b8faa.tar.gz gnupg-4239780d5a8418d675884309416aa3f71b5b8faa.zip |
gpg: Use more specific reason codes for INV_RECP.
* g10/pkclist.c (build_pk_list): Use more specific reasons codes for
INV_RECP.
--
GnuPG-bug-id: 1650
Note that this patch is a bit more limited than the one in 2.1.
-rw-r--r-- | doc/DETAILS | 4 | ||||
-rw-r--r-- | g10/pkclist.c | 18 |
2 files changed, 16 insertions, 6 deletions
diff --git a/doc/DETAILS b/doc/DETAILS index fe55ae16a..7f12e211f 100644 --- a/doc/DETAILS +++ b/doc/DETAILS @@ -1,6 +1,6 @@ -*- text -*- -NOTE: The definitive reference is the file from the SVN trunk. +NOTE: The definitive reference is in GIT master. Format of colon listings ======================== @@ -517,6 +517,8 @@ more arguments in future versions. 8 := "Policy mismatch" 9 := "Not a secret key" 10 := "Key not trusted" + 13 := "Key disabled" + 14 := "Syntax error in specification" Note that this status is also used for gpgsm's SIGNER command where it relates to signer's of course. diff --git a/g10/pkclist.c b/g10/pkclist.c index e8167c712..198e3078d 100644 --- a/g10/pkclist.c +++ b/g10/pkclist.c @@ -822,7 +822,11 @@ build_pk_list( STRLIST rcpts, PK_LIST *ret_pk_list, unsigned int use ) { free_public_key ( pk ); pk = NULL; log_error (_("%s: skipped: %s\n"), rov->d, g10_errstr(rc) ); - write_status_text_and_buffer (STATUS_INV_RECP, "0 ", + write_status_text_and_buffer (STATUS_INV_RECP, + (rc == G10ERR_NO_PUBKEY + || rc == G10ERR_NO_SECKEY)? "1 ": + (rc == G10ERR_INV_USER_ID)? "14 ": + "0 ", rov->d, strlen (rov->d), -1); goto fail; } @@ -865,7 +869,7 @@ build_pk_list( STRLIST rcpts, PK_LIST *ret_pk_list, unsigned int use ) available. */ free_public_key( pk ); pk = NULL; log_error(_("%s: skipped: %s\n"), rov->d, g10_errstr(rc) ); - write_status_text_and_buffer (STATUS_INV_RECP, "0 ", + write_status_text_and_buffer (STATUS_INV_RECP, "3 ", rov->d, strlen (rov->d), -1); goto fail; } @@ -1077,7 +1081,11 @@ build_pk_list( STRLIST rcpts, PK_LIST *ret_pk_list, unsigned int use ) /* Key not found or other error. */ free_public_key( pk ); pk = NULL; log_error(_("%s: skipped: %s\n"), remusr->d, g10_errstr(rc) ); - write_status_text_and_buffer (STATUS_INV_RECP, "0 ", + write_status_text_and_buffer (STATUS_INV_RECP, + (rc == G10ERR_NO_PUBKEY + || rc == G10ERR_NO_SECKEY)? "1 ": + (rc == G10ERR_INV_USER_ID)? "14 ": + "0 ", remusr->d, strlen (remusr->d), -1); goto fail; @@ -1094,7 +1102,7 @@ build_pk_list( STRLIST rcpts, PK_LIST *ret_pk_list, unsigned int use ) free_public_key(pk); pk = NULL; log_info(_("%s: skipped: public key is disabled\n"), remusr->d); - write_status_text_and_buffer (STATUS_INV_RECP, "0 ", + write_status_text_and_buffer (STATUS_INV_RECP, "13 ", remusr->d, strlen (remusr->d), -1); @@ -1143,7 +1151,7 @@ build_pk_list( STRLIST rcpts, PK_LIST *ret_pk_list, unsigned int use ) { /* Key found but not usable for us (e.g. sign-only key). */ free_public_key( pk ); pk = NULL; - write_status_text_and_buffer (STATUS_INV_RECP, "0 ", + write_status_text_and_buffer (STATUS_INV_RECP, "3 ", remusr->d, strlen (remusr->d), -1); |