aboutsummaryrefslogtreecommitdiff
path: root/src/gpg.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2009-02-21 13:30:51 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2009-02-21 13:31:26 +0200
commit1213cf065e9b3a5fb45d00276b3d168462838c17 (patch)
tree8d8f3cb7617465139f0051c10ef80fa9c2c91369 /src/gpg.c
parent5bfe69d55cff8940fd3a84ff479e6e8308b164f4 (diff)
downloadwydawca-1213cf065e9b3a5fb45d00276b3d168462838c17.tar.gz
wydawca-1213cf065e9b3a5fb45d00276b3d168462838c17.tar.bz2
Remove trailing whitespace
Diffstat (limited to 'src/gpg.c')
-rw-r--r--src/gpg.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/gpg.c b/src/gpg.c
index cbeff1b..327ff77 100644
--- a/src/gpg.c
+++ b/src/gpg.c
@@ -112,7 +112,7 @@ rmdir_r (const char *name)
name, strerror (errno));
return 1;
}
-
+
return rc;
}
@@ -132,7 +132,7 @@ wydawca_gpg_homedir ()
{
if (homedir)
return 0;
-
+
homedir = xstrdup ("/tmp/wydawca-XXXXXX");
if (!mkdtemp (homedir))
{
@@ -162,41 +162,41 @@ gpg_sig_ok_p (gpgme_ctx_t ctx, gpgme_signature_t sig)
uid = key->uids->uid;
else
uid = sig->fpr;
-
+
switch (gpg_err_code (sig->status))
{
case GPG_ERR_NO_ERROR:
if (debug_level)
logmsg (LOG_NOTICE, "Good signature from %s", uid);
break;
-
+
case GPG_ERR_BAD_SIGNATURE:
logmsg (LOG_ERR, "BAD signature from %s", uid);
return 0;
-
+
case GPG_ERR_NO_PUBKEY:
logmsg (LOG_ERR, "No public key");
return 0;
-
+
case GPG_ERR_NO_DATA:
logmsg (LOG_ERR, "No signature");
return 0;
-
+
case GPG_ERR_SIG_EXPIRED:
logmsg (LOG_ERR, "Expired signature from %s", uid);
return 0;
-
+
case GPG_ERR_KEY_EXPIRED:
logmsg (LOG_ERR, "Key expired (%s)", uid);
return 0;
-
+
default:
logmsg (LOG_ERR, "Unknown signature error");
return 0;
}
}
return 1;
-}
+}
/* Verify the directive file from TRP using public key PUBKEY */
/* FIXME: dpair currently unused */
@@ -209,7 +209,7 @@ verify_directive_signature (struct file_triplet *trp,
off_t size;
gpgme_error_t ec;
int rc;
-
+
wydawca_gpg_homedir ();
fail_if_err (gpgme_new (&ctx));
fail_if_err (gpgme_data_new_from_mem (&key_data, pubkey, strlen (pubkey),
@@ -223,16 +223,16 @@ verify_directive_signature (struct file_triplet *trp,
if (ec == GPG_ERR_NO_ERROR)
{
gpgme_verify_result_t result;
-
+
size = gpgme_data_seek (plain, 0, SEEK_END);
gpgme_data_seek (plain, 0, SEEK_SET);
trp->blurb = xmalloc (size + 1);
gpgme_data_read (plain, trp->blurb, size);
trp->blurb[size] = 0;
gpgme_data_release (plain);
-
+
rc = directive_parse (trp);
-
+
result = gpgme_op_verify_result (ctx);
if (!gpg_sig_ok_p (ctx, result->signatures))
{
@@ -264,7 +264,7 @@ verify_detached_signature (struct file_triplet *trp,
{
gpgme_engine_info_t info;
const char *argv[5];
-
+
fail_if_err (gpgme_get_engine_info (&info));
while (info && info->protocol != GPGME_PROTOCOL_OpenPGP)
info = info->next;
@@ -275,7 +275,7 @@ verify_detached_signature (struct file_triplet *trp,
"the detached signature for %s", trp->name);
return 1;
}
-
+
wydawca_gpg_homedir ();
argv[0] = info->file_name;
argv[1] = "--verify";
@@ -300,6 +300,6 @@ verify_detached_signature (struct file_triplet *trp,
logmsg (LOG_CRIT, "cannot verify detached signature for %s", trp->name);
break;
}
-
+
return 1;
}

Return to:

Send suggestions and report system problems to the System administrator.