Browse Source

Stripped unused netpgp files

master
Edouard Tisserant 6 years ago
parent
commit
d8e88d6432
212 changed files with 8 additions and 105654 deletions
  1. +7
    -124
      .hgignore
  2. +0
    -7
      Makefile
  3. +0
    -3
      Makefile.inc
  4. +0
    -9
      bin/Makefile
  5. +0
    -25
      bin/hkpc/Makefile
  6. +0
    -32
      bin/hkpd/Makefile
  7. +0
    -26
      bin/netpgp/Makefile
  8. +0
    -24
      bin/netpgpkeys/Makefile
  9. +0
    -38
      bin/netpgpverify/Makefile
  10. +0
    -12
      bin/netpgpverify/config.h
  11. +0
    -109
      dist/TODO
  12. +0
    -39
      dist/bindings/lua/Makefile
  13. +0
    -362
      dist/bindings/lua/glue.c
  14. +0
    -99
      dist/bindings/lua/netpgp.lua
  15. +0
    -123
      dist/bindings/lua/optparse.lua
  16. +0
    -2
      dist/bindings/lua/shlib_version
  17. +0
    -16
      dist/bindings/perl/Makefile
  18. +0
    -103
      dist/bindings/perl/netpgp.h
  19. +0
    -28
      dist/bindings/perl/netpgp.pl
  20. +0
    -7
      dist/bindings/perl/netpgpperl.i
  21. +0
    -138
      dist/bindings/perl/netpgpperl.pm
  22. +0
    -4180
      dist/bindings/perl/netpgpperl_wrap.c
  23. +0
    -2
      dist/bindings/perl/shlib_version
  24. +0
    -18
      dist/bindings/python/Makefile
  25. +0
    -103
      dist/bindings/python/netpgp.h
  26. +0
    -15
      dist/bindings/python/netpgp.py
  27. +0
    -7
      dist/bindings/python/netpgppython.i
  28. +0
    -119
      dist/bindings/python/netpgppython.py
  29. +0
    -5179
      dist/bindings/python/netpgppython_wrap.c
  30. +0
    -2
      dist/bindings/python/shlib_version
  31. +0
    -5
      dist/bindings/swig/netpgp.i
  32. +0
    -108
      dist/bindings/swig/swigit
  33. +0
    -15
      dist/bindings/tcl/Makefile
  34. +0
    -91
      dist/bindings/tcl/netpgp.h
  35. +0
    -15
      dist/bindings/tcl/netpgp.tcl
  36. +0
    -7
      dist/bindings/tcl/netpgptcl.i
  37. +0
    -3469
      dist/bindings/tcl/netpgptcl_wrap.c
  38. +0
    -22
      dist/bindings/tcl/shlib_version
  39. +1
    -6
      dist/configure.ac
  40. +0
    -15
      dist/doc/Makefile
  41. +0
    -122
      dist/doc/deliverable.txt
  42. +0
    -1215
      dist/doc/doxygen-user.cfg
  43. +0
    -37
      dist/doc/spec.txt
  44. BIN
      dist/presentations/openpgpsdk-euroscon.pdf
  45. BIN
      dist/presentations/openpgpsdk.ppt
  46. +0
    -4022
      dist/ref/draft-ietf-openpgp-rfc2440bis-12-ben.txt
  47. +0
    -78
      dist/ref/draft-ietf-openpgp-rfc2440bis-12-comments.txt
  48. +0
    -4034
      dist/ref/draft-ietf-openpgp-rfc2440bis-12.txt
  49. +0
    -4028
      dist/ref/draft-ietf-openpgp-rfc2440bis-13.txt
  50. +0
    -4034
      dist/ref/draft-ietf-openpgp-rfc2440bis-14.txt
  51. +0
    -4092
      dist/ref/draft-ietf-openpgp-rfc2440bis-15.txt
  52. +0
    -4762
      dist/ref/draft-ietf-openpgp-rfc2440bis-22.txt
  53. +0
    -1179
      dist/ref/rfc1991.txt
  54. +0
    -2187
      dist/ref/rfc2437.txt
  55. +0
    -3643
      dist/ref/rfc2440.txt
  56. +0
    -5043
      dist/ref/rfc4880.txt
  57. +0
    -171
      dist/ref/rfc5581.txt
  58. +0
    -13
      dist/src/hkpclient/Makefile.am
  59. +0
    -129
      dist/src/hkpclient/hkpc.1
  60. +0
    -140
      dist/src/hkpclient/hkpc.c
  61. +0
    -34
      dist/src/hkpclient/hkpc.h
  62. +0
    -74
      dist/src/hkpclient/hkpclient.lua
  63. +0
    -69
      dist/src/hkpclient/main.c
  64. +0
    -123
      dist/src/hkpclient/optparse.lua
  65. +0
    -25
      dist/src/hkpclient/tst
  66. +0
    -19
      dist/src/hkpd/Makefile
  67. +0
    -129
      dist/src/hkpd/hkpd.1
  68. +0
    -326
      dist/src/hkpd/hkpd.c
  69. +0
    -39
      dist/src/hkpd/hkpd.h
  70. +0
    -153
      dist/src/hkpd/main.c
  71. +0
    -13
      dist/src/libbn/Makefile
  72. +0
    -5637
      dist/src/libbn/bignum.c
  73. +0
    -146
      dist/src/libbn/bn.h
  74. +0
    -304
      dist/src/libbn/libnetpgpbn.3
  75. +0
    -82
      dist/src/libbn/misc.c
  76. +0
    -58
      dist/src/libbn/misc.h
  77. +0
    -60
      dist/src/libbn/rand.c
  78. +0
    -44
      dist/src/libbn/rand.h
  79. +0
    -217
      dist/src/libbn/stubs.c
  80. +0
    -94
      dist/src/libbn/stubs.h
  81. +0
    -14
      dist/src/libdigest/Makefile
  82. +0
    -383
      dist/src/libdigest/digest.c
  83. +0
    -109
      dist/src/libdigest/digest.h
  84. +0
    -218
      dist/src/libdigest/tiger.3
  85. +0
    -906
      dist/src/libdigest/tiger.c
  86. +0
    -65
      dist/src/libdigest/tiger.h
  87. +0
    -13
      dist/src/libmj/Makefile.am
  88. +0
    -95
      dist/src/libmj/defs.h
  89. +0
    -283
      dist/src/libmj/libmj.3
  90. +0
    -653
      dist/src/libmj/mj.c
  91. +0
    -79
      dist/src/libmj/mj.h
  92. +0
    -417
      dist/src/libpaa/PubKeyAccessAuthScheme.txt
  93. +0
    -87
      dist/src/libpaa/client.c
  94. +0
    -117
      dist/src/libpaa/libpaa.3
  95. +0
    -387
      dist/src/libpaa/libpaa.c
  96. +0
    -93
      dist/src/libpaa/libpaa.h
  97. +0
    -114
      dist/src/libpaa/server.c
  98. +0
    -10
      dist/src/librsa/Makefile
  99. +0
    -113
      dist/src/librsa/libnetpgprsa.3
  100. +0
    -696
      dist/src/librsa/rsa.c

+ 7
- 124
.hgignore View File

