diff options
Diffstat (limited to 'common/status.c')
-rw-r--r-- | common/status.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/common/status.c b/common/status.c index 7012edf03..e9f84bfd1 100644 --- a/common/status.c +++ b/common/status.c @@ -36,3 +36,30 @@ get_status_string ( int no ) return statusstr_msgstr + statusstr_msgidx[idx]; } + +const char * +get_inv_recpsgnr_code (gpg_error_t err) +{ + const char *errstr; + + switch (gpg_err_code (err)) + { + case GPG_ERR_NO_PUBKEY: errstr = "1"; break; + case GPG_ERR_AMBIGUOUS_NAME: errstr = "2"; break; + case GPG_ERR_WRONG_KEY_USAGE: errstr = "3"; break; + case GPG_ERR_CERT_REVOKED: errstr = "4"; break; + case GPG_ERR_CERT_EXPIRED: errstr = "5"; break; + case GPG_ERR_NO_CRL_KNOWN: errstr = "6"; break; + case GPG_ERR_CRL_TOO_OLD: errstr = "7"; break; + case GPG_ERR_NO_POLICY_MATCH: errstr = "8"; break; + + case GPG_ERR_UNUSABLE_SECKEY: + case GPG_ERR_NO_SECKEY: errstr = "9"; break; + + case GPG_ERR_NOT_TRUSTED: errstr = "10"; break; + case GPG_ERR_MISSING_CERT: errstr = "11"; break; + default: errstr = "0"; break; + } + + return errstr; +} |