summaryrefslogtreecommitdiff
path: root/lib/formats.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2010-05-19 15:33:52 +0300
committerPanu Matilainen <pmatilai@redhat.com>2010-05-19 15:33:52 +0300
commite63293b0ea1c6a3a4be6aca328ee9fae4c3bfcdb (patch)
treebb1505ee394ff1982d9cda6dcefbc482b59e1b73 /lib/formats.c
parent2be413810cd78b0a503699ceca3f8e1505f1b425 (diff)
downloadrpm-e63293b0ea1c6a3a4be6aca328ee9fae4c3bfcdb.tar.gz
rpm-e63293b0ea1c6a3a4be6aca328ee9fae4c3bfcdb.tar.bz2
rpm-e63293b0ea1c6a3a4be6aca328ee9fae4c3bfcdb.zip
Use pgpValString() for :pgpsig header formatting (RhBug:587755)
- instead of copy-slopping (and forgetting to do so whenever something changes) just use the values we know from pgpVals..
Diffstat (limited to 'lib/formats.c')
-rw-r--r--lib/formats.c26
1 files changed, 2 insertions, 24 deletions
diff --git a/lib/formats.c b/lib/formats.c
index 07009553c..3113c8049 100644
--- a/lib/formats.c
+++ b/lib/formats.c
@@ -517,33 +517,11 @@ static char * pgpsigFormat(rpmtd td, char * formatPrefix)
nb += 100;
val = t = xrealloc(val, nb + 1);
- switch (sigp->pubkey_algo) {
- case PGPPUBKEYALGO_DSA:
- t = stpcpy(t, "DSA");
- break;
- case PGPPUBKEYALGO_RSA:
- t = stpcpy(t, "RSA");
- break;
- default:
- (void) snprintf(t, nb - (t - val), "%d", sigp->pubkey_algo);
- t += strlen(t);
- break;
- }
+ t = stpcpy(t, pgpValString(PGPVAL_PUBKEYALGO, sigp->pubkey_algo));
if (t + 5 >= val + nb)
goto again;
*t++ = '/';
- switch (sigp->hash_algo) {
- case PGPHASHALGO_MD5:
- t = stpcpy(t, "MD5");
- break;
- case PGPHASHALGO_SHA1:
- t = stpcpy(t, "SHA1");
- break;
- default:
- (void) snprintf(t, nb - (t - val), "%d", sigp->hash_algo);
- t += strlen(t);
- break;
- }
+ t = stpcpy(t, pgpValString(PGPVAL_HASHALGO, sigp->hash_algo));
if (t + strlen (", ") + 1 >= val + nb)
goto again;