@ -3,18 +3,8 @@ syntax: glob
dist/Makefile
dist/Makefile.in
dist/aclocal.m4
dist/autom4te.cache/output.0
dist/autom4te.cache/output.1
dist/autom4te.cache/requests
dist/autom4te.cache/traces.0
dist/autom4te.cache/traces.1
dist/buildaux/compile
dist/buildaux/config.guess
dist/buildaux/config.sub
dist/buildaux/depcomp
dist/buildaux/install-sh
dist/buildaux/ltmain.sh
dist/buildaux/missing
dist/autom4te.cache
dist/buildaux
dist/config.log
dist/config.status
dist/configure
@ -23,120 +13,13 @@ dist/include/Makefile.in
dist/libtool
dist/src/Makefile
dist/src/Makefile.in
dist/src/hkpclient/.deps/hkpc-hkpc.Po
dist/src/hkpclient/.deps/hkpc-main.Po
dist/src/hkpclient/.libs/hkpc
dist/src/hkpclient/Makefile
dist/src/hkpclient/Makefile.in
dist/src/hkpclient/hkpc
dist/src/hkpclient/hkpc-hkpc.o
dist/src/hkpclient/hkpc-main.o
dist/src/lib/.deps/libnetpgp_la-bufgap.Plo
dist/src/lib/.deps/libnetpgp_la-compress.Plo
dist/src/lib/.deps/libnetpgp_la-create.Plo
dist/src/lib/.deps/libnetpgp_la-crypto.Plo
dist/src/lib/.deps/libnetpgp_la-keyring.Plo
dist/src/lib/.deps/libnetpgp_la-misc.Plo
dist/src/lib/.deps/libnetpgp_la-netpgp.Plo
dist/src/lib/.deps/libnetpgp_la-openssl_crypto.Plo
dist/src/lib/.deps/libnetpgp_la-packet-parse.Plo
dist/src/lib/.deps/libnetpgp_la-packet-print.Plo
dist/src/lib/.deps/libnetpgp_la-packet-show.Plo
dist/src/lib/.deps/libnetpgp_la-reader.Plo
dist/src/lib/.deps/libnetpgp_la-signature.Plo
dist/src/lib/.deps/libnetpgp_la-ssh2pgp.Plo
dist/src/lib/.deps/libnetpgp_la-symmetric.Plo
dist/src/lib/.deps/libnetpgp_la-validate.Plo
dist/src/lib/.deps/libnetpgp_la-writer.Plo
dist/src/lib/.libs/libnetpgp.a
dist/src/lib/.libs/libnetpgp.la
dist/src/lib/.libs/libnetpgp.lai
dist/src/lib/.libs/libnetpgp.so
dist/src/lib/.libs/libnetpgp.so.0
dist/src/lib/.libs/libnetpgp.so.0.0.0
dist/src/lib/.libs/libnetpgp_la-bufgap.o
dist/src/lib/.libs/libnetpgp_la-compress.o
dist/src/lib/.libs/libnetpgp_la-create.o
dist/src/lib/.libs/libnetpgp_la-crypto.o
dist/src/lib/.libs/libnetpgp_la-keyring.o
dist/src/lib/.libs/libnetpgp_la-misc.o
dist/src/lib/.libs/libnetpgp_la-netpgp.o
dist/src/lib/.libs/libnetpgp_la-openssl_crypto.o
dist/src/lib/.libs/libnetpgp_la-packet-parse.o
dist/src/lib/.libs/libnetpgp_la-packet-print.o
dist/src/lib/.libs/libnetpgp_la-packet-show.o
dist/src/lib/.libs/libnetpgp_la-reader.o
dist/src/lib/.libs/libnetpgp_la-signature.o
dist/src/lib/.libs/libnetpgp_la-ssh2pgp.o
dist/src/lib/.libs/libnetpgp_la-symmetric.o
dist/src/lib/.libs/libnetpgp_la-validate.o
dist/src/lib/.libs/libnetpgp_la-writer.o
dist/src/lib/.deps
dist/src/lib/.libs
dist/src/lib/Makefile
dist/src/lib/Makefile.in
dist/src/lib/config.h
dist/src/lib/config.h.in
dist/src/lib/libnetpgp.la
dist/src/lib/libnetpgp_la-bufgap.lo
dist/src/lib/libnetpgp_la-bufgap.o
dist/src/lib/libnetpgp_la-compress.lo
dist/src/lib/libnetpgp_la-compress.o
dist/src/lib/libnetpgp_la-create.lo
dist/src/lib/libnetpgp_la-create.o
dist/src/lib/libnetpgp_la-crypto.lo
dist/src/lib/libnetpgp_la-crypto.o
dist/src/lib/libnetpgp_la-keyring.lo
dist/src/lib/libnetpgp_la-keyring.o
dist/src/lib/libnetpgp_la-misc.lo
dist/src/lib/libnetpgp_la-misc.o
dist/src/lib/libnetpgp_la-netpgp.lo
dist/src/lib/libnetpgp_la-netpgp.o
dist/src/lib/libnetpgp_la-openssl_crypto.lo
dist/src/lib/libnetpgp_la-openssl_crypto.o
dist/src/lib/libnetpgp_la-packet-parse.lo
dist/src/lib/libnetpgp_la-packet-parse.o
dist/src/lib/libnetpgp_la-packet-print.lo
dist/src/lib/libnetpgp_la-packet-print.o
dist/src/lib/libnetpgp_la-packet-show.lo
dist/src/lib/libnetpgp_la-packet-show.o
dist/src/lib/libnetpgp_la-reader.lo
dist/src/lib/libnetpgp_la-reader.o
dist/src/lib/libnetpgp_la-signature.lo
dist/src/lib/libnetpgp_la-signature.o
dist/src/lib/libnetpgp_la-ssh2pgp.lo
dist/src/lib/libnetpgp_la-ssh2pgp.o
dist/src/lib/libnetpgp_la-symmetric.lo
dist/src/lib/libnetpgp_la-symmetric.o
dist/src/lib/libnetpgp_la-validate.lo
dist/src/lib/libnetpgp_la-validate.o
dist/src/lib/libnetpgp_la-writer.lo
dist/src/lib/libnetpgp_la-writer.o
dist/src/lib/libnetpgp*
dist/src/lib/stamp-h1
dist/src/libmj/.deps/libmj_la-mj.Plo
dist/src/libmj/.libs/libmj.a
dist/src/libmj/.libs/libmj.la
dist/src/libmj/.libs/libmj.lai
dist/src/libmj/.libs/libmj.so
dist/src/libmj/.libs/libmj.so.0
dist/src/libmj/.libs/libmj.so.0.0.0
dist/src/libmj/.libs/libmj_la-mj.o
dist/src/libmj/Makefile
dist/src/libmj/Makefile.in
dist/src/libmj/libmj.la
dist/src/libmj/libmj_la-mj.lo
dist/src/libmj/libmj_la-mj.o
dist/src/netpgp/.deps/netpgp-netpgp.Po
dist/src/netpgp/.libs/netpgp
dist/src/netpgp/Makefile
dist/src/netpgp/Makefile.in
dist/src/netpgp/netpgp
dist/src/netpgp/netpgp-netpgp.o
dist/src/netpgpkeys/.deps/netpgpkeys-netpgpkeys.Po
dist/src/netpgpkeys/.libs/netpgpkeys
dist/src/netpgpkeys/Makefile
dist/src/netpgpkeys/Makefile.in
dist/src/netpgpkeys/netpgpkeys
dist/src/netpgpkeys/netpgpkeys-netpgpkeys.o
dist/tests/Makefile
dist/tests/Makefile.in
dist/tests/atconfig
dist/tests/atlocal
dist/netpgp-xcode/netpgp.xcodeproj/xcuserdata
*.DS_Store

