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 Changes to 1.99.22/20100307
details: https://anonhg.NetBSD.org/src/rev/c04fd652f616
branches: trunk
changeset: 752839:c04fd652f616
user: agc <agc%NetBSD.org@localhost>
date: Mon Mar 08 07:37:23 2010 +0000
description:
Changes to 1.99.22/20100307
+ add key expiry information to public key information display
diffstat:
crypto/external/bsd/netpgp/dist/TODO | 2 +
crypto/external/bsd/netpgp/dist/configure | 22 ++++----
crypto/external/bsd/netpgp/dist/configure.ac | 6 +-
crypto/external/bsd/netpgp/dist/src/lib/keyring.c | 37 +++++++++++---
crypto/external/bsd/netpgp/dist/src/lib/packet-parse.c | 3 +-
crypto/external/bsd/netpgp/dist/src/lib/packet-print.c | 20 +++++++-
crypto/external/bsd/netpgp/dist/src/lib/version.h | 2 +-
crypto/external/bsd/netpgp/dist/src/netpgp/Makefile | 6 +-
crypto/external/bsd/netpgp/dist/src/netpgpverify/Makefile | 6 +-
crypto/external/bsd/netpgp/dist/src/netpgpverify/verify.c | 4 +-
10 files changed, 74 insertions(+), 34 deletions(-)
diffs (truncated from 377 to 300 lines):
diff -r 0f0ff63e0997 -r c04fd652f616 crypto/external/bsd/netpgp/dist/TODO
--- a/crypto/external/bsd/netpgp/dist/TODO Mon Mar 08 06:48:10 2010 +0000
+++ b/crypto/external/bsd/netpgp/dist/TODO Mon Mar 08 07:37:23 2010 +0000
@@ -1,5 +1,6 @@
To Do
=====
+add revocation information to public key display
agent
agentctl
trust subpackets
@@ -91,3 +92,4 @@
hkpd
hkpclient
netbsd/pkgsrc pr 42922
+add expiry information to public key display
diff -r 0f0ff63e0997 -r c04fd652f616 crypto/external/bsd/netpgp/dist/configure
--- a/crypto/external/bsd/netpgp/dist/configure Mon Mar 08 06:48:10 2010 +0000
+++ b/crypto/external/bsd/netpgp/dist/configure Mon Mar 08 07:37:23 2010 +0000
@@ -1,7 +1,7 @@
#! /bin/sh
-# From configure.ac Revision: 1.25 .
+# From configure.ac Revision: 1.26 .
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.63 for netpgp 20100305.
+# Generated by GNU Autoconf 2.63 for netpgp 20100307.
#
# Report bugs to <Alistair Crooks <agc%netbsd.org@localhost> c0596823>.
#
@@ -751,8 +751,8 @@
# Identity of this package.
PACKAGE_NAME='netpgp'
PACKAGE_TARNAME='netpgp'
-PACKAGE_VERSION='20100305'
-PACKAGE_STRING='netpgp 20100305'
+PACKAGE_VERSION='20100307'
+PACKAGE_STRING='netpgp 20100307'
PACKAGE_BUGREPORT='Alistair Crooks <agc%netbsd.org@localhost> c0596823'
ac_unique_file="src/netpgp/netpgp.c"
@@ -1483,7 +1483,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures netpgp 20100305 to adapt to many kinds of systems.
+\`configure' configures netpgp 20100307 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1553,7 +1553,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of netpgp 20100305:";;
+ short | recursive ) echo "Configuration of netpgp 20100307:";;
esac
cat <<\_ACEOF
@@ -1660,7 +1660,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-netpgp configure 20100305
+netpgp configure 20100307
generated by GNU Autoconf 2.63
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1674,7 +1674,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by netpgp $as_me 20100305, which was
+It was created by netpgp $as_me 20100307, which was
generated by GNU Autoconf 2.63. Invocation command line was
$ $0 $@
@@ -2561,7 +2561,7 @@
# Define the identity of the package.
PACKAGE='netpgp'
- VERSION='20100305'
+ VERSION='20100307'
cat >>confdefs.h <<_ACEOF
@@ -22306,7 +22306,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by netpgp $as_me 20100305, which was
+This file was extended by netpgp $as_me 20100307, which was
generated by GNU Autoconf 2.63. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -22369,7 +22369,7 @@
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_version="\\
-netpgp config.status 20100305
+netpgp config.status 20100307
configured by $0, generated by GNU Autoconf 2.63,
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
diff -r 0f0ff63e0997 -r c04fd652f616 crypto/external/bsd/netpgp/dist/configure.ac
--- a/crypto/external/bsd/netpgp/dist/configure.ac Mon Mar 08 06:48:10 2010 +0000
+++ b/crypto/external/bsd/netpgp/dist/configure.ac Mon Mar 08 07:37:23 2010 +0000
@@ -1,10 +1,10 @@
-# $NetBSD: configure.ac,v 1.26 2010/03/05 19:58:38 agc Exp $
+# $NetBSD: configure.ac,v 1.27 2010/03/08 07:37:24 agc Exp $
#
# Process this file with autoconf to produce a configure script.
-AC_INIT([netpgp],[20100305],[Alistair Crooks <agc%netbsd.org@localhost> c0596823])
+AC_INIT([netpgp],[20100307],[Alistair Crooks <agc%netbsd.org@localhost> c0596823])
AC_PREREQ(2.63)
-AC_REVISION([$Revision: 1.26 $])
+AC_REVISION([$Revision: 1.27 $])
AS_SHELL_SANITIZE
diff -r 0f0ff63e0997 -r c04fd652f616 crypto/external/bsd/netpgp/dist/src/lib/keyring.c
--- a/crypto/external/bsd/netpgp/dist/src/lib/keyring.c Mon Mar 08 06:48:10 2010 +0000
+++ b/crypto/external/bsd/netpgp/dist/src/lib/keyring.c Mon Mar 08 07:37:23 2010 +0000
@@ -57,7 +57,7 @@
#if defined(__NetBSD__)
__COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: keyring.c,v 1.29 2010/03/05 16:30:05 agc Exp $");
+__RCSID("$NetBSD: keyring.c,v 1.30 2010/03/08 07:37:24 agc Exp $");
#endif
#ifdef HAVE_FCNTL_H
@@ -584,21 +584,33 @@
}
+/* used to point to data during keyring read */
+typedef struct keyringcb_t {
+ __ops_keyring_t *keyring; /* the keyring we're reading */
+} keyringcb_t;
+
+
static __ops_cb_ret_t
cb_keyring_read(const __ops_packet_t *pkt, __ops_cbdata_t *cbinfo)
{
- __OPS_USED(cbinfo);
+ __ops_keyring_t *keyring;
+ keyringcb_t *cb;
+ cb = __ops_callback_arg(cbinfo);
+ keyring = cb->keyring;
switch (pkt->tag) {
case OPS_PARSER_PTAG:
- case OPS_PTAG_CT_ENCRYPTED_SECRET_KEY: /* we get these because we
- * didn't prompt */
+ case OPS_PTAG_CT_ENCRYPTED_SECRET_KEY:
+ /* we get these because we didn't prompt */
case OPS_PTAG_CT_SIGNATURE_HEADER:
case OPS_PTAG_CT_SIGNATURE_FOOTER:
case OPS_PTAG_CT_SIGNATURE:
case OPS_PTAG_CT_TRUST:
case OPS_PARSER_ERRCODE:
break;
+ case OPS_PTAG_SS_KEY_EXPIRY:
+ keyring->keys[keyring->keyc].key.pubkey.duration = pkt->u.ss_time.time;
+ break;
default:
break;
@@ -638,9 +650,12 @@
const char *filename)
{
__ops_stream_t *stream;
- unsigned res = 1;
- int fd;
+ keyringcb_t cb;
+ unsigned res = 1;
+ int fd;
+ (void) memset(&cb, 0x0, sizeof(cb));
+ cb.keyring = keyring;
stream = __ops_new(sizeof(*stream));
/* add this for the moment, */
@@ -668,7 +683,7 @@
__ops_reader_set_fd(stream, fd);
#endif
- __ops_set_callback(stream, cb_keyring_read, NULL);
+ __ops_set_callback(stream, cb_keyring_read, &cb);
if (armour) {
__ops_reader_push_dearmour(stream);
@@ -718,11 +733,14 @@
{
__ops_stream_t *stream;
const unsigned noaccum = 0;
+ keyringcb_t cb;
unsigned res;
+ (void) memset(&cb, 0x0, sizeof(cb));
+ cb.keyring = keyring;
stream = __ops_new(sizeof(*stream));
__ops_parse_options(stream, OPS_PTAG_SS_ALL, OPS_PARSE_PARSED);
- __ops_setup_memory_read(io, &stream, mem, NULL, cb_keyring_read,
+ __ops_setup_memory_read(io, &stream, mem, &cb, cb_keyring_read,
noaccum);
if (armour) {
__ops_reader_push_dearmour(stream);
@@ -993,14 +1011,17 @@
__ops_add_to_pubring(__ops_keyring_t *keyring, const __ops_pubkey_t *pubkey)
{
__ops_key_t *key;
+ time_t duration;
EXPAND_ARRAY(keyring, key);
key = &keyring->keys[keyring->keyc++];
+ duration = key->key.pubkey.duration;
(void) memset(key, 0x0, sizeof(*key));
__ops_keyid(key->key_id, OPS_KEY_ID_SIZE, pubkey);
__ops_fingerprint(&key->fingerprint, pubkey);
key->type = OPS_PTAG_CT_PUBLIC_KEY;
key->key.pubkey = *pubkey;
+ key->key.pubkey.duration = duration;
return 1;
}
diff -r 0f0ff63e0997 -r c04fd652f616 crypto/external/bsd/netpgp/dist/src/lib/packet-parse.c
--- a/crypto/external/bsd/netpgp/dist/src/lib/packet-parse.c Mon Mar 08 06:48:10 2010 +0000
+++ b/crypto/external/bsd/netpgp/dist/src/lib/packet-parse.c Mon Mar 08 07:37:23 2010 +0000
@@ -58,7 +58,7 @@
#if defined(__NetBSD__)
__COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: packet-parse.c,v 1.30 2010/03/05 16:01:09 agc Exp $");
+__RCSID("$NetBSD: packet-parse.c,v 1.31 2010/03/08 07:37:24 agc Exp $");
#endif
#ifdef HAVE_OPENSSL_CAST_H
@@ -2113,6 +2113,7 @@
if (__ops_get_debug_level(__FILE__)) {
(void) fprintf(stderr, "parse_v4_sig: RSA: sig is\n");
BN_print_fp(stderr, pkt.u.sig.info.sig.rsa.sig);
+ (void) fprintf(stderr, "\n");
}
break;
diff -r 0f0ff63e0997 -r c04fd652f616 crypto/external/bsd/netpgp/dist/src/lib/packet-print.c
--- a/crypto/external/bsd/netpgp/dist/src/lib/packet-print.c Mon Mar 08 06:48:10 2010 +0000
+++ b/crypto/external/bsd/netpgp/dist/src/lib/packet-print.c Mon Mar 08 07:37:23 2010 +0000
@@ -58,7 +58,7 @@
#if defined(__NetBSD__)
__COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: packet-print.c,v 1.27 2010/03/05 16:01:09 agc Exp $");
+__RCSID("$NetBSD: packet-print.c,v 1.28 2010/03/08 07:37:24 agc Exp $");
#endif
#include <string.h>
@@ -392,22 +392,38 @@
const __ops_pubkey_t *pubkey)
{
unsigned i;
+ time_t now;
char uidbuf[KB(128)];
char keyid[OPS_KEY_ID_SIZE * 3];
char fp[(OPS_FINGERPRINT_SIZE * 3) + 1];
+ char expired[128];
char t[32];
+ int cc;
int n;
for (i = 0, n = 0; i < key->uidc; i++) {
n += snprintf(&uidbuf[n], sizeof(uidbuf) - n,
"uid %s\n", key->uids[i].userid);
}
- return __ops_asprintf(buf, "%s %d/%s %s %s\nKey fingerprint: %s\n%s",
+ now = time(NULL);
+ if (pubkey->duration > 0) {
+ cc = snprintf(expired, sizeof(expired),
+ (pubkey->birthtime + pubkey->duration < now) ?
+ "[EXPIRED " : "[EXPIRES ");
+ ptimestr(&expired[cc], sizeof(expired) - cc,
+ pubkey->birthtime + pubkey->duration);
+ cc += 10;
+ cc += snprintf(&expired[cc], sizeof(expired) - cc, "]");
+ } else {
+ expired[0] = 0x0;
+ }
+ return __ops_asprintf(buf, "%s %d/%s %s %s %s\nKey fingerprint: %s\n%s",
header,
numkeybits(pubkey),
__ops_show_pka(pubkey->alg),
strhexdump(keyid, key->key_id, OPS_KEY_ID_SIZE, ""),
ptimestr(t, sizeof(t), pubkey->birthtime),
+ expired,
strhexdump(fp, key->fingerprint.fingerprint, OPS_FINGERPRINT_SIZE, " "),
uidbuf);
}
diff -r 0f0ff63e0997 -r c04fd652f616 crypto/external/bsd/netpgp/dist/src/lib/version.h
--- a/crypto/external/bsd/netpgp/dist/src/lib/version.h Mon Mar 08 06:48:10 2010 +0000
Home |
Main Index |
Thread Index |
Old Index