summaryrefslogtreecommitdiff
path: root/pkgtools/pkg_install
diff options
context:
space:
mode:
authoragc <agc@pkgsrc.org>2016-07-06 21:00:04 +0000
committeragc <agc@pkgsrc.org>2016-07-06 21:00:04 +0000
commit09cb1e776880ee778d7e833b5ceb59b99d6e5a81 (patch)
treee731ff01f9821239716151b468e7edbdbfe134fe /pkgtools/pkg_install
parente1fe93c2d2872e155fabacd11552023332dc2ad2 (diff)
downloadpkgsrc-09cb1e776880ee778d7e833b5ceb59b99d6e5a81.tar.gz
catch up with the new opaque pgpv_t and pgpv_cursor_t structures in libnetpgpverify.
Diffstat (limited to 'pkgtools/pkg_install')
-rw-r--r--pkgtools/pkg_install/files/lib/gpgsig.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/pkgtools/pkg_install/files/lib/gpgsig.c b/pkgtools/pkg_install/files/lib/gpgsig.c
index b7d1280b73a..c0cd9e08eb1 100644
--- a/pkgtools/pkg_install/files/lib/gpgsig.c
+++ b/pkgtools/pkg_install/files/lib/gpgsig.c
@@ -1,4 +1,4 @@
-/* $NetBSD: gpgsig.c,v 1.4 2015/09/01 12:14:06 jperkin Exp $ */
+/* $NetBSD: gpgsig.c,v 1.5 2016/07/06 21:00:04 agc Exp $ */
#if HAVE_CONFIG_H
#include "config.h"
#endif
@@ -7,7 +7,7 @@
#include <sys/cdefs.h>
#endif
-__RCSID("$NetBSD: gpgsig.c,v 1.4 2015/09/01 12:14:06 jperkin Exp $");
+__RCSID("$NetBSD: gpgsig.c,v 1.5 2016/07/06 21:00:04 agc Exp $");
/*-
* Copyright (c) 2008 Joerg Sonnenberger <joerg@NetBSD.org>.
@@ -57,8 +57,8 @@ int
gpg_verify(const char *content, size_t len, const char *keyring,
const char *sig, size_t sig_len)
{
- pgpv_t pgp;
- pgpv_cursor_t cursor;
+ pgpv_t *pgp;
+ pgpv_cursor_t *cursor;
static const char hdr1[] = "-----BEGIN PGP SIGNED MESSAGE-----\n";
static const char hdr2[] = "Hash: SHA512\n\n";
ssize_t buflen;
@@ -76,17 +76,17 @@ gpg_verify(const char *content, size_t len, const char *keyring,
buflen = len;
}
- memset(&pgp, 0, sizeof(pgp));
- memset(&cursor, 0, sizeof(cursor));
+ pgp = pgpv_new();
+ cursor = pgpv_new_cursor();
- if (!pgpv_read_pubring(&pgp, keyring, -1))
+ if (!pgpv_read_pubring(pgp, keyring, -1))
err(EXIT_FAILURE, "cannot read keyring");
- if (!pgpv_verify(&cursor, &pgp, buf, buflen))
+ if (!pgpv_verify(cursor, pgp, buf, buflen))
errx(EXIT_FAILURE, "unable to verify signature: %s",
- cursor.why);
+ pgpv_get_cursor_str(cursor, "why"));
- pgpv_close(&pgp);
+ pgpv_close(pgp);
if (sig_len)
free(buf);