+ 0
- 7
Makefile View File

@ -1,7 +0,0 @@
# $NetBSD$
SUBDIR+= libmj .WAIT
SUBDIR+= lib .WAIT
SUBDIR+= bin
.include <bsd.subdir.mk>

+ 0
- 3
Makefile.inc View File

@ -1,3 +0,0 @@
# $NetBSD$
WARNS?=4

+ 0
- 9
bin/Makefile View File

@ -1,9 +0,0 @@
# $NetBSD$
SUBDIR+= netpgp
SUBDIR+= netpgpkeys
SUBDIR+= netpgpverify
#SUBDIR+= hkpc
#SUBDIR+= hkpd
.include <bsd.subdir.mk>

+ 0
- 25
bin/hkpc/Makefile View File

@ -1,25 +0,0 @@
# $NetBSD$
.include <bsd.own.mk>
PROG=hkpc
BINDIR=/usr/bin
SRCS=hkpc.c main.c
LIBNETPGPDIR!= cd ${.CURDIR}/../../lib/netpgp && ${PRINTOBJDIR}
LDADD+= -L${LIBNETPGPDIR} -lnetpgp
DPADD+= ${LIBNETPGPDIR}/libnetpgp.a
LIBMJDIR!= cd ${.CURDIR}/../../libmj && ${PRINTOBJDIR}
LDADD+= -L${LIBMJDIR} -lmj
DPADD+= ${LIBMJDIR}/libmj.a
LDADD+= -lcrypto -lz -lbz2
DPADD+= ${LIBCRYPTO} ${LIBZ} ${LIBBZ2}
WARNS=0
MAN=hkpc.1
.PATH: ${.CURDIR}/../../dist/src/hkpclient
.include <bsd.prog.mk>

+ 0
- 32
bin/hkpd/Makefile View File

@ -1,32 +0,0 @@
# $NetBSD$
.include <bsd.own.mk>
PROG=hkpd
BINDIR=/usr/sbin
SRCS=hkpd.c main.c
LIBNETPGPDIR!= cd ${.CURDIR}/../../lib/netpgp && ${PRINTOBJDIR}
LDADD+= -L${LIBNETPGPDIR} -lnetpgp
DPADD+= ${LIBNETPGPDIR}/libnetpgp.a
LIBMJDIR!= cd ${.CURDIR}/../../libmj && ${PRINTOBJDIR}
LDADD+= -L${LIBMJDIR} -lmj
DPADD+= ${LIBMJDIR}/libmj.a
LDADD+= -lcrypto -lz -lbz2
DPADD+= ${LIBCRYPTO} ${LIBZ} ${LIBBZ2}
MAN=hkpd.1
.PATH: ${.CURDIR}/../../dist/src/hkpd
.include <bsd.prog.mk>
t: ${PROG}
./${PROG} -D &
sleep 1
ftp -o- 'http://localhost:11371/pks/lookup?op=index&search=agc&options=json'
ftp -o- 'http://localhost:11371/pks/lookup?op=get&search=agc&options=json'
ftp -o- 'http://localhost:11371/pks/lookup?op=get&search=agc&options=mr'
pkill hkpd

+ 0
- 26
bin/netpgp/Makefile View File

@ -1,26 +0,0 @@
# $NetBSD$
.include <bsd.own.mk>
PROG= netpgp
BINDIR= /usr/bin
CPPFLAGS+= -I${EXTDIST}/include
LIBNETPGPDIR!= cd ${.CURDIR}/../../lib/netpgp && ${PRINTOBJDIR}
LDADD+= -L${LIBNETPGPDIR} -lnetpgp
DPADD+= ${LIBNETPGPDIR}/libnetpgp.a
LIBMJDIR!= cd ${.CURDIR}/../../libmj && ${PRINTOBJDIR}
LDADD+= -L${LIBMJDIR} -lmj
DPADD+= ${LIBMJDIR}/libmj.a
LDADD+= -lcrypto -lz -lbz2
DPADD+= ${LIBCRYPTO} ${LIBZ} ${LIBBZ2}
MAN= netpgp.1
EXTDIST= ${.CURDIR}/../../dist
.PATH: ${EXTDIST}/src/netpgp
.include <bsd.prog.mk>

+ 0
- 24
bin/netpgpkeys/Makefile View File

@ -1,24 +0,0 @@
# $NetBSD$
.include <bsd.own.mk>
PROG= netpgpkeys
SRCS= netpgpkeys.c
BINDIR= /usr/bin
LIBNETPGPDIR!= cd ${.CURDIR}/../../lib/netpgp && ${PRINTOBJDIR}
LDADD+= -L${LIBNETPGPDIR} -lnetpgp
DPADD+= ${LIBNETPGPDIR}/libnetpgp.a
LIBMJDIR!= cd ${.CURDIR}/../../libmj && ${PRINTOBJDIR}
LDADD+= -L${LIBMJDIR} -lmj
DPADD+= ${LIBMJDIR}/libmj.a
LDADD+= -lcrypto -lz -lbz2
DPADD+= ${LIBCRYPTO} ${LIBZ} ${LIBBZ2}
MAN= netpgpkeys.1
.PATH: ${.CURDIR}/../../dist/src/netpgpkeys
.include <bsd.prog.mk>

+ 0
- 38
bin/netpgpverify/Makefile View File

@ -1,38 +0,0 @@
# $NetBSD$
PROG=netpgpverify
BINDIR= /usr/bin
SRCS= b64.c bignum.c bufgap.c digest.c
SRCS+= libverify.c main.c misc.c
SRCS+= pgpsum.c rsa.c
SRCS+= bzlib.c zlib.c
SRCS+= md5c.c rmd160.c sha1.c sha2.c tiger.c
CPPFLAGS+=-I${.CURDIR} -I${EXTDIST}/src/netpgpverify
COPTS.libverify.c+= -Wno-format-nonliteral
.ifndef PRODUCTION
CPPFLAGS+=-g -O0
LDFLAGS+=-g -O0
.endif
MAN= netpgpverify.1
WARNS= 5
EXTDIST=${.CURDIR}/../../dist
.PATH: ${EXTDIST}/src/netpgpverify
.include <bsd.prog.mk>
t tst: ${PROG}
./${PROG} -k ${EXTDIST}/src/netpgpverify/pubring.gpg ${EXTDIST}/src/netpgpverify/NetBSD-6.0_RC1_hashes.asc
./${PROG} -k ${EXTDIST}/src/netpgpverify/pubring.gpg ${EXTDIST}/src/netpgpverify/NetBSD-6.0_RC1_hashes.gpg
./${PROG} -v
./${PROG} -S ${EXTDIST}/src/netpgpverify/sshtest-20140202.pub ${EXTDIST}/src/netpgpverify/data.gpg
./${PROG} -S ${EXTDIST}/src/netpgpverify/sshtest-20140202.pub ${EXTDIST}/src/netpgpverify/data.sig
@echo "expected failure, to check bad signatures fail to verify"
-sed -e 's|A|B|' ${EXTDIST}/src/netpgpverify/data.gpg | ./${PROG} -S ${EXTDIST}/src/netpgpverify/sshtest-20140202.pub

+ 0
- 12
bin/netpgpverify/config.h View File

