summaryrefslogtreecommitdiff
path: root/security/netpgpverify
diff options
context:
space:
mode:
authoragc <agc@pkgsrc.org>2016-07-09 17:44:44 +0000
committeragc <agc@pkgsrc.org>2016-07-09 17:44:44 +0000
commitd1be2a035b965325b1b54c32a416d40604f2e2f3 (patch)
tree968986e096b72034032546dd4e1bb8fdcb8b6691 /security/netpgpverify
parent67da42058e22b27523c718035e32b93a80ee9f9f (diff)
downloadpkgsrc-d1be2a035b965325b1b54c32a416d40604f2e2f3.tar.gz
Update netpgpverify and libnetpgpverify to 20160709
+ free resources associated with the cursor when verifying, gets rid of 2 more loss records under valgrind.
Diffstat (limited to 'security/netpgpverify')
-rw-r--r--security/netpgpverify/files/main.c16
-rw-r--r--security/netpgpverify/files/verify.h4
2 files changed, 12 insertions, 8 deletions
diff --git a/security/netpgpverify/files/main.c b/security/netpgpverify/files/main.c
index 1dcba753d83..939ceaab0d4 100644
--- a/security/netpgpverify/files/main.c
+++ b/security/netpgpverify/files/main.c
@@ -95,20 +95,22 @@ verify_data(pgpv_t *pgp, const char *cmd, const char *inname, char *in, ssize_t
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, const char *inname, char *in, ssize_t
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
diff --git a/security/netpgpverify/files/verify.h b/security/netpgpverify/files/verify.h
index 9439bc82a00..3f3721cd879 100644
--- a/security/netpgpverify/files/verify.h
+++ b/security/netpgpverify/files/verify.h
@@ -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>