Take advantage of pgpPrtParams() directly in pgpsigFormat() extension
authorPanu Matilainen <pmatilai@redhat.com>
Wed, 9 Nov 2011 11:28:23 +0000 (13:28 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Wed, 9 Nov 2011 11:29:42 +0000 (13:29 +0200)
- No functional changes, just bypassing an unnecessary round-trip to
  a function really intended for other purposes, now that we can.

lib/formats.c

index 4d0500e..03d32f2 100644 (file)
@@ -423,10 +423,9 @@ static char * pgpsigFormat(rpmtd td)
     if (rpmtdType(td) != RPM_BIN_TYPE) {
        val = xstrdup(_("(not a blob)"));
     } else {
-       pgpDig dig = NULL;
-       pgpDigParams sigp = parsePGPSig(td, NULL, NULL, &dig);
+       pgpDigParams sigp = NULL;
 
-       if (sigp == NULL) {
+       if (pgpPrtParams(td->data, td->count, PGPTAG_SIGNATURE, &sigp)) {
            val = xstrdup(_("(not an OpenPGP signature)"));
        } else {
            char dbuf[BUFSIZ];
@@ -449,7 +448,7 @@ static char * pgpsigFormat(rpmtd td)
                        dbuf, keyid);
 
            free(keyid);
-           pgpFreeDig(dig);
+           pgpDigParamsFree(sigp);
        }
     }