@ -1,12 +0,0 @@
#ifndef CONFIG_H_
#define CONFIG_H_ 20140308
#ifndef __UNCONST
#define __UNCONST(a) ((void *)(unsigned long)(const void *)(a))
#endif /* __UNCONST */
#ifndef USE_ARG
#define USE_ARG(x) /*LINTED*/(void)&(x)
#endif /* USE_ARG */
#endif /* CONFIG_H_ */

+ 0
- 109
dist/TODO View File

@ -1,109 +0,0 @@
To Do
=====
check pkt size during read
list sigs on a per-user basis
2^n sized packets - regions?
json for verification in netpgp
show attributes on key listings
agent
agentctl
convert to and from ascii armored sigs
gpgme compat lib
get rid of public key free as part of seckey
is get_passphrase_cb needed?
error logging
separate from libcrypto?
default compression when signing?
Done
====
autoconf
libtool
name change
content_ naming scheme
Brief test script
get rid of C global
put all readers and writers together in one file
Add mmapped method
merge mmap'ed and fd reads - if mmap fails, fall back to read
Make sure all openpgpsdk changes are brought forward
look at header file fun
new version number in autoconf
Make decrypt work with files > 8192 bytes
dynamically size literal_data_body before decompressing?
restore ops_export_key functionality
match keyids using case insensitive matching - (c0596823 == C0596823)
use PRIsize appropriately
make a high-level interface
get rid of multiple local headers
get rid of long identifier names - all done internally now
Finish name change for everything
work out what's exported and what's not
finish off main header file
init(&netpgp, userid, pubring, secring)
__ops
real naming scheme
get rid of malloc() instances -> calloc()
change include directory
Install man pages
WARNS=4 (again)
detached sig
get rid of assert()s
disable core dumps
add a --help option
sha256 digests
print out size of key in --list-keys
decryption - print encrypted key info
get rid of local files
hash algorithm selection
detached verification
RCS Ids
Look at inefficiencies - read() etc
cat command to display a verified file without signature
get rid of ops_memory after used literal_data_body
new package for 1.99.4
separate verify program
Add --passwd-fd n argument
bring forward netpgpverify mods to netpgp
move directory locations in package and cvs repo
fix up tests for new directory locations
separate key management program
C++ guards in header file
modify sets lists for netpgpverify
don't require passphrase for keys without one
failure to run if no userid in gpg.conf (even if --userid specified)
don't complain if no .gnupg dir (even when using --homedir)
make it work with ssh host keys
regex matching for names and signatures
in memory encryption and decryption
ssss
make netpgp work from stdin/to stdout
signature duration and expiry
multisign
settable from time
unarmoured static in packet-print.c and skipping in crypto.c
display expiry properly
unarmoured static in packet-print.c and skipping in crypto.c
duration -> expiry
print signing key info properly when prompting for passphrase
print decryption key info properly when prompting for passphrase
hkpd
hkpclient
netbsd/pkgsrc pr 42922
add expiry information to public key display
trust subpackets
add revocation information to public key display
--list-sigs - these come out in __ops_check_subkey_sig()
hkp to include sigs too
make netpgpkeys work - add, import, commit, update, sign, passphrase
fix ssh fingerprints not matching netpgp
json/yaml output
return userids from successful verify, and then print id out if required
convert between pgp and ssh key formats
PEM ssh keys and passphrases
camellia addition
fix calloc return values in symmetric.c/ops_crypt_t
prog to convert from pgp sec to ssh sec
add user-specifiable ciphers for encryption
elgamal enc/decryption?
thresholds - see sharedkey, ssss, threshold etc

+ 0
- 39
dist/bindings/lua/Makefile View File

@ -1,39 +0,0 @@
#PREFIX=/Users/agcrooks
PREFIX=/usr
#LIBDIR=/usr/lib
LIB=luanetpgp
SRCS=glue.c
MKMAN=no
CPPFLAGS+=-g -I${PREFIX}/pkg/include
LDADD+= -lnetpgp
WARNS=4
CLEANFILES+= a a.sig
.include <bsd.lib.mk>
.include <bsd.own.mk>
LUANETPGPOBJDIR != cd ${.CURDIR} && ${PRINTOBJDIR}
OPSYS!= uname -s
.if ${OPSYS} == "Darwin"
.sinclude <bsd.warns.mk>
lib${LIB}.dylib:
libtool -dynamic -o ${.TARGET} ${OBJS} ${PREFIX}/pkg/lib/liblua.dylib /usr/lib/libc.dylib ${PREFIX}/pkg/lib/libnetpgp.dylib
t: lib${LIB}.dylib
cp Makefile a
./netpgp.lua --sign --detached a
./netpgp.lua --verify a.sig
.else
t:
cp Makefile a
env LD_LIBRARY_PATH=${LUANETPGPOBJDIR}:/lib:/usr/lib:${PREFIX}/lib \
./netpgp.lua --sign --detached a
env LD_LIBRARY_PATH=${LUANETPGPOBJDIR}:/lib:/usr/lib:${PREFIX}/lib \
./netpgp.lua --verify a.sig
.endif

+ 0
- 362
dist/bindings/lua/glue.c View File

