Module Name: src
Committed By: agc
Date: Thu Sep 2 06:00:12 UTC 2010
Modified Files:
src/crypto/external/bsd/netpgp: Makefile
src/crypto/external/bsd/netpgp/dist: configure configure.ac
src/crypto/external/bsd/netpgp/dist/include: netpgp.h
src/crypto/external/bsd/netpgp/dist/src/lib: netpgp.c version.h
src/crypto/external/bsd/netpgp/dist/src/netpgp: Makefile
src/crypto/external/bsd/netpgp/dist/src/netpgpkeys: netpgpkeys.c
src/crypto/external/bsd/netpgp/dist/src/netpgpverify: Makefile
src/crypto/external/bsd/netpgp/netpgpkeys: Makefile
Log Message:
move the functions to parse the JSON from netpgpkeys(1) into libnetpgp(3)
update the version number for recent changes.
update the date for recent changes.
regenerate the autoconf files.
To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/crypto/external/bsd/netpgp/Makefile
cvs rdiff -u -r1.32 -r1.33 src/crypto/external/bsd/netpgp/dist/configure
cvs rdiff -u -r1.34 -r1.35 src/crypto/external/bsd/netpgp/dist/configure.ac
cvs rdiff -u -r1.19 -r1.20 \
src/crypto/external/bsd/netpgp/dist/include/netpgp.h
cvs rdiff -u -r1.71 -r1.72 \
src/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c
cvs rdiff -u -r1.40 -r1.41 \
src/crypto/external/bsd/netpgp/dist/src/lib/version.h
cvs rdiff -u -r1.17 -r1.18 \
src/crypto/external/bsd/netpgp/dist/src/netpgp/Makefile
cvs rdiff -u -r1.17 -r1.18 \
src/crypto/external/bsd/netpgp/dist/src/netpgpkeys/netpgpkeys.c
cvs rdiff -u -r1.16 -r1.17 \
src/crypto/external/bsd/netpgp/dist/src/netpgpverify/Makefile
cvs rdiff -u -r1.2 -r1.3 src/crypto/external/bsd/netpgp/netpgpkeys/Makefile
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/crypto/external/bsd/netpgp/Makefile
diff -u src/crypto/external/bsd/netpgp/Makefile:1.4 src/crypto/external/bsd/netpgp/Makefile:1.5
--- src/crypto/external/bsd/netpgp/Makefile:1.4 Sat Aug 7 04:34:03 2010
+++ src/crypto/external/bsd/netpgp/Makefile Thu Sep 2 06:00:11 2010
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.4 2010/08/07 04:34:03 agc Exp $
+# $NetBSD: Makefile,v 1.5 2010/09/02 06:00:11 agc Exp $
SUBDIR= libmj .WAIT
SUBDIR+= lib .WAIT
SUBDIR+= netpgp netpgpkeys netpgpverify
+#SUBDIR+= hkpc hkpd
.include <bsd.subdir.mk>
Index: src/crypto/external/bsd/netpgp/dist/configure
diff -u src/crypto/external/bsd/netpgp/dist/configure:1.32 src/crypto/external/bsd/netpgp/dist/configure:1.33
--- src/crypto/external/bsd/netpgp/dist/configure:1.32 Fri Jul 9 05:36:28 2010
+++ src/crypto/external/bsd/netpgp/dist/configure Thu Sep 2 06:00:11 2010
@@ -1,7 +1,7 @@
#! /bin/sh
-# From configure.ac Revision: 1.32 .
+# From configure.ac Revision: 1.34 .
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.63 for netpgp 20100707.
+# Generated by GNU Autoconf 2.63 for netpgp 20100901.
#
# Report bugs to <Alistair Crooks <[email protected]> c0596823>.
#
@@ -751,8 +751,8 @@
# Identity of this package.
PACKAGE_NAME='netpgp'
PACKAGE_TARNAME='netpgp'
-PACKAGE_VERSION='20100707'
-PACKAGE_STRING='netpgp 20100707'
+PACKAGE_VERSION='20100901'
+PACKAGE_STRING='netpgp 20100901'
PACKAGE_BUGREPORT='Alistair Crooks <[email protected]> c0596823'
ac_unique_file="src/netpgp/netpgp.c"
@@ -795,6 +795,10 @@
ac_subst_vars='LTLIBOBJS
LIBOBJS
AUTOM4TE
+OPENSSL_LDFLAGS
+OPENSSL_LIBS
+OPENSSL_INCLUDES
+PKG_CONFIG
WARNCFLAGS
LIBTOOL
ac_ct_F77
@@ -915,6 +919,7 @@
enable_libtool_lock
with_pic
with_tags
+with_openssl
'
ac_precious_vars='build_alias
host_alias
@@ -1483,7 +1488,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 20100707 to adapt to many kinds of systems.
+\`configure' configures netpgp 20100901 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1553,7 +1558,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of netpgp 20100707:";;
+ short | recursive ) echo "Configuration of netpgp 20100901:";;
esac
cat <<\_ACEOF
@@ -1578,6 +1583,7 @@
--with-pic try to use only PIC/non-PIC objects [default=use
both]
--with-tags[=TAGS] include additional configurations [automatic]
+ --with-openssl=DIR root of the OpenSSL directory
Some influential environment variables:
CC C compiler command
@@ -1660,7 +1666,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-netpgp configure 20100707
+netpgp configure 20100901
generated by GNU Autoconf 2.63
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1674,7 +1680,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 20100707, which was
+It was created by netpgp $as_me 20100901, which was
generated by GNU Autoconf 2.63. Invocation command line was
$ $0 $@
@@ -2561,7 +2567,7 @@
# Define the identity of the package.
PACKAGE='netpgp'
- VERSION='20100707'
+ VERSION='20100901'
cat >>confdefs.h <<_ACEOF
@@ -4780,7 +4786,7 @@
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 4783 "configure"' > conftest.$ac_ext
+ echo '#line 4789 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -7554,11 +7560,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:7557: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:7563: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:7561: \$? = $ac_status" >&5
+ echo "$as_me:7567: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -7844,11 +7850,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:7847: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:7853: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:7851: \$? = $ac_status" >&5
+ echo "$as_me:7857: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -7948,11 +7954,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:7951: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:7957: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:7955: \$? = $ac_status" >&5
+ echo "$as_me:7961: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -10333,7 +10339,7 @@
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 10336 "configure"
+#line 10342 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -10433,7 +10439,7 @@
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 10436 "configure"
+#line 10442 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -12861,11 +12867,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:12864: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:12870: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:12868: \$? = $ac_status" >&5
+ echo "$as_me:12874: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -12965,11 +12971,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:12968: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:12974: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:12972: \$? = $ac_status" >&5
+ echo "$as_me:12978: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -14527,11 +14533,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14530: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:14536: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:14534: \$? = $ac_status" >&5
+ echo "$as_me:14540: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -14631,11 +14637,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14634: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:14640: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:14638: \$? = $ac_status" >&5
+ echo "$as_me:14644: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -16826,11 +16832,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:16829: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:16835: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:16833: \$? = $ac_status" >&5
+ echo "$as_me:16839: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -17116,11 +17122,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:17119: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:17125: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:17123: \$? = $ac_status" >&5
+ echo "$as_me:17129: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -17220,11 +17226,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:17223: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:17229: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:17227: \$? = $ac_status" >&5
+ echo "$as_me:17233: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -19908,6 +19914,95 @@
+# try to see if we need to link with -ldl
+{ $as_echo "$as_me:$LINENO: checking for library containing dlopen" >&5
+$as_echo_n "checking for library containing dlopen... " >&6; }
+if test "${ac_cv_search_dlopen+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' dl; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ ac_cv_search_dlopen=$ac_res
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext
+ if test "${ac_cv_search_dlopen+set}" = set; then
+ break
+fi
+done
+if test "${ac_cv_search_dlopen+set}" = set; then
+ :
+else
+ ac_cv_search_dlopen=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_dlopen" >&5
+$as_echo "$ac_cv_search_dlopen" >&6; }
+ac_res=$ac_cv_search_dlopen
+if test "$ac_res" != no; then
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+
# Checks for header files.
#
{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5
@@ -21446,6 +21541,250 @@
esac
+# check for openssl
+# ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_check_openssl.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_OPENSSL([action-if-found[, action-if-not-found]])
+#
+# DESCRIPTION
+#
+# Look for OpenSSL in a number of default spots, or in a user-selected
+# spot (via --with-openssl). Sets
+#
+# OPENSSL_INCLUDES to the include directives required
+# OPENSSL_LIBS to the -l directives required
+# OPENSSL_LDFLAGS to the -L or -R flags required
+#
+# and calls ACTION-IF-FOUND or ACTION-IF-NOT-FOUND appropriately
+#
+# This macro sets OPENSSL_INCLUDES such that source files should use the
+# openssl/ directory in include directives:
+#
+# #include <openssl/hmac.h>
+#
+# LICENSE
+#
+# Copyright (c) 2009 Zmanda Inc. <http://www.zmanda.com/>
+# Copyright (c) 2009 Dustin J. Mitchell <[email protected]>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved. This file is offered as-is, without any
+# warranty.
+
+#serial 5
+
+# This is what autoupdate's m4 run will expand. It fires
+# the warning (with _au_warn_XXX), outputs it into the
+# updated configure.ac (with AC_DIAGNOSE), and then outputs
+# the replacement expansion.
+
+
+# This is an auxiliary macro that is also run when
+# autoupdate runs m4. It simply calls m4_warning, but
+# we need a wrapper so that each warning is emitted only
+# once. We break the quoting in m4_warning's argument in
+# order to expand this macro's arguments, not AU_DEFUN's.
+
+
+# Finally, this is the expansion that is picked up by
+# autoconf. It tells the user to run autoupdate, and
+# then outputs the replacement expansion. We do not care
+# about autoupdate's warning because that contains
+# information on what to do *after* running autoupdate.
+
+
+
+
+
+ found=false
+
+# Check whether --with-openssl was given.
+if test "${with_openssl+set}" = set; then
+ withval=$with_openssl;
+ case "$withval" in
+ "" | y | ye | yes | n | no)
+ { { $as_echo "$as_me:$LINENO: error: Invalid --with-openssl value" >&5
+$as_echo "$as_me: error: Invalid --with-openssl value" >&2;}
+ { (exit 1); exit 1; }; }
+ ;;
+ *) ssldirs="$withval"
+ ;;
+ esac
+
+else
+
+ # if pkg-config is installed and openssl has installed a .pc file,
+ # then use that information and don't search ssldirs
+ # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ case $PKG_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+ { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ if test x"$PKG_CONFIG" != x""; then
+ OPENSSL_LDFLAGS=`$PKG_CONFIG openssl --libs-only-L 2>/dev/null`
+ if test $? = 0; then
+ OPENSSL_LIBS=`$PKG_CONFIG openssl --libs-only-l 2>/dev/null`
+ OPENSSL_INCLUDES=`$PKG_CONFIG openssl --cflags-only-I 2>/dev/null`
+ found=true
+ fi
+ fi
+
+ # no such luck; use some default ssldirs
+ if ! $found; then
+ ssldirs="/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr"
+ fi
+
+
+fi
+
+
+
+ # note that we #include <openssl/foo.h>, so the OpenSSL headers have to be in
+ # an 'openssl' subdirectory
+
+ if ! $found; then
+ OPENSSL_INCLUDES=
+ for ssldir in $ssldirs; do
+ { $as_echo "$as_me:$LINENO: checking for openssl/ssl.h in $ssldir" >&5
+$as_echo_n "checking for openssl/ssl.h in $ssldir... " >&6; }
+ if test -f "$ssldir/include/openssl/ssl.h"; then
+ OPENSSL_INCLUDES="-I$ssldir/include"
+ OPENSSL_LDFLAGS="-L$ssldir/lib"
+ OPENSSL_LIBS="-lssl -lcrypto"
+ found=true
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+ break
+ else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ fi
+ done
+
+ # if the file wasn't found, well, go ahead and try the link anyway -- maybe
+ # it will just work!
+ fi
+
+ # try the preprocessor and linker with our new flags,
+ # being careful not to pollute the global LIBS, LDFLAGS, and CPPFLAGS
+
+ { $as_echo "$as_me:$LINENO: checking whether compiling and linking against OpenSSL works" >&5
+$as_echo_n "checking whether compiling and linking against OpenSSL works... " >&6; }
+ echo "Trying link with OPENSSL_LDFLAGS=$OPENSSL_LDFLAGS;" \
+ "OPENSSL_LIBS=$OPENSSL_LIBS; OPENSSL_INCLUDES=$OPENSSL_INCLUDES" >&5
+
+ save_LIBS="$LIBS"
+ save_LDFLAGS="$LDFLAGS"
+ save_CPPFLAGS="$CPPFLAGS"
+ LDFLAGS="$LDFLAGS $OPENSSL_LDFLAGS"
+ LIBS="$OPENSSL_LIBS $LIBS"
+ CPPFLAGS="$OPENSSL_INCLUDES $CPPFLAGS"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <openssl/ssl.h>
+int
+main ()
+{
+SSL_new(NULL)
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+ LIBS="$LIBS $OPENSSL_LIBS" INCLUDES="$INCLUDES $OPENSSL_INCLUDES"
+
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ { { $as_echo "$as_me:$LINENO: error: Missing OpenSSL" >&5
+$as_echo "$as_me: error: Missing OpenSSL" >&2;}
+ { (exit 1); exit 1; }; }
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+
+
+
+
+
+
{ $as_echo "$as_me:$LINENO: checking for SHA256_CTX" >&5
$as_echo_n "checking for SHA256_CTX... " >&6; }
if test "${ac_cv_type_SHA256_CTX+set}" = set; then
@@ -22306,7 +22645,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 20100707, which was
+This file was extended by netpgp $as_me 20100901, which was
generated by GNU Autoconf 2.63. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -22369,7 +22708,7 @@
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_version="\\
-netpgp config.status 20100707
+netpgp config.status 20100901
configured by $0, generated by GNU Autoconf 2.63,
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
Index: src/crypto/external/bsd/netpgp/dist/configure.ac
diff -u src/crypto/external/bsd/netpgp/dist/configure.ac:1.34 src/crypto/external/bsd/netpgp/dist/configure.ac:1.35
--- src/crypto/external/bsd/netpgp/dist/configure.ac:1.34 Fri Aug 6 06:58:53 2010
+++ src/crypto/external/bsd/netpgp/dist/configure.ac Thu Sep 2 06:00:11 2010
@@ -1,10 +1,10 @@
-# $NetBSD: configure.ac,v 1.34 2010/08/06 06:58:53 agc Exp $
+# $NetBSD: configure.ac,v 1.35 2010/09/02 06:00:11 agc Exp $
#
# Process this file with autoconf to produce a configure script.
-AC_INIT([netpgp],[20100710],[Alistair Crooks <[email protected]> c0596823])
+AC_INIT([netpgp],[20100901],[Alistair Crooks <[email protected]> c0596823])
AC_PREREQ(2.63)
-AC_REVISION([$Revision: 1.34 $])
+AC_REVISION([$Revision: 1.35 $])
AS_SHELL_SANITIZE
Index: src/crypto/external/bsd/netpgp/dist/include/netpgp.h
diff -u src/crypto/external/bsd/netpgp/dist/include/netpgp.h:1.19 src/crypto/external/bsd/netpgp/dist/include/netpgp.h:1.20
--- src/crypto/external/bsd/netpgp/dist/include/netpgp.h:1.19 Sat Aug 7 04:16:40 2010
+++ src/crypto/external/bsd/netpgp/dist/include/netpgp.h Thu Sep 2 06:00:11 2010
@@ -97,6 +97,7 @@
int netpgp_match_keys_json(netpgp_t *, char **, char *, const char *, const int);
int netpgp_match_keys(netpgp_t *, char *, const char *, void *, const int);
int netpgp_match_pubkeys(netpgp_t *, char *, void *);
+int netpgp_format_json(void *, const char *, const int);
int netpgp_validate_sigs(netpgp_t *);
Index: src/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c
diff -u src/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c:1.71 src/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c:1.72
--- src/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c:1.71 Wed Sep 1 17:25:57 2010
+++ src/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c Thu Sep 2 06:00:12 2010
@@ -34,7 +34,7 @@
#if defined(__NetBSD__)
__COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: netpgp.c,v 1.71 2010/09/01 17:25:57 agc Exp $");
+__RCSID("$NetBSD: netpgp.c,v 1.72 2010/09/02 06:00:12 agc Exp $");
#endif
#include <sys/types.h>
@@ -469,6 +469,153 @@
return armoured;
}
+/* vararg print function */
+static void
+p(FILE *fp, const char *s, ...)
+{
+ va_list args;
+
+ va_start(args, s);
+ while (s != NULL) {
+ (void) fprintf(fp, "%s", s);
+ s = va_arg(args, char *);
+ }
+ va_end(args);
+}
+
+/* print a JSON object to the FILE stream */
+static void
+pobj(FILE *fp, mj_t *obj, int depth)
+{
+ unsigned i;
+
+ if (obj == NULL) {
+ (void) fprintf(stderr, "No object found\n");
+ return;
+ }
+ for (i = 0 ; i < (unsigned)depth ; i++) {
+ p(fp, " ", NULL);
+ }
+ switch(obj->type) {
+ case MJ_NULL:
+ case MJ_FALSE:
+ case MJ_TRUE:
+ p(fp, (obj->type == MJ_NULL) ? "null" : (obj->type == MJ_FALSE) ? "false" : "true", NULL);
+ break;
+ case MJ_NUMBER:
+ p(fp, obj->value.s, NULL);
+ break;
+ case MJ_STRING:
+ (void) fprintf(fp, "%.*s", (int)(obj->c), obj->value.s);
+ break;
+ case MJ_ARRAY:
+ for (i = 0 ; i < obj->c ; i++) {
+ pobj(fp, &obj->value.v[i], depth + 1);
+ if (i < obj->c - 1) {
+ (void) fprintf(fp, ", ");
+ }
+ }
+ (void) fprintf(fp, "\n");
+ break;
+ case MJ_OBJECT:
+ for (i = 0 ; i < obj->c ; i += 2) {
+ pobj(fp, &obj->value.v[i], depth + 1);
+ p(fp, ": ", NULL);
+ pobj(fp, &obj->value.v[i + 1], 0);
+ if (i < obj->c - 1) {
+ p(fp, ", ", NULL);
+ }
+ }
+ p(fp, "\n", NULL);
+ break;
+ default:
+ break;
+ }
+}
+
+/* return the time as a string */
+static char *
+ptimestr(char *dest, size_t size, time_t t)
+{
+ struct tm *tm;
+
+ tm = gmtime(&t);
+ (void) snprintf(dest, size, "%04d-%02d-%02d",
+ tm->tm_year + 1900,
+ tm->tm_mon + 1,
+ tm->tm_mday);
+ return dest;
+}
+
+/* format a JSON object */
+static void
+format_json_key(FILE *fp, mj_t *obj, const int psigs)
+{
+ int64_t birthtime;
+ int64_t duration;
+ time_t now;
+ char tbuf[32];
+ char *s;
+ mj_t *sub;
+ int i;
+
+ if (__ops_get_debug_level(__FILE__)) {
+ mj_asprint(&s, obj);
+ (void) fprintf(stderr, "formatobj: json is '%s'\n", s);
+ free(s);
+ }
+ pobj(fp, &obj->value.v[mj_object_find(obj, "header", 0, 2) + 1], 0);
+ p(fp, " ", NULL);
+ pobj(fp, &obj->value.v[mj_object_find(obj, "key bits", 0, 2) + 1], 0);
+ p(fp, "/", NULL);
+ pobj(fp, &obj->value.v[mj_object_find(obj, "pka", 0, 2) + 1], 0);
+ p(fp, " ", NULL);
+ pobj(fp, &obj->value.v[mj_object_find(obj, "key id", 0, 2) + 1], 0);
+ birthtime = strtoll(obj->value.v[mj_object_find(obj, "birthtime", 0, 2) + 1].value.s, NULL, 10);
+ p(fp, " ", ptimestr(tbuf, sizeof(tbuf), birthtime), NULL);
+ duration = strtoll(obj->value.v[mj_object_find(obj, "duration", 0, 2) + 1].value.s, NULL, 10);
+ if (duration > 0) {
+ now = time(NULL);
+ p(fp, " ", (birthtime + duration < now) ? "[EXPIRED " : "[EXPIRES ",
+ ptimestr(tbuf, sizeof(tbuf), birthtime + duration), "]", NULL);
+ }
+ p(fp, "\n", "Key fingerprint: ", NULL);
+ pobj(fp, &obj->value.v[mj_object_find(obj, "fingerprint", 0, 2) + 1], 0);
+ p(fp, "\n", NULL);
+ /* go to field after \"duration\" */
+ for (i = mj_object_find(obj, "duration", 0, 2) + 2; i < mj_arraycount(obj) ; i += 2) {
+ if (strcmp(obj->value.v[i].value.s, "uid") == 0) {
+ sub = &obj->value.v[i + 1];
+ p(fp, "uid", NULL);
+ pobj(fp, &sub->value.v[0], (psigs) ? 4 : 14); /* human name */
+ pobj(fp, &sub->value.v[1], 1); /* any revocation */
+ p(fp, "\n", NULL);
+ } else if (strcmp(obj->value.v[i].value.s, "encryption") == 0) {
+ sub = &obj->value.v[i + 1];
+ p(fp, "encryption", NULL);
+ pobj(fp, &sub->value.v[0], 1); /* size */
+ p(fp, "/", NULL);
+ pobj(fp, &sub->value.v[1], 0); /* alg */
+ p(fp, " ", NULL);
+ pobj(fp, &sub->value.v[2], 0); /* id */
+ p(fp, " ", ptimestr(tbuf, sizeof(tbuf), strtoll(sub->value.v[3].value.s, NULL, 10)),
+ "\n", NULL);
+ } else if (strcmp(obj->value.v[i].value.s, "sig") == 0) {
+ sub = &obj->value.v[i + 1];
+ p(fp, "sig", NULL);
+ pobj(fp, &sub->value.v[0], 8); /* size */
+ p(fp, " ", ptimestr(tbuf, sizeof(tbuf), strtoll(sub->value.v[1].value.s, NULL, 10)),
+ " ", NULL); /* time */
+ pobj(fp, &sub->value.v[2], 0); /* human name */
+ p(fp, "\n", NULL);
+ } else {
+ fprintf(stderr, "weird '%s'\n", obj->value.v[i].value.s);
+ pobj(fp, &obj->value.v[i], 0); /* human name */
+ }
+ }
+ p(fp, "\n", NULL);
+}
+
/***************************************************************************/
/* exported functions start here */
/***************************************************************************/
@@ -1481,3 +1628,35 @@
return (int)__ops_validate_all_sigs(&result, netpgp->pubring, NULL);
}
+
+/* print the json out on 'fp' */
+int
+netpgp_format_json(void *vp, const char *json, const int psigs)
+{
+ mj_t ids;
+ FILE *fp;
+ int from;
+ int idc;
+ int tok;
+ int to;
+ int i;
+
+ if ((fp = (FILE *)vp) == NULL || json == NULL) {
+ return 0;
+ }
+ /* ids is an array of strings, each containing 1 entry */
+ (void) memset(&ids, 0x0, sizeof(ids));
+ from = to = tok = 0;
+ /* convert from string into an mj structure */
+ (void) mj_parse(&ids, json, &from, &to, &tok);
+ if ((idc = mj_arraycount(&ids)) == 1 && strchr(json, '{') == NULL) {
+ idc = 0;
+ }
+ (void) fprintf(fp, "%d key%s found\n", idc, (idc == 1) ? "" : "s");
+ for (i = 0 ; i < idc ; i++) {
+ format_json_key(fp, &ids.value.v[i], psigs);
+ }
+ /* clean up */
+ mj_delete(&ids);
+ return idc;
+}
Index: src/crypto/external/bsd/netpgp/dist/src/lib/version.h
diff -u src/crypto/external/bsd/netpgp/dist/src/lib/version.h:1.40 src/crypto/external/bsd/netpgp/dist/src/lib/version.h:1.41
--- src/crypto/external/bsd/netpgp/dist/src/lib/version.h:1.40 Wed Sep 1 19:46:14 2010
+++ src/crypto/external/bsd/netpgp/dist/src/lib/version.h Thu Sep 2 06:00:12 2010
@@ -58,7 +58,7 @@
#endif
/* development versions have .99 suffix */
-#define NETPGP_BASE_VERSION "3.99.10"
+#define NETPGP_BASE_VERSION "3.99.11"
#define NETPGP_VERSION_CAT(a, b) "NetPGP portable " a "/[" b "]"
#define NETPGP_VERSION_STRING \
Index: src/crypto/external/bsd/netpgp/dist/src/netpgp/Makefile
diff -u src/crypto/external/bsd/netpgp/dist/src/netpgp/Makefile:1.17 src/crypto/external/bsd/netpgp/dist/src/netpgp/Makefile:1.18
--- src/crypto/external/bsd/netpgp/dist/src/netpgp/Makefile:1.17 Sat Aug 7 04:16:40 2010
+++ src/crypto/external/bsd/netpgp/dist/src/netpgp/Makefile Thu Sep 2 06:00:12 2010
@@ -37,7 +37,8 @@
DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__aclocal_m4_deps = $(top_srcdir)/ax_check_openssl.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -76,13 +77,13 @@
AUTOHEADER = ${SHELL} /usr/src/crypto/external/bsd/netpgp/dist/buildaux/missing --run autoheader
AUTOM4TE = ${SHELL} /usr/src/crypto/external/bsd/netpgp/dist/buildaux/missing --run autom4te
AUTOMAKE = ${SHELL} /usr/src/crypto/external/bsd/netpgp/dist/buildaux/missing --run automake-1.10
-AWK = mawk
+AWK = gawk
CANONICAL_HOST = i386-unknown-netbsdelf5.99.26
CC = gcc
CCDEPMODE = depmode=gcc3
-CFLAGS = -g -O2
+CFLAGS = -g -O2 -I/usr/include
CPP = gcc -E
-CPPFLAGS =
+CPPFLAGS = -I/usr/include
CXX = g++
CXXCPP = g++ -E
CXXDEPMODE = depmode=gcc3
@@ -90,6 +91,8 @@
CYGPATH_W = echo
DEFS = -DHAVE_CONFIG_H
DEPDIR = .deps
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
ECHO = /bin/echo
ECHO_C =
ECHO_N = -n
@@ -98,35 +101,47 @@
EXEEXT =
F77 =
FFLAGS =
+FGREP = @FGREP@
GREP = /usr/bin/grep
INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
INSTALL_SCRIPT = ${INSTALL}
INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
-LDFLAGS =
+LD = @LD@
+LDFLAGS = -L/usr/lib
LIBOBJS =
-LIBS = -lcrypto -lbz2 -lz
+LIBS = -lcrypto -lbz2 -lz -lssl -lcrypto
LIBTOOL = $(SHELL) $(top_builddir)/libtool
+LIPO = @LIPO@
LN_S = ln -s
LTLIBOBJS =
MAINT = #
MAKEINFO = ${SHELL} /usr/src/crypto/external/bsd/netpgp/dist/buildaux/missing --run makeinfo
MKDIR_P = ../../buildaux/install-sh -c -d
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
OBJEXT = o
+OPENSSL_INCLUDES = -I/usr/include
+OPENSSL_LDFLAGS = -L/usr/lib
+OPENSSL_LIBS = -lssl -lcrypto
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
PACKAGE = netpgp
PACKAGE_BUGREPORT = Alistair Crooks <[email protected]> c0596823
PACKAGE_NAME = netpgp
-PACKAGE_STRING = netpgp 20100708
+PACKAGE_STRING = netpgp 20100901
PACKAGE_TARNAME = netpgp
-PACKAGE_VERSION = 20100708
+PACKAGE_VERSION = 20100901
PATH_SEPARATOR = :
+PKG_CONFIG = /usr/pkg/bin/pkg-config
RANLIB = ranlib
SED = /usr/bin/sed
SET_MAKE =
SHELL = /bin/ksh
STRIP = strip
-VERSION = 20100708
+VERSION = 20100901
WARNCFLAGS = -Werror -Wall -Wpointer-arith
abs_builddir = /usr/src/crypto/external/bsd/netpgp/dist/src/netpgp
abs_srcdir = /usr/src/crypto/external/bsd/netpgp/dist/src/netpgp
@@ -134,6 +149,7 @@
abs_top_srcdir = /usr/src/crypto/external/bsd/netpgp/dist
ac_ct_CC = gcc
ac_ct_CXX = g++
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
ac_ct_F77 =
am__include = include
am__leading_dot = .
@@ -165,11 +181,12 @@
libexecdir = ${exec_prefix}/libexec
localedir = ${datarootdir}/locale
localstatedir = ${prefix}/var
+lt_ECHO = @lt_ECHO@
mandir = ${datarootdir}/man
mkdir_p = $(top_builddir)/buildaux/install-sh -c -d
oldincludedir = /usr/include
pdfdir = ${docdir}
-prefix = /usr/pkg
+prefix = /usr/local
program_transform_name = s,x,x,
psdir = ${docdir}
sbindir = ${exec_prefix}/sbin
Index: src/crypto/external/bsd/netpgp/dist/src/netpgpkeys/netpgpkeys.c
diff -u src/crypto/external/bsd/netpgp/dist/src/netpgpkeys/netpgpkeys.c:1.17 src/crypto/external/bsd/netpgp/dist/src/netpgpkeys/netpgpkeys.c:1.18
--- src/crypto/external/bsd/netpgp/dist/src/netpgpkeys/netpgpkeys.c:1.17 Wed Sep 1 06:18:21 2010
+++ src/crypto/external/bsd/netpgp/dist/src/netpgpkeys/netpgpkeys.c Thu Sep 2 06:00:12 2010
@@ -159,165 +159,12 @@
progname, progname, usagemsg);
}
-/* vararg print function */
-static void
-p(FILE *fp, char *s, ...)
-{
- va_list args;
-
- va_start(args, s);
- while (s != NULL) {
- (void) fprintf(fp, "%s", s);
- s = va_arg(args, char *);
- }
- va_end(args);
-}
-
-/* print a JSON object to the FILE stream */
-static void
-pobj(FILE *fp, mj_t *obj, int depth)
-{
- int i;
-
- if (obj == NULL) {
- (void) fprintf(stderr, "No object found\n");
- return;
- }
- for (i = 0 ; i < depth ; i++) {
- p(fp, " ", NULL);
- }
- switch(obj->type) {
- case MJ_NULL:
- case MJ_FALSE:
- case MJ_TRUE:
- p(fp, (obj->type == MJ_NULL) ? "null" : (obj->type == MJ_FALSE) ? "false" : "true", NULL);
- break;
- case MJ_NUMBER:
- p(fp, obj->value.s, NULL);
- break;
- case MJ_STRING:
- (void) fprintf(fp, "%.*s", (int)(obj->c), obj->value.s);
- break;
- case MJ_ARRAY:
- for (i = 0 ; i < obj->c ; i++) {
- pobj(fp, &obj->value.v[i], depth + 1);
- if (i < obj->c - 1) {
- (void) fprintf(fp, ", ");
- }
- }
- (void) fprintf(fp, "\n");
- break;
- case MJ_OBJECT:
- for (i = 0 ; i < obj->c ; i += 2) {
- pobj(fp, &obj->value.v[i], depth + 1);
- p(fp, ": ", NULL);
- pobj(fp, &obj->value.v[i + 1], 0);
- if (i < obj->c - 1) {
- p(fp, ", ", NULL);
- }
- }
- p(fp, "\n", NULL);
- break;
- default:
- break;
- }
-}
-
-/* return the time as a string */
-static char *
-ptimestr(char *dest, size_t size, time_t t)
-{
- struct tm *tm;
-
- tm = gmtime(&t);
- (void) snprintf(dest, size, "%04d-%02d-%02d",
- tm->tm_year + 1900,
- tm->tm_mon + 1,
- tm->tm_mday);
- return dest;
-}
-
-/* format a JSON object */
-static void
-formatobj(FILE *fp, mj_t *obj, const int psigs)
-{
- int64_t birthtime;
- int64_t duration;
- time_t now;
- char tbuf[32];
- char *s;
- mj_t *sub;
- int r;
- int i;
-
- if (__ops_get_debug_level(__FILE__)) {
- mj_asprint(&s, obj);
- (void) fprintf(stderr, "formatobj: json is '%s'\n", s);
- free(s);
- }
- pobj(fp, &obj->value.v[mj_object_find(obj, "header", 0, 2) + 1], 0);
- p(fp, " ", NULL);
- pobj(fp, &obj->value.v[mj_object_find(obj, "key bits", 0, 2) + 1], 0);
- p(fp, "/", NULL);
- pobj(fp, &obj->value.v[mj_object_find(obj, "pka", 0, 2) + 1], 0);
- p(fp, " ", NULL);
- pobj(fp, &obj->value.v[mj_object_find(obj, "key id", 0, 2) + 1], 0);
- birthtime = strtoll(obj->value.v[mj_object_find(obj, "birthtime", 0, 2) + 1].value.s, NULL, 10);
- p(fp, " ", ptimestr(tbuf, sizeof(tbuf), birthtime), NULL);
- duration = strtoll(obj->value.v[mj_object_find(obj, "duration", 0, 2) + 1].value.s, NULL, 10);
- if (duration > 0) {
- now = time(NULL);
- p(fp, " ", (birthtime + duration < now) ? "[EXPIRED " : "[EXPIRES ",
- ptimestr(tbuf, sizeof(tbuf), birthtime + duration), "]", NULL);
- }
- p(fp, "\n", "Key fingerprint: ", NULL);
- pobj(fp, &obj->value.v[mj_object_find(obj, "fingerprint", 0, 2) + 1], 0);
- p(fp, "\n", NULL);
- /* go to field after \"duration\" */
- for (i = mj_object_find(obj, "duration", 0, 2) + 2; i < mj_arraycount(obj) ; i += 2) {
- if (strcmp(obj->value.v[i].value.s, "uid") == 0) {
- sub = &obj->value.v[i + 1];
- p(fp, "uid", NULL);
- pobj(fp, &sub->value.v[0], (psigs) ? 4 : 14); /* human name */
- pobj(fp, &sub->value.v[1], 1); /* any revocation */
- p(fp, "\n", NULL);
- } else if (strcmp(obj->value.v[i].value.s, "encryption") == 0) {
- sub = &obj->value.v[i + 1];
- p(fp, "encryption", NULL);
- pobj(fp, &sub->value.v[0], 1); /* size */
- p(fp, "/", NULL);
- pobj(fp, &sub->value.v[1], 0); /* alg */
- p(fp, " ", NULL);
- pobj(fp, &sub->value.v[2], 0); /* id */
- p(fp, " ", ptimestr(tbuf, sizeof(tbuf), strtoll(sub->value.v[3].value.s, NULL, 10)),
- "\n", NULL);
- } else if (strcmp(obj->value.v[i].value.s, "sig") == 0) {
- sub = &obj->value.v[i + 1];
- p(fp, "sig", NULL);
- pobj(fp, &sub->value.v[0], 8); /* size */
- p(fp, " ", ptimestr(tbuf, sizeof(tbuf), strtoll(sub->value.v[1].value.s, NULL, 10)),
- " ", NULL); /* time */
- pobj(fp, &sub->value.v[2], 0); /* human name */
- p(fp, "\n", NULL);
- } else {
- fprintf(stderr, "weird '%s'\n", obj->value.v[i].value.s);
- pobj(fp, &obj->value.v[i], 0); /* human name */
- }
- }
- p(fp, "\n", NULL);
-}
-
/* match keys, decoding from json if we do find any */
static int
match_keys(netpgp_t *netpgp, FILE *fp, char *f, const int psigs)
{
char *json;
- mj_t ids;
- int from;
int idc;
- int tok;
- int to;
- int i;
if (f == NULL) {
if (!netpgp_list_keys_json(netpgp, &json, psigs)) {
@@ -331,21 +178,9 @@
if (__ops_get_debug_level(__FILE__)) {
(void) fprintf(stderr, "match_keys: json is '%s'\n", json);
}
- /* ids is an array of strings, each containing 1 entry */
- (void) memset(&ids, 0x0, sizeof(ids));
- from = to = tok = 0;
- /* convert from string into an mj structure */
- (void) mj_parse(&ids, json, &from, &to, &tok);
- if ((idc = mj_arraycount(&ids)) == 1 && strchr(json, '{') == NULL) {
- idc = 0;
- }
- (void) fprintf(fp, "%d key%s found\n", idc, (idc == 1) ? "" : "s");
- for (i = 0 ; i < idc ; i++) {
- formatobj(fp, &ids.value.v[i], psigs);
- }
+ idc = netpgp_format_json(fp, json, psigs);
/* clean up */
free(json);
- mj_delete(&ids);
return idc;
}
Index: src/crypto/external/bsd/netpgp/dist/src/netpgpverify/Makefile
diff -u src/crypto/external/bsd/netpgp/dist/src/netpgpverify/Makefile:1.16 src/crypto/external/bsd/netpgp/dist/src/netpgpverify/Makefile:1.17
--- src/crypto/external/bsd/netpgp/dist/src/netpgpverify/Makefile:1.16 Sat Aug 7 04:16:41 2010
+++ src/crypto/external/bsd/netpgp/dist/src/netpgpverify/Makefile Thu Sep 2 06:00:12 2010
@@ -37,7 +37,8 @@
DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__aclocal_m4_deps = $(top_srcdir)/ax_check_openssl.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -77,13 +78,13 @@
AUTOHEADER = ${SHELL} /usr/src/crypto/external/bsd/netpgp/dist/buildaux/missing --run autoheader
AUTOM4TE = ${SHELL} /usr/src/crypto/external/bsd/netpgp/dist/buildaux/missing --run autom4te
AUTOMAKE = ${SHELL} /usr/src/crypto/external/bsd/netpgp/dist/buildaux/missing --run automake-1.10
-AWK = mawk
+AWK = gawk
CANONICAL_HOST = i386-unknown-netbsdelf5.99.26
CC = gcc
CCDEPMODE = depmode=gcc3
-CFLAGS = -g -O2
+CFLAGS = -g -O2 -I/usr/include
CPP = gcc -E
-CPPFLAGS =
+CPPFLAGS = -I/usr/include
CXX = g++
CXXCPP = g++ -E
CXXDEPMODE = depmode=gcc3
@@ -91,6 +92,8 @@
CYGPATH_W = echo
DEFS = -DHAVE_CONFIG_H
DEPDIR = .deps
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
ECHO = /bin/echo
ECHO_C =
ECHO_N = -n
@@ -99,35 +102,47 @@
EXEEXT =
F77 =
FFLAGS =
+FGREP = @FGREP@
GREP = /usr/bin/grep
INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
INSTALL_SCRIPT = ${INSTALL}
INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
-LDFLAGS =
+LD = @LD@
+LDFLAGS = -L/usr/lib
LIBOBJS =
-LIBS = -lcrypto -lbz2 -lz
+LIBS = -lcrypto -lbz2 -lz -lssl -lcrypto
LIBTOOL = $(SHELL) $(top_builddir)/libtool
+LIPO = @LIPO@
LN_S = ln -s
LTLIBOBJS =
MAINT = #
MAKEINFO = ${SHELL} /usr/src/crypto/external/bsd/netpgp/dist/buildaux/missing --run makeinfo
MKDIR_P = ../../buildaux/install-sh -c -d
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
OBJEXT = o
+OPENSSL_INCLUDES = -I/usr/include
+OPENSSL_LDFLAGS = -L/usr/lib
+OPENSSL_LIBS = -lssl -lcrypto
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
PACKAGE = netpgp
PACKAGE_BUGREPORT = Alistair Crooks <[email protected]> c0596823
PACKAGE_NAME = netpgp
-PACKAGE_STRING = netpgp 20100708
+PACKAGE_STRING = netpgp 20100901
PACKAGE_TARNAME = netpgp
-PACKAGE_VERSION = 20100708
+PACKAGE_VERSION = 20100901
PATH_SEPARATOR = :
+PKG_CONFIG = /usr/pkg/bin/pkg-config
RANLIB = ranlib
SED = /usr/bin/sed
SET_MAKE =
SHELL = /bin/ksh
STRIP = strip
-VERSION = 20100708
+VERSION = 20100901
WARNCFLAGS = -Werror -Wall -Wpointer-arith
abs_builddir = /usr/src/crypto/external/bsd/netpgp/dist/src/netpgpverify
abs_srcdir = /usr/src/crypto/external/bsd/netpgp/dist/src/netpgpverify
@@ -135,6 +150,7 @@
abs_top_srcdir = /usr/src/crypto/external/bsd/netpgp/dist
ac_ct_CC = gcc
ac_ct_CXX = g++
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
ac_ct_F77 =
am__include = include
am__leading_dot = .
@@ -166,11 +182,12 @@
libexecdir = ${exec_prefix}/libexec
localedir = ${datarootdir}/locale
localstatedir = ${prefix}/var
+lt_ECHO = @lt_ECHO@
mandir = ${datarootdir}/man
mkdir_p = $(top_builddir)/buildaux/install-sh -c -d
oldincludedir = /usr/include
pdfdir = ${docdir}
-prefix = /usr/pkg
+prefix = /usr/local
program_transform_name = s,x,x,
psdir = ${docdir}
sbindir = ${exec_prefix}/sbin
@@ -184,6 +201,7 @@
AM_CFLAGS = $(WARNCFLAGS)
netpgpverify_SOURCES = verify.c
netpgpverify_CPPFLAGS = -I$(top_srcdir)/include
+netpgpverify_LDADD = ../lib/libnetpgp.la
man1_MANS = netpgpverify.1
dist_man_MANS = netpgpverify.1
all: all-am
Index: src/crypto/external/bsd/netpgp/netpgpkeys/Makefile
diff -u src/crypto/external/bsd/netpgp/netpgpkeys/Makefile:1.2 src/crypto/external/bsd/netpgp/netpgpkeys/Makefile:1.3
--- src/crypto/external/bsd/netpgp/netpgpkeys/Makefile:1.2 Sat Aug 7 04:18:54 2010
+++ src/crypto/external/bsd/netpgp/netpgpkeys/Makefile Thu Sep 2 06:00:12 2010
@@ -1,12 +1,11 @@
-# $NetBSD: Makefile,v 1.2 2010/08/07 04:18:54 agc Exp $
+# $NetBSD: Makefile,v 1.3 2010/09/02 06:00:12 agc Exp $
.include <bsd.own.mk>
PROG= netpgpkeys
+SRCS= netpgpkeys.c
BINDIR= /usr/bin
-CPPFLAGS+= -I${.CURDIR}/../dist/include
-
LIBNETPGPDIR!= cd ${.CURDIR}/../lib && ${PRINTOBJDIR}
LDADD+= -L${LIBNETPGPDIR} -lnetpgp
DPADD+= ${LIBNETPGPDIR}/libnetpgp.a