summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2010-05-19 15:33:52 +0300
committerPanu Matilainen <pmatilai@redhat.com>2010-06-11 10:29:35 +0300
commitffca3787a6f334cfbc6dd478337bf8c4e9c48a49 (patch)
tree787f7843b6d1efb936a0be33060ef0a2c77ed31a
parentae66316c2cf9a49a804369fc1629eda426fa0ecd (diff)
downloadrpm-ffca3787a6f334cfbc6dd478337bf8c4e9c48a49.tar.gz
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.. (cherry picked from commit e63293b0ea1c6a3a4be6aca328ee9fae4c3bfcdb)
-rw-r--r--lib/formats.c26
1 files changed, 2 insertions, 24 deletions
diff --git a/lib/formats.c b/lib/formats.c
index 0b62a4c51..6e6541f62 100644
--- a/lib/formats.c
+++ b/lib/formats.c
@@ -514,33 +514,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;