@ -1,362 +0,0 @@
/*-
* Copyright (c) 2009 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Alistair Crooks (agc@netbsd.org)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/types.h>
#include <sys/param.h>
#include <sys/stat.h>
#include <inttypes.h>
#include <netpgp.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#define LUA_LIB
#include <lua.h>
#include <lauxlib.h>
#include <lualib.h>
#ifndef __UNCONST
#define __UNCONST(a) ((void *)(unsigned long)(const void *)(a))
#endif /* !__UNCONST */
#define DEFAULT_HASH_ALG "SHA256"
int luaopen_netpgp(lua_State *);
typedef struct strarg_t {
const char *s; /* string */
const int n; /* corresponding int value */
} strarg_t;
/* map a string onto an int */
static int
findtype(strarg_t *strs, const char *s)
{
strarg_t *sp;
for (sp = strs ; sp->s && strcasecmp(sp->s, s) != 0 ; sp++) {
}
return sp->n;
}
/* set the home directory value to "home/subdir" */
static int
set_homedir(netpgp_t *netpgp, char *home, const char *subdir, const int quiet)
{
struct stat st;
char d[MAXPATHLEN];
if (home == NULL) {
if (!quiet) {
(void) fprintf(stderr, "NULL HOME directory\n");
}
return 0;
}
(void) snprintf(d, sizeof(d), "%s%s", home, (subdir) ? subdir : "");
if (stat(d, &st) == 0) {
if ((st.st_mode & S_IFMT) == S_IFDIR) {
netpgp_setvar(netpgp, "homedir", d);
return 1;
}
(void) fprintf(stderr, "netpgp: homedir \"%s\" is not a dir\n",
d);
return 0;
}
if (!quiet) {
(void) fprintf(stderr,
"netpgp: warning homedir \"%s\" not found\n", d);
}
return 1;
}
/* init() */
static int
l_new(lua_State *L)
{
netpgp_t *netpgp;
netpgp = lua_newuserdata(L, sizeof(*netpgp));
(void) memset(netpgp, 0x0, sizeof(*netpgp));
set_homedir(netpgp, getenv("HOME"), "/.gnupg", 1);
netpgp_setvar(netpgp, "hash", DEFAULT_HASH_ALG);
return 1;
}
/* initialise(netpgp) */
static int
l_init(lua_State *L)
{
netpgp_t *netpgp;
netpgp = lua_touserdata(L, 1);
lua_pushnumber(L, netpgp_init(netpgp));
return 1;
}
/* homedir(netpgp, homedir) */
static int
l_homedir(lua_State *L)
{
const char *home;
netpgp_t *netpgp;
netpgp = lua_touserdata(L, 1);
home = luaL_checkstring(L, 2);
lua_pushnumber(L, set_homedir(netpgp, __UNCONST(home), NULL, 0));
return 1;
}
static strarg_t armourtypes[] = {
{ "armoured", 1 },
{ "armored", 1 },
{ "armour", 1 },
{ "armor", 1 },
{ NULL, 0 }
};
/* encrypt_file(netpgp, f, output, armour) */
static int
l_encrypt_file(lua_State *L)
{
const char *output;
const char *f;
netpgp_t *netpgp;
int armour;
int ret;
netpgp = lua_touserdata(L, 1);
netpgp_setvar(netpgp, "need userid", "1");
f = luaL_checkstring(L, 2);
output = luaL_checkstring(L, 3);
if (*output == 0x0) {
output = NULL;
}
armour = findtype(armourtypes, luaL_checkstring(L, 4));
ret = netpgp_encrypt_file(netpgp, netpgp_getvar(netpgp, "userid"),
f, __UNCONST("a.gpg"), armour);
lua_pushnumber(L, ret);
return 1;
}
/* decrypt_file(netpgp, f, output, armour) */
static int
l_decrypt_file(lua_State *L)
{
const char *output;
const char *f;
netpgp_t *netpgp;
int armour;
int ret;
netpgp = lua_touserdata(L, 1);
f = luaL_checkstring(L, 2);
output = luaL_checkstring(L, 3);
if (*output == 0x0) {
output = NULL;
}
armour = findtype(armourtypes, luaL_checkstring(L, 4));
ret = netpgp_decrypt_file(netpgp, f, __UNCONST(output), armour);
lua_pushnumber(L, ret);
return 1;
}
static strarg_t detachtypes[] = {
{ "detached", 1 },
{ "separate", 1 },
{ "detach", 1 },
{ NULL, 0 }
};
/* sign_file(netpgp, f, output, armour, detached) */
static int
l_sign_file(lua_State *L)
{
const char *output;
const char *f;
const int binary = 0;
netpgp_t *netpgp;
int detached;
int armour;
int ret;
netpgp = lua_touserdata(L, 1);
netpgp_setvar(netpgp, "need userid", "1");
f = luaL_checkstring(L, 2);
output = luaL_checkstring(L, 3);
if (*output == 0x0) {
output = NULL;
}
armour = findtype(armourtypes, luaL_checkstring(L, 4));
detached = findtype(detachtypes, luaL_checkstring(L, 5));
ret = netpgp_sign_file(netpgp, netpgp_getvar(netpgp, "userid"),
f, __UNCONST(output), armour, binary,
detached);
lua_pushnumber(L, ret);
return 1;
}
/* clearsign_file(netpgp, f, output, armour, detached) */
static int
l_clearsign_file(lua_State *L)
{
const char *output;
const char *f;
const int cleartext = 1;
netpgp_t *netpgp;
int detached;
int armour;
int ret;
netpgp = lua_touserdata(L, 1);
netpgp_setvar(netpgp, "need userid", "1");
f = luaL_checkstring(L, 2);
output = luaL_checkstring(L, 3);
armour = findtype(armourtypes, luaL_checkstring(L, 4));
detached = findtype(detachtypes, luaL_checkstring(L, 5));
ret = netpgp_sign_file(netpgp, netpgp_getvar(netpgp, "userid"),
f, __UNCONST(output), armour, cleartext,
detached);
lua_pushnumber(L, ret);
return 1;
}
/* verify_file(netpgp, f, armour) */
static int
l_verify_file(lua_State *L)
{
const char *f;
netpgp_t *netpgp;
int armour;
int ret;
netpgp = lua_touserdata(L, 1);
f = luaL_checkstring(L, 2);
armour = findtype(armourtypes, luaL_checkstring(L, 3));
ret = netpgp_verify_file(netpgp, f, NULL, armour);
lua_pushnumber(L, ret);
return 1;
}
/* verify_cat_file(netpgp, f, output, armour) */
static int
l_verify_cat_file(lua_State *L)
{
const char *output;
const char *f;
netpgp_t *netpgp;
int armour;
int ret;
netpgp = lua_touserdata(L, 1);
f = luaL_checkstring(L, 2);
output = luaL_checkstring(L, 3);
armour = findtype(armourtypes, luaL_checkstring(L, 4));
ret = netpgp_verify_file(netpgp, f, output, armour);
lua_pushnumber(L, ret);
return 1;
}
/* list_packets(netpgp, f, armour) */
static int
l_list_packets(lua_State *L)
{
const char *f;
netpgp_t *netpgp;
int armour;
int ret;
netpgp = lua_touserdata(L, 1);
f = luaL_checkstring(L, 2);
armour = findtype(armourtypes, luaL_checkstring(L, 3));
ret = netpgp_list_packets(netpgp, __UNCONST(f), armour, NULL);
lua_pushnumber(L, ret);
return 1;
}
/* setvar(netpgp, name, value) */
static int
l_setvar(lua_State *L)
{
const char *name;
const char *value;
netpgp_t *netpgp;
int ret;
netpgp = lua_touserdata(L, 1);
name = luaL_checkstring(L, 2);
value = luaL_checkstring(L, 3);
ret = netpgp_setvar(netpgp, name, value);
lua_pushnumber(L, ret);
return 1;
}
/* getvar(netpgp, name, value) */
static int
l_getvar(lua_State *L)
{
const char *name;
const char *ret;
netpgp_t *netpgp;
netpgp = lua_touserdata(L, 1);
name = luaL_checkstring(L, 2);
ret = netpgp_getvar(netpgp, name);
lua_pushstring(L, ret);
return 1;
}
const struct luaL_reg libluanetpgp[] = {
{ "new", l_new },
{ "init", l_init },
{ "encrypt_file", l_encrypt_file },
{ "decrypt_file", l_decrypt_file },
{ "sign_file", l_sign_file },
{ "clearsign_file", l_clearsign_file },
{ "verify_file", l_verify_file },
{ "verify_cat_file", l_verify_cat_file },
{ "list_packets", l_list_packets },
{ "getvar", l_getvar },
{ "setvar", l_setvar },
{ "homedir", l_homedir },
{ NULL, NULL }
};
int
luaopen_netpgp(lua_State *L)
{
luaL_openlib(L, "netpgp", libluanetpgp, 0);
return 1;
}

+ 0
- 99
dist/bindings/lua/netpgp.lua View File

