summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Woodward2012-08-02 14:18:58 +0000
committerJason Woodward2012-08-02 14:21:09 +0000
commit3b90d44a7e3f08eec9f59abfdbda4638b488f808 (patch)
treeb99638c626b5b11576cbc1d62949b577e77bfa78
parente48860e2d6e318a592b1d232711278f0a44cc698 (diff)
downloadslapt-get-3b90d44a7e3f08eec9f59abfdbda4638b488f808.tar.gz
reorder _slapt_gpg_get_gpgme_error to be implemented at declaration
-rw-r--r--src/gpgme.c35
1 files changed, 17 insertions, 18 deletions
diff --git a/src/gpgme.c b/src/gpgme.c
index 44dc320..9f1026f 100644
--- a/src/gpgme.c
+++ b/src/gpgme.c
@@ -259,7 +259,23 @@ slapt_code_t slapt_add_pkg_source_gpg_key (FILE *key)
return imported;
}
-static slapt_code_t _slapt_gpg_get_gpgme_error(gpgme_sigsum_t sum);
+static slapt_code_t _slapt_gpg_get_gpgme_error(gpgme_sigsum_t sum)
+{
+ switch (sum)
+ {
+ case GPGME_SIGSUM_KEY_REVOKED: return SLAPT_CHECKSUMS_NOT_VERIFIED_GPGME_KEY_REVOKED;
+ case GPGME_SIGSUM_KEY_EXPIRED: return SLAPT_CHECKSUMS_NOT_VERIFIED_GPGME_KEY_EXPIRED;
+ case GPGME_SIGSUM_SIG_EXPIRED: return SLAPT_CHECKSUMS_NOT_VERIFIED_GPGME_SIG_EXPIRED;
+ case GPGME_SIGSUM_CRL_MISSING: return SLAPT_CHECKSUMS_NOT_VERIFIED_GPGME_CRL_MISSING;
+ case GPGME_SIGSUM_CRL_TOO_OLD: return SLAPT_CHECKSUMS_NOT_VERIFIED_GPGME_CRL_TOO_OLD;
+ case GPGME_SIGSUM_BAD_POLICY: return SLAPT_CHECKSUMS_NOT_VERIFIED_GPGME_BAD_POLICY;
+ case GPGME_SIGSUM_SYS_ERROR: return SLAPT_CHECKSUMS_NOT_VERIFIED_GPGME_SYS_ERROR;
+ default: break;
+ }
+
+ return SLAPT_CHECKSUMS_NOT_VERIFIED;
+}
+
slapt_code_t slapt_gpg_verify_checksums(FILE *checksums,
FILE *signature)
@@ -316,20 +332,3 @@ slapt_code_t slapt_gpg_verify_checksums(FILE *checksums,
return verified;
}
-slapt_code_t _slapt_gpg_get_gpgme_error(gpgme_sigsum_t sum)
-{
- switch (sum)
- {
- case GPGME_SIGSUM_KEY_REVOKED: return SLAPT_CHECKSUMS_NOT_VERIFIED_GPGME_KEY_REVOKED;
- case GPGME_SIGSUM_KEY_EXPIRED: return SLAPT_CHECKSUMS_NOT_VERIFIED_GPGME_KEY_EXPIRED;
- case GPGME_SIGSUM_SIG_EXPIRED: return SLAPT_CHECKSUMS_NOT_VERIFIED_GPGME_SIG_EXPIRED;
- case GPGME_SIGSUM_CRL_MISSING: return SLAPT_CHECKSUMS_NOT_VERIFIED_GPGME_CRL_MISSING;
- case GPGME_SIGSUM_CRL_TOO_OLD: return SLAPT_CHECKSUMS_NOT_VERIFIED_GPGME_CRL_TOO_OLD;
- case GPGME_SIGSUM_BAD_POLICY: return SLAPT_CHECKSUMS_NOT_VERIFIED_GPGME_BAD_POLICY;
- case GPGME_SIGSUM_SYS_ERROR: return SLAPT_CHECKSUMS_NOT_VERIFIED_GPGME_SYS_ERROR;
- default: break;
- }
-
- return SLAPT_CHECKSUMS_NOT_VERIFIED_UNKNOWN;
-}
-