Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/crypto/external/bsd/netpgp/dist/src/netpgpverify netpgpverif...
details: https://anonhg.NetBSD.org/src/rev/15e1e10c3c38
branches: trunk
changeset: 345904:15e1e10c3c38
user: agc <agc%NetBSD.org@localhost>
date: Wed Jun 15 03:37:50 2016 +0000
description:
netpgpverify: bring over changes in 20160615 from pkgsrc
+ perform check for start of ascii-armoured signature in a more efficient
way
diffstat:
crypto/external/bsd/netpgp/dist/src/netpgpverify/libverify.c | 18 ++++-------
crypto/external/bsd/netpgp/dist/src/netpgpverify/verify.h | 6 ++--
2 files changed, 10 insertions(+), 14 deletions(-)
diffs (51 lines):
diff -r ccfabe4c6545 -r 15e1e10c3c38 crypto/external/bsd/netpgp/dist/src/netpgpverify/libverify.c
--- a/crypto/external/bsd/netpgp/dist/src/netpgpverify/libverify.c Wed Jun 15 02:12:14 2016 +0000
+++ b/crypto/external/bsd/netpgp/dist/src/netpgpverify/libverify.c Wed Jun 15 03:37:50 2016 +0000
@@ -2021,18 +2021,14 @@
return 0;
}
litdata.u.litdata.len = litdata.s.size = (size_t)(p - datastart);
- p += strlen(SIGSTART);
- /* Work out whther there's a version line */
- if (memcmp(p, "Version:", 8) == 0) {
- if ((p = find_bin_string(p, mem->size, "\n\n", 2)) == NULL) {
- snprintf(cursor->why, sizeof(cursor->why),
- "malformed armed signature at %zu", (size_t)(p - mem->mem));
- return 0;
- }
- p += 2;
- } else {
- p += 1;
+ /* this puts p at the newline character, so it will find \n\n if no version */
+ p += strlen(SIGSTART) - 1;
+ if ((p = find_bin_string(p, mem->size, "\n\n", 2)) == NULL) {
+ snprintf(cursor->why, sizeof(cursor->why),
+ "malformed armed signature at %zu", (size_t)(p - mem->mem));
+ return 0;
}
+ p += 2;
sigend = find_bin_string(p, mem->size, SIGEND, strlen(SIGEND));
binsigsize = b64decode((char *)p, (size_t)(sigend - p), binsig, sizeof(binsig));
diff -r ccfabe4c6545 -r 15e1e10c3c38 crypto/external/bsd/netpgp/dist/src/netpgpverify/verify.h
--- a/crypto/external/bsd/netpgp/dist/src/netpgpverify/verify.h Wed Jun 15 02:12:14 2016 +0000
+++ b/crypto/external/bsd/netpgp/dist/src/netpgpverify/verify.h Wed Jun 15 03:37:50 2016 +0000
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2012,2013,2014,2015 Alistair Crooks <agc%NetBSD.org@localhost>
+ * Copyright (c) 2012,2013,2014,2015,2016 Alistair Crooks <agc%NetBSD.org@localhost>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -23,9 +23,9 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef NETPGP_VERIFY_H_
-#define NETPGP_VERIFY_H_ 20160614
+#define NETPGP_VERIFY_H_ 20160615
-#define NETPGPVERIFY_VERSION "netpgpverify portable 20160614"
+#define NETPGPVERIFY_VERSION "netpgpverify portable 20160615"
#include <sys/types.h>
Home |
Main Index |
Thread Index |
Old Index