@ -1,99 +0,0 @@
#! /usr/bin/env lua
--
-- Copyright (c) 2009 The NetBSD Foundation, Inc.
-- All rights reserved.
--
-- This code is derived from software contributed to The NetBSD Foundation
-- by Alistair Crooks (agc@netbsd.org)
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions
-- are met:
-- 1. Redistributions of source code must retain the above copyright
-- notice, this list of conditions and the following disclaimer.
-- 2. Redistributions in binary form must reproduce the above copyright
-- notice, this list of conditions and the following disclaimer in the
-- documentation and/or other materials provided with the distribution.
--
-- THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
-- ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
-- TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
-- BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-- POSSIBILITY OF SUCH DAMAGE.
--
-- command line args
dofile "optparse.lua"
opt = OptionParser{usage="%prog [options] file", version="20090711"}
opt.add_option{"-s", "--sign", action="store_true", dest="sign", help="--sign [--detached] [--armour] file"}
opt.add_option{"-v", "--verify", action="store_true", dest="verify", help="--verify [--armour] file"}
opt.add_option{"-e", "--encrypt", action="store_true", dest="encrypt", help="--encrypt [--armour] file"}
opt.add_option{"-d", "--decrypt", action="store_true", dest="decrypt", help="--decrypt [--armour] file"}
opt.add_option{"-h", "--homedir", action="store", dest="homedir", help="--homedir directory"}
opt.add_option{"-o", "--output", action="store", dest="output", help="--output file"}
opt.add_option{"-a", "--armour", action="store_true", dest="armour", help="--armour"}
opt.add_option{"-D", "--detached", action="store_true", dest="detached", help="--detached"}
-- caller lua script
local extension = ".so"
f = io.open("libluanetpgp.dylib", "r")
if f then
extension = ".dylib"
io.close(f)
end
glupkg = package.loadlib("libluanetpgp" .. extension, "luaopen_netpgp")
netpgp = glupkg()
-- initialise
pgp = netpgp.new()
-- parse command line args
options,args = opt.parse_args()
-- set defaults
local output = options.output or ""
local armour = "binary"
if options.armour then
armour = "armour"
end
local detached = "attached"
if options.detached then
detached = "detached"
end
if options.homedir then
netpgp.homedir(pgp, options.homedir)
end
-- initialise everything
netpgp.init(pgp)
local i
for i = 1, #args do
if options.encrypt then
-- encrypt a file
netpgp.encrypt_file(pgp, args[1], output, armour)
os.execute("ls -l " .. args[1] .. ".gpg")
end
if options.decrypt then
-- decrypt file
netpgp.decrypt_file(pgp, args[1], output, armour)
end
if options.sign then
-- detached signature
netpgp.sign_file(pgp, args[1], output, armour, detached)
os.execute("ls -l " .. args[1] .. ".sig")
end
if options.verify then
-- verification of detached signature
netpgp.verify_file(pgp, args[1], armour)
end
end

+ 0
- 123
dist/bindings/lua/optparse.lua View File

