diff options
-rw-r--r-- | lib/formats.c | 26 |
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; |