pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/pkg_install/files/lib catch up with the new o...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/a7b0d5fa5b31
branches:  trunk
changeset: 349394:a7b0d5fa5b31
user:      agc <agc%pkgsrc.org@localhost>
date:      Wed Jul 06 21:00:04 2016 +0000

description:
catch up with the new opaque pgpv_t and pgpv_cursor_t structures in libnetpgpverify.

diffstat:

 pkgtools/pkg_install/files/lib/gpgsig.c |  20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diffs (53 lines):

diff -r 8cacf11c74eb -r a7b0d5fa5b31 pkgtools/pkg_install/files/lib/gpgsig.c
--- a/pkgtools/pkg_install/files/lib/gpgsig.c   Wed Jul 06 15:22:58 2016 +0000
+++ b/pkgtools/pkg_install/files/lib/gpgsig.c   Wed Jul 06 21:00:04 2016 +0000
@@ -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@localhost>.
@@ -57,8 +57,8 @@
 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 @@
                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);



Home | Main Index | Thread Index | Old Index