@ -1,123 +0,0 @@
-- Lua command line option parser.
-- Interface based on Pythons optparse.
-- http://docs.python.org/lib/module-optparse.html
-- (c) 2008 David Manura, Licensed under the same terms as Lua (MIT license)
--
-- To be used like this:
-- t={usage="<some usage message>", version="<version string>"}
-- op=OptionParser(t)
-- op=add_option{"<opt>", action=<action>, dest=<dest>, help="<help message for this option>"}
--
-- with :
-- <opt> the option string to be used (can be anything, if one letter opt, then should be -x val, more letters: -xy=val )
-- <action> one of
-- - store: store in options as key, val
-- - store_true: stores key, true
-- - store_false: stores key, false
-- <dest> is the key under which the option is saved
--
-- options,args = op.parse_args()
--
-- now options is the table of options (key, val) and args is the table with non-option arguments.
-- You can use op.fail(message) for failing and op.print_help() for printing the usage as you like.
function OptionParser(t)
local usage = t.usage
local version = t.version
local o = {}
local option_descriptions = {}
local option_of = {}
function o.fail(s) -- extension
io.stderr:write(s .. '\n')
os.exit(1)
end
function o.add_option(optdesc)
option_descriptions[#option_descriptions+1] = optdesc
for _,v in ipairs(optdesc) do
option_of[v] = optdesc
end
end
function o.parse_args()
-- expand options (e.g. "--input=file" -> "--input", "file")
local arg = {unpack(arg)}
for i=#arg,1,-1 do local v = arg[i]
local flag, val = v:match('^(%-%-%w+)=(.*)')
if flag then
arg[i] = flag
table.insert(arg, i+1, val)
end
end
local options = {}
local args = {}
local i = 1
while i <= #arg do local v = arg[i]
local optdesc = option_of[v]
if optdesc then
local action = optdesc.action
local val
if action == 'store' or action == nil then
i = i + 1
val = arg[i]
if not val then o.fail('option requires an argument ' .. v) end
elseif action == 'store_true' then
val = true
elseif action == 'store_false' then
val = false
end
options[optdesc.dest] = val
else
if v:match('^%-') then o.fail('invalid option ' .. v) end
args[#args+1] = v
end
i = i + 1
end
if options.help then
o.print_help()
os.exit()
end
if options.version then
io.stdout:write(t.version .. "\n")
os.exit()
end
return options, args
end
local function flags_str(optdesc)
local sflags = {}
local action = optdesc.action
for _,flag in ipairs(optdesc) do
local sflagend
if action == nil or action == 'store' then
local metavar = optdesc.metavar or optdesc.dest:upper()
sflagend = #flag == 2 and ' ' .. metavar
or '=' .. metavar
else
sflagend = ''
end
sflags[#sflags+1] = flag .. sflagend
end
return table.concat(sflags, ', ')
end
function o.print_help()
io.stdout:write("Usage: " .. usage:gsub('%%prog', arg[0]) .. "\n")
io.stdout:write("\n")
io.stdout:write("Options:\n")
for _,optdesc in ipairs(option_descriptions) do
io.stdout:write(" " .. flags_str(optdesc) ..
" " .. optdesc.help .. "\n")
end
end
o.add_option{"--help", action="store_true", dest="help",
help="show this help message and exit"}
if t.version then
o.add_option{"--version", action="store_true", dest="version",
help="output version info."}
end
return o
end

+ 0
- 2
dist/bindings/lua/shlib_version View File

@ -1,2 +0,0 @@
major=0
minor=0

+ 0
- 16
dist/bindings/perl/Makefile View File

@ -1,16 +0,0 @@
# $NetBSD$
# Automatically generated by swigit wrapper script
PREFIX=/usr/pkg
LIB=netpgpperl
SRCS=netpgpperl_wrap.c
WARNS=0
MKMAN=no
MKLINT=no
CPPFLAGS+=-I${PREFIX}/include
CPPFLAGS+=-I/usr/pkg/lib/perl5/5.10.0/i386-netbsd-thread-multi/CORE
LDFLAGS+=-L${PREFIX}/lib
LDADD+=-lnetpgp
.include <bsd.lib.mk>

+ 0
- 103
dist/bindings/perl/netpgp.h View File

@ -1,103 +0,0 @@
/*-
* Copyright (c) 2009 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Alistair Crooks (agc@netbsd.org)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef NETPGP_H_
#define NETPGP_H_
#ifndef __BEGIN_DECLS
# if defined(__cplusplus)
# define __BEGIN_DECLS extern "C" {
# define __END_DECLS }
# else
# define __BEGIN_DECLS
# define __END_DECLS
# endif
#endif
__BEGIN_DECLS
/* structure used to hold (key,value) pair information */
typedef struct netpgp_t {
unsigned c; /* # of elements used */
unsigned size; /* size of array */
char **name; /* key names */
char **value; /* value information */
void *pubring; /* public key ring */
void *secring; /* s3kr1t key ring */
void *io; /* the io struct for results/errs */
void *passfp; /* file pointer for password input */
} netpgp_t;
/* begin and end */
int netpgp_init(netpgp_t *);
int netpgp_end(netpgp_t *);
/* debugging, reflection and information */
int netpgp_set_debug(const char *);
int netpgp_get_debug(const char *);
const char *netpgp_get_info(const char *);
int netpgp_list_packets(netpgp_t *, char *, int, char *);
/* variables */
int netpgp_setvar(netpgp_t *, const char *, const char *);
char *netpgp_getvar(netpgp_t *, const char *);
int netpgp_incvar(netpgp_t *, const char *, const int);
int netpgp_unsetvar(netpgp_t *, const char *);
/* set home directory information */
int netpgp_set_homedir(netpgp_t *, char *, const char *, const int);
/* key management */
int netpgp_list_keys(netpgp_t *, const int);
int netpgp_find_key(netpgp_t *, char *);
char *netpgp_get_key(netpgp_t *, const char *, const char *);
char *netpgp_export_key(netpgp_t *, char *);
int netpgp_import_key(netpgp_t *, char *);
int netpgp_generate_key(netpgp_t *, char *, int);
/* file management */
int netpgp_encrypt_file(netpgp_t *, const char *, const char *, char *, int);
int netpgp_decrypt_file(netpgp_t *, const char *, char *, int);
int netpgp_sign_file(netpgp_t *, const char *, const char *, char *, int, int, int);
int netpgp_verify_file(netpgp_t *, const char *, const char *, int);
/* memory signing and encryption */
int netpgp_sign_memory(netpgp_t *, const char *, char *, size_t, char *, size_t, const unsigned, const unsigned);
int netpgp_verify_memory(netpgp_t *, const void *, const size_t, void *, size_t, const int);
int netpgp_encrypt_memory(netpgp_t *, const char *, void *, const size_t, char *, size_t, int);
int netpgp_decrypt_memory(netpgp_t *, const void *, const size_t, char *, size_t, const int);
/* match and hkp-related functions */
int netpgp_match_keys(netpgp_t *, char *, const char *, void *, const int);
int netpgp_match_pubkeys(netpgp_t *, char *, void *);
int netpgp_validate_sigs(netpgp_t *);
__END_DECLS
#endif /* !NETPGP_H_ */

+ 0
- 28
dist/bindings/perl/netpgp.pl View File

@ -1,28 +0,0 @@
#! /usr/pkg/bin/perl -w
# netpgp bindings for perl
use lib "/usr/src/crypto/external/bsd/netpgp/dist/bindings/perl";
use netpgpperl;
# initializations
$n = netpgpperlc::new_netpgp_t();
netpgpperlc::netpgp_setvar($n, "homedir", $ENV{'HOME'}."/.gnupg");
netpgpperlc::netpgp_setvar($n, "hash", "SHA256");
netpgpperlc::netpgp_init($n);
# get the default userid
$userid = netpgpperlc::netpgp_getvar($n, "userid");
foreach $i (0 .. $#ARGV) {
# set up file names
my $in = $ARGV[$i];
my $out = $in . ".gpg";
# sign the file, output is in $out
netpgpperlc::netpgp_sign_file($n, $userid, $in, $out, 0, 0, 0);
# verify the signed file $out
netpgpperlc::netpgp_verify_file($n, $out, "/dev/null", 0);
}

+ 0
- 7
dist/bindings/perl/netpgpperl.i View File

@ -1,7 +0,0 @@
%module netpgpperl
%{
#include <netpgp.h>
#undef SvPOK
#define SvPOK(x) 1
%}
%include netpgp.h

+ 0
- 138
dist/bindings/perl/netpgpperl.pm View File

@ -1,138 +0,0 @@
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 1.3.31
#
# Don't modify this file, modify the SWIG interface instead.
package netpgpperl;
require Exporter;
require DynaLoader;
@ISA = qw(Exporter DynaLoader);
package netpgpperlc;
bootstrap netpgpperl;
package netpgpperl;
@EXPORT = qw( );
# ---------- BASE METHODS -------------
package netpgpperl;
sub TIEHASH {
my ($classname,$obj) = @_;
return bless $obj, $classname;
}
sub CLEAR { }
sub FIRSTKEY { }
sub NEXTKEY { }
sub FETCH {
my ($self,$field) = @_;
my $member_func = "swig_${field}_get";
$self->$member_func();
}
sub STORE {
my ($self,$field,$newval) = @_;
my $member_func = "swig_${field}_set";
$self->$member_func($newval);
}
sub this {
my $ptr = shift;
return tied(%$ptr);
}
# ------- FUNCTION WRAPPERS --------
package netpgpperl;
*netpgp_init = *netpgpperlc::netpgp_init;
*netpgp_end = *netpgpperlc::netpgp_end;
*netpgp_set_debug = *netpgpperlc::netpgp_set_debug;
*netpgp_get_debug = *netpgpperlc::netpgp_get_debug;
*netpgp_get_info = *netpgpperlc::netpgp_get_info;
*netpgp_list_packets = *netpgpperlc::netpgp_list_packets;
*netpgp_setvar = *netpgpperlc::netpgp_setvar;
*netpgp_getvar = *netpgpperlc::netpgp_getvar;
*netpgp_incvar = *netpgpperlc::netpgp_incvar;
*netpgp_unsetvar = *netpgpperlc::netpgp_unsetvar;
*netpgp_set_homedir = *netpgpperlc::netpgp_set_homedir;
*netpgp_list_keys = *netpgpperlc::netpgp_list_keys;
*netpgp_find_key = *netpgpperlc::netpgp_find_key;
*netpgp_get_key = *netpgpperlc::netpgp_get_key;
*netpgp_export_key = *netpgpperlc::netpgp_export_key;
*netpgp_import_key = *netpgpperlc::netpgp_import_key;
*netpgp_generate_key = *netpgpperlc::netpgp_generate_key;
*netpgp_encrypt_file = *netpgpperlc::netpgp_encrypt_file;
*netpgp_decrypt_file = *netpgpperlc::netpgp_decrypt_file;
*netpgp_sign_file = *netpgpperlc::netpgp_sign_file;
*netpgp_verify_file = *netpgpperlc::netpgp_verify_file;
*netpgp_sign_memory = *netpgpperlc::netpgp_sign_memory;
*netpgp_verify_memory = *netpgpperlc::netpgp_verify_memory;
*netpgp_encrypt_memory = *netpgpperlc::netpgp_encrypt_memory;
*netpgp_decrypt_memory = *netpgpperlc::netpgp_decrypt_memory;
*netpgp_match_keys = *netpgpperlc::netpgp_match_keys;
*netpgp_match_pubkeys = *netpgpperlc::netpgp_match_pubkeys;
*netpgp_validate_sigs = *netpgpperlc::netpgp_validate_sigs;
############# Class : netpgpperl::netpgp_t ##############
package netpgpperl::netpgp_t;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( netpgpperl );
%OWNER = ();
%ITERATORS = ();
*swig_c_get = *netpgpperlc::netpgp_t_c_get;
*swig_c_set = *netpgpperlc::netpgp_t_c_set;
*swig_size_get = *netpgpperlc::netpgp_t_size_get;
*swig_size_set = *netpgpperlc::netpgp_t_size_set;
*swig_name_get = *netpgpperlc::netpgp_t_name_get;
*swig_name_set = *netpgpperlc::netpgp_t_name_set;
*swig_value_get = *netpgpperlc::netpgp_t_value_get;
*swig_value_set = *netpgpperlc::netpgp_t_value_set;
*swig_pubring_get = *netpgpperlc::netpgp_t_pubring_get;
*swig_pubring_set = *netpgpperlc::netpgp_t_pubring_set;
*swig_secring_get = *netpgpperlc::netpgp_t_secring_get;
*swig_secring_set = *netpgpperlc::netpgp_t_secring_set;
*swig_io_get = *netpgpperlc::netpgp_t_io_get;
*swig_io_set = *netpgpperlc::netpgp_t_io_set;
*swig_passfp_get = *netpgpperlc::netpgp_t_passfp_get;
*swig_passfp_set = *netpgpperlc::netpgp_t_passfp_set;
sub new {
my $pkg = shift;
my $self = netpgpperlc::new_netpgp_t(@_);
bless $self, $pkg if defined($self);
}
sub DESTROY {
return unless $_[0]->isa('HASH');
my $self = tied(%{$_[0]});
return unless defined $self;
delete $ITERATORS{$self};
if (exists $OWNER{$self}) {
netpgpperlc::delete_netpgp_t($self);
delete $OWNER{$self};
}
}
sub DISOWN {
my $self = shift;
my $ptr = tied(%$self);
delete $OWNER{$ptr};
}
sub ACQUIRE {
my $self = shift;
my $ptr = tied(%$self);
$OWNER{$ptr} = 1;
}
# ------- VARIABLE STUBS --------
package netpgpperl;
1;

+ 0
- 4180
dist/bindings/perl/netpgpperl_wrap.c
File diff suppressed because it is too large
View File


+ 0
- 2
dist/bindings/perl/shlib_version View File

@ -1,2 +0,0 @@
major=0
minor=0

+ 0
- 18
dist/bindings/python/Makefile View File

@ -1,18 +0,0 @@
# $NetBSD$
# Automatically generated by swigit wrapper script
PREFIX=/usr/pkg
LIB=netpgppython
SRCS=netpgppython_wrap.c
WARNS=0
MKMAN=no
CPPFLAGS+=-I${PREFIX}/include
CPPFLAGS+=-I/usr/pkg/include/python2.5
LDFLAGS+=-L${PREFIX}/lib
LDADD+=-lnetpgp
.include <bsd.lib.mk>
full:
ln libnetpgppython.so _netpgppython.so

+ 0
- 103
dist/bindings/python/netpgp.h View File

@ -1,103 +0,0 @@
/*-
* Copyright (c) 2009 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Alistair Crooks (agc@netbsd.org)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef NETPGP_H_
#define NETPGP_H_
#ifndef __BEGIN_DECLS
# if defined(__cplusplus)
# define __BEGIN_DECLS extern "C" {
# define __END_DECLS }
# else
# define __BEGIN_DECLS
# define __END_DECLS
# endif
#endif
__BEGIN_DECLS
/* structure used to hold (key,value) pair information */
typedef struct netpgp_t {
unsigned c; /* # of elements used */
unsigned size; /* size of array */
char **name; /* key names */
char **value; /* value information */
void *pubring; /* public key ring */
void *secring; /* s3kr1t key ring */
void *io; /* the io struct for results/errs */
void *passfp; /* file pointer for password input */
} netpgp_t;
/* begin and end */
int netpgp_init(netpgp_t *);
int netpgp_end(netpgp_t *);
/* debugging, reflection and information */
int netpgp_set_debug(const char *);
int netpgp_get_debug(const char *);
const char *netpgp_get_info(const char *);
int netpgp_list_packets(netpgp_t *, char *, int, char *);
/* variables */
int netpgp_setvar(netpgp_t *, const char *, const char *);
char *netpgp_getvar(netpgp_t *, const char *);
int netpgp_incvar(netpgp_t *, const char *, const int);
int netpgp_unsetvar(netpgp_t *, const char *);
/* set home directory information */
int netpgp_set_homedir(netpgp_t *, char *, const char *, const int);
/* key management */
int netpgp_list_keys(netpgp_t *, const int);
int netpgp_find_key(netpgp_t *, char *);
char *netpgp_get_key(netpgp_t *, const char *, const char *);
char *netpgp_export_key(netpgp_t *, char *);
int netpgp_import_key(netpgp_t *, char *);
int netpgp_generate_key(netpgp_t *, char *, int);
/* file management */
int netpgp_encrypt_file(netpgp_t *, const char *, const char *, char *, int);
int netpgp_decrypt_file(netpgp_t *, const char *, char *, int);
int netpgp_sign_file(netpgp_t *, const char *, const char *, char *, int, int, int);
int netpgp_verify_file(netpgp_t *, const char *, const char *, int);
/* memory signing and encryption */
int netpgp_sign_memory(netpgp_t *, const char *, char *, size_t, char *, size_t, const unsigned, const unsigned);
int netpgp_verify_memory(netpgp_t *, const void *, const size_t, void *, size_t, const int);
int netpgp_encrypt_memory(netpgp_t *, const char *, void *, const size_t, char *, size_t, int);
int netpgp_decrypt_memory(netpgp_t *, const void *, const size_t, char *, size_t, const int);
/* match and hkp-related functions */
int netpgp_match_keys(netpgp_t *, char *, const char *, void *, const int);
int netpgp_match_pubkeys(netpgp_t *, char *, void *);
int netpgp_validate_sigs(netpgp_t *);
__END_DECLS
#endif /* !NETPGP_H_ */

+ 0
- 15
dist/bindings/python/netpgp.py View File

@ -1,15 +0,0 @@
#! /usr/bin/env python2.5
# netpgp bindings for python
import _netpgppython
# initialisations
n = _netpgppython.new_netpgp_t()
_netpgppython.netpgp_setvar(n, "homedir", "/home/agc/.gnupg")
_netpgppython.netpgp_setvar(n, "hash", "SHA256")
_netpgppython.netpgp_init(n)
userid = _netpgppython.netpgp_getvar(n, "userid")
_netpgppython.netpgp_sign_file(n, userid, "a", "a.gpg", 0, 0, 0)
_netpgppython.netpgp_verify_file(n, "a.gpg", "/dev/null", 0)

+ 0
- 7
dist/bindings/python/netpgppython.i View File

@ -1,7 +0,0 @@
%module netpgppython
%{
#include <netpgp.h>
%}
%include netpgp.h

+ 0
- 119
dist/bindings/python/netpgppython.py View File

@ -1,119 +0,0 @@
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 1.3.31
#
# Don't modify this file, modify the SWIG interface instead.
# This file is compatible with both classic and new-style classes.
import _netpgppython
import new
new_instancemethod = new.instancemethod
try:
_swig_property = property
except NameError:
pass # Python < 2.2 doesn't have 'property'.
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
if (name == "thisown"): return self.this.own(value)
if (name == "this"):
if type(value).__name__ == 'PySwigObject':
self.__dict__[name] = value
return
method = class_type.__swig_setmethods__.get(name,None)
if method: return method(self,value)
if (not static) or hasattr(self,name):
self.__dict__[name] = value
else:
raise AttributeError("You cannot add attributes to %s" % self)
def _swig_setattr(self,class_type,name,value):
return _swig_setattr_nondynamic(self,class_type,name,value,0)
def _swig_getattr(self,class_type,name):
if (name == "thisown"): return self.this.own()
method = class_type.__swig_getmethods__.get(name,None)
if method: return method(self)
raise AttributeError,name
def _swig_repr(self):
try: strthis = "proxy of " + self.this.__repr__()
except: strthis = ""
return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)