pkgsrc-Changes archive

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

CVS commit: pkgsrc/security/netpgpverify/files



Module Name:    pkgsrc
Committed By:   agc
Date:           Sat Jul  9 17:44:44 UTC 2016

Modified Files:
        pkgsrc/security/netpgpverify/files: main.c verify.h

Log Message:
Update netpgpverify and libnetpgpverify to 20160709

+ free resources associated with the cursor when verifying,
gets rid of 2 more loss records under valgrind.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 pkgsrc/security/netpgpverify/files/main.c
cvs rdiff -u -r1.34 -r1.35 pkgsrc/security/netpgpverify/files/verify.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/security/netpgpverify/files/main.c
diff -u pkgsrc/security/netpgpverify/files/main.c:1.7 pkgsrc/security/netpgpverify/files/main.c:1.8
--- pkgsrc/security/netpgpverify/files/main.c:1.7       Tue Jul  5 20:18:03 2016
+++ pkgsrc/security/netpgpverify/files/main.c   Sat Jul  9 17:44:44 2016
@@ -95,20 +95,22 @@ verify_data(pgpv_t *pgp, const char *cmd
        size_t           cookie;
        char            *data;
        int              el;
+       int              ok;
 
        cursor = pgpv_new_cursor();
+       ok = 0;
        if (strcasecmp(cmd, "cat") == 0) {
                if ((cookie = pgpv_verify(cursor, pgp, in, cc)) != 0) {
                        if ((size = pgpv_get_verified(cursor, cookie, &data)) > 0) {
                                write(STDOUT_FILENO, data, size);
                        }
-                       return 1;
+                       ok = 1;
                }
        } else if (strcasecmp(cmd, "dump") == 0) {
                if ((cookie = pgpv_verify(cursor, pgp, in, cc)) != 0) {
                        size = pgpv_dump(pgp, &data);
                        write(STDOUT_FILENO, data, size);
-                       return 1;
+                       ok = 1;
                }
        } else if (strcasecmp(cmd, "verify") == 0 || strcasecmp(cmd, "trust") == 0) {
                modifiers = (strcasecmp(cmd, "trust") == 0) ? "trust" : NULL;
@@ -117,14 +119,16 @@ verify_data(pgpv_t *pgp, const char *cmd
                        ptime(pgpv_get_cursor_num(cursor, "sigtime"));
                        el = pgpv_get_cursor_element(cursor, 0);
                        pentry(pgp, el, modifiers);
-                       return 1;
+                       ok = 1;
+               } else {
+                       fprintf(stderr, "Signature did not match contents -- %s\n",
+                               pgpv_get_cursor_str(cursor, "why"));
                }
-               fprintf(stderr, "Signature did not match contents -- %s\n",
-                       pgpv_get_cursor_str(cursor, "why"));
        } else {
                fprintf(stderr, "unrecognised command \"%s\"\n", cmd);
        }
-       return 0;
+       pgpv_cursor_close(cursor);
+       return ok;
 }
 
 int

Index: pkgsrc/security/netpgpverify/files/verify.h
diff -u pkgsrc/security/netpgpverify/files/verify.h:1.34 pkgsrc/security/netpgpverify/files/verify.h:1.35
--- pkgsrc/security/netpgpverify/files/verify.h:1.34    Sat Jul  9 17:18:24 2016
+++ pkgsrc/security/netpgpverify/files/verify.h Sat Jul  9 17:44:44 2016
@@ -23,9 +23,9 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 #ifndef NETPGP_VERIFY_H_
-#define NETPGP_VERIFY_H_       20160708
+#define NETPGP_VERIFY_H_       20160709
 
-#define NETPGPVERIFY_VERSION   "netpgpverify portable 20160708"
+#define NETPGPVERIFY_VERSION   "netpgpverify portable 20160709"
 
 #include <sys/types.h>
 



Home | Main Index | Thread Index | Old Index