Commit Graph

296 Commits

Author SHA1 Message Date
agc d9a9c03c7b Changes to 1.99.21/20100305
+ clean up some lint
+ the obligatory ''build on mac os x fixes'' - <inttypes.h> header file
2010-03-05 19:58:38 +00:00
agc 62ab1e4abf clean up some lint that crept in. 2010-03-05 16:30:05 +00:00
agc b15ec256c0 Update netpgp to version 1.99.20/20100304 - portability improvements, and bug fixes:
Changes to 1.99.20/20100304

	+ move args to some functions around to be consistent
	+ use uint*_t where appropriate
	+ fix bug in verify memory
	+ add documentation to manual pages to show how to do combined
	  signing/encryption and decryption/verification
	+ make verification of ascii-armoured memory work the same as binary
	+ eliminate use of strdup(3), strcasecmp(3), and strptime(3). NetBSD/pkgsrc
	  PR 42922 applies - need to define _XOPEN_SOURCE and _BSD_SOURCE for
	  newer linux platforms with glibc 2.10.1. solved a bit differently, by
	  implementing strdup(3) and strcasecmp(3) independently, and using regexps
	  to avoid calling strptime(3).
2010-03-05 16:01:09 +00:00
joerg 0cb1711763 Ensure that SHA384 always calls the SHA384 functions.
Should fix PR 42881.
2010-03-01 21:47:43 +00:00
agc b62679aaf5 add the scripts used to test the hkpd.
fwiw, the hkp client script is - essentially - 7 lines of lua, using
libcurl for the http transport.
2010-03-01 07:52:21 +00:00
agc c854a26d0d add an embryonic httpd key server (hkpd) to netpgp. this is based on the
discontinued draft for hkp servers, in lieu of any official rfc.

the post method for adding keys to the server has not been implemented.
not until i've gone through all of the implications, anyway.

hkp servers serve up pgp public keys over http. the default port is 11371,
but it can be any port, specifiable at run time. whilst this hkpd will
return valid html to browsers, it is aimed at the ''machine readable''
side, using the ''&options=mr'' option to the http get string.

this hkpd server will get hooked into the build at a later date.
2010-03-01 07:41:56 +00:00
wiz 506778b851 New sentence, new line; remove trailing whitespace. 2010-02-24 08:22:58 +00:00
agc 156f140565 fix a bug in verifying memory.
add two examples to the netpgp(1) manual page outlining how to sign
and encrypt via a pipeline, and how to decrypt and verify/cat using a
pipeline.
2010-02-23 01:24:44 +00:00
wiz 8f657e21de Fix typo (specifed -> specified). 2010-02-18 14:00:39 +00:00
agc de7c94ffb6 let's get modern int types defined so that netpgp will build on mac os x 2010-02-13 00:14:00 +00:00
agc 0aa60872e9 Changes to 1.99.19/20100212
+ plug some memory leaks, from cppcheck via Thomas Klausner (thanks!)
+ make the singular of time units read correctly
+ print decryption key info properly when prompting for passphrase
2010-02-12 03:38:48 +00:00
agc fef71af2b2 changes to 1.99.18/20100211
small steps, but lots of them - this is the first one.

+ print out the correct key information when signing files and memory.
  what used to be printed out was the copy of the public key which is
  stored as part of the private key(!). does not address the info shown
  when decrypting, since that is done in a different way, by callback.
  this whole part needs to be re-written, but will have to wait for two
  good hands.
2010-02-11 17:46:09 +00:00
agc 2b48e3a662 Update netpgp to version 1.99.17/20100208
Changes to 1.99.17/20100208

+ get rid of last 2 static variables - use the __ops_printstate_t struct
  passed down, and add the indent variable here too
+ get rid of 3 occurrences in reader.c where an automatic buffer was
  addressed (as part of a subsequent callback) by a struct field from
  a calling scope, and only valid within the callback.  Found by
  Flexelint and phk - many thanks.
+ print filename/"memory" when time problems occur when validating signatures
2010-02-08 17:19:11 +00:00
dsl 024dc5b629 Fix printf formats on amd64 (and probably other 64bit systems). 2010-02-06 10:50:52 +00:00
agc 600b302b23 Changes to 1.99.16/20100205
+ minor simplifications to netpgp(1) internally
+ fix a bug in netpgp_verify_file where a non-existent file while listing
  packets would cause a SIGSEGV
+ add duration arg to netpgp(1), and check for validity when verifying
  signatures
+ add birthtime arg to netpgp(1), and check for validity when verifying
  signatures
+ add netpgp commands to print pubkey, if desired
+ allow the passphrase for the signature to be taken from --pass-fd
+ get rid of static indent value when printing packet contents
+ print signature validity times when verifying a file's signature
2010-02-06 02:24:33 +00:00
roy 98eb889579 Userland now builds and uses terminfo instead of termcap.
OK: core@, jdc@
2010-02-03 15:34:37 +00:00
joerg 0fa8619ec0 Fix some POD errors in the OpenSSL man pages. Regen them. Install some
missing man pages.
2010-01-24 21:19:53 +00:00
joerg 92dbe11dbb Make VERSION work with newer OpenSSL. 2010-01-24 19:16:05 +00:00
taca bf8e25a5bf Fix to deal with CVE-2009-4355 from OpenSSL's repositroy. 2010-01-22 03:42:47 +00:00
tonnerre e5ca1f295b Instead of unconditionally disabling SSL3 renegociation, add the flag
SSL3_FLAGS_ALLOW_UNSAFE_LEGACY_RENEGOTIATION which can be set by the
software which needs unsafe renegociation. Patch from OpenSSL CVS.
2010-01-10 16:39:10 +00:00
joerg 3a06db1475 Don't use .Xo/.Xc. Fix date format. 2010-01-08 16:37:39 +00:00
christos 47dc77041d merge changes. 2009-12-27 01:40:46 +00:00
christos 3fab09205c import openssh 5.3 2009-12-27 01:07:02 +00:00
christos bfc463fe1e merge conflicts and undo the session renegotiation disabling code. 2009-12-27 00:48:55 +00:00
christos cef2ee707e import SNAP-20091226 2009-12-26 23:29:52 +00:00
agc bb371892fc Add tests for memory encryption and decryption, and signing and verification
(by pipes).
2009-12-22 07:09:39 +00:00
agc 46c46156b2 Remove a code excerpt which is not ready for primetime just yet 2009-12-22 06:55:03 +00:00
agc 5836ded60b Modify regression test suite behaviour - remove the (error) tests for
commands with no file arguments, as input will now be taken from stdin,
and output will go to stdout, if no file arguments are given on the
command line.
2009-12-22 06:53:26 +00:00
agc 7e08eafcff Fix error in merge of previous change shown up by regression tests. 2009-12-22 06:51:31 +00:00
agc d369874e4b Netpgp changes to 1.99.15/20091221
+ some ssh host keys do not have the username of the generator included
  in the key itself. If there is no username in there, create one.
+ added netpgp_encrypt_memory() and netpgp_decrypt_memory()
+ overhaul netpgp(1) to work with stdin/stdout if no filenames specified:

% netpgp --encrypt < a | netpgp --decrypt > b
netpgp: default key set to "C0596823"
netpgp: default key set to "C0596823"
pub 2048/RSA (Encrypt or Sign) 1b68dcfcc0596823 2004-01-12
Key fingerprint: d415 9deb 336d e4cc cdfa 00cd 1b68 dcfc c059 6823
uid              Alistair Crooks <agc@netbsd.org>
uid              Alistair Crooks <agc@pkgsrc.org>
uid              Alistair Crooks <agc@alistaircrooks.com>
uid              Alistair Crooks <alistair@hockley-crooks.com>
netpgp passphrase:
% diff a b
% ls -al a b
-rw-r--r--  1 agc  agc  15243 Dec 20 08:55 a
-rw-r--r--  1 agc  agc  15243 Dec 21 17:15 b
%

% netpgp --sign < a | netpgp --cat > b
netpgp: default key set to "C0596823"
netpgp: default key set to "C0596823"
pub 2048/RSA (Encrypt or Sign) 1b68dcfcc0596823 2004-01-12
Key fingerprint: d415 9deb 336d e4cc cdfa 00cd 1b68 dcfc c059 6823
uid              Alistair Crooks <agc@netbsd.org>
uid              Alistair Crooks <agc@pkgsrc.org>
uid              Alistair Crooks <agc@alistaircrooks.com>
uid              Alistair Crooks <alistair@hockley-crooks.com>
netpgp passphrase:
Good signature for <stdin> made Mon Dec 21 18:25:02 2009
using RSA (Encrypt or Sign) key 1b68dcfcc0596823
pub 2048/RSA (Encrypt or Sign) 1b68dcfcc0596823 2004-01-12
Key fingerprint: d415 9deb 336d e4cc cdfa 00cd 1b68 dcfc c059 6823
uid              Alistair Crooks <alistair@hockley-crooks.com>
uid              Alistair Crooks <agc@pkgsrc.org>
uid              Alistair Crooks <agc@netbsd.org>
uid              Alistair Crooks <agc@alistaircrooks.com>
uid              Alistair Crooks (Yahoo!) <agcrooks@yahoo-inc.com>
%

+ add explanations of memory-based operations to manual pages
2009-12-22 06:03:24 +00:00
christos c32b972e5f Put the CPPFLAGS in a separate Makefile.inc so that all the defines are
visible in the LIB build. Fixes problem with X11BASE and readpass.c
2009-12-19 18:00:26 +00:00
agc 5761f11cec Preserve the existing value of an extern variable across the call to
process_sign_request2().
2009-12-17 15:55:16 +00:00
agc d028655a8d Bump the netpgp base version to 1.99.14 for the release changes. 2009-12-14 23:35:06 +00:00
agc 9e63cf3fca Prepare for a new netpgp-20091210 portable release.
Apart from infrastructure changes, there are the following functional ones:

+ Update to version 20091210

+ provide a new netpgp_match_list_keys(3) function to perform a
regular-expression based search of all the keys in the keyring.  If no
pattern is specified to match, then all keys are returned.

+ provide a new netpgp_set_homedir(3) function, and use it to set the
home directory from the library, rather than individually in all the
programs which use the library

+ provide a new netpgp_incvar(3) function which will add a constant
increment (which may be negative) to the value of an internal
variable.  This is primarily used for the verbosity level within the
library, and is again a movement of the function into the library from
the individual programs which use the library

+ move to the specification of an ssh key file by internal variable,
rather than the directory holding an ssh key file

+ autoconf infrastructure changes

+ take a hammer to the _GNU_SOURCE definitions problems

+ don't rely on strnlen(3) being present everywhere
2009-12-14 23:29:56 +00:00
agc 1fc3f56acb Minor change (benign everywhere else) to pick up the asprintf(3)
prototype on Linux - caught by Alan Horn.
2009-12-09 22:10:51 +00:00
agc 5674064867 Add a prototype for netpgp_match_list_keys() 2009-12-07 16:56:03 +00:00
martin 071ab236f8 size_t %z police 2009-12-07 16:55:37 +00:00
agc 93d262f9d5 + The internal variable "sshetcdir" has been renamed to "sshkeydir"
+ Take advantage of the new regular expression searching methods
2009-12-07 16:18:44 +00:00
agc 99e2a61b78 The internal variable "sshetcdir" has been renamed to "sshkeydir" 2009-12-07 16:17:57 +00:00
agc 183e04eb84 + When using ssh keys, use the first key as the default userid, unless
specified.

+ The internal variable "sshetcdir" has been renamed to "sshkeydir"

+ When matching the text fields in the username, use an ICASE, NOSUB, EXTENDED
regular expression. This allows more advanced ways of searching, such as:

% netpgpkeys --list-keys '\.de\>'

to find all the keys in the default keyring which have an email address
in Germany. This is actually surprisingly useful.
2009-12-07 16:17:17 +00:00
agc 5b91f35fb9 Fix up some lint.
Change the license on new files to a 2-clause one.
2009-12-06 17:43:05 +00:00
martin f20c48026a printf format fixes to make it compile 2009-12-05 17:23:39 +00:00
wiz e34d48521a Correct Xref to libnetpgp(3). 2009-12-05 10:05:54 +00:00
agc 1e9d36d82d Update the manual page for the addition of ssh host keys. 2009-12-05 07:33:18 +00:00
agc d6c0ee4fff One more thing in the "Done" section - add ssh host keys 2009-12-05 07:21:07 +00:00
agc 561d2d6ad0 Add new files into netpgp lib 2009-12-05 07:17:29 +00:00
agc 91c29c7450 Add the ability to use ssh host keys (on the fly) to provide RSA keys.
These keys can be used in the same way as normal PGP keys - to sign, verify,
encrypt and decrypt files and data.

	% cp configure a
	% sudo netpgp --ssh-keys --sign --userid 1e00404a a
	Password:
	pub 1024/RSA (Encrypt or Sign) 040180871e00404a 2008-08-11
	Key fingerprint: c4aa b385 4796 e6ce 606c f0c2 0401 8087 1e00 404a
	% sudo chmod 644 a.gpg
	% netpgp --ssh-keys --verify a.gpg
	netpgp: default key set to "C0596823"
	can't open '/etc/ssh/ssh_host_rsa_key'
	Good signature for a.gpg made Fri Dec  4 23:04:36 2009
	using RSA (Encrypt or Sign) key 040180871e00404a
	pub 1024/RSA (Encrypt or Sign) 040180871e00404a 2008-08-11
	Key fingerprint: c4aa b385 4796 e6ce 606c f0c2 0401 8087 1e00 404a
	uid              osx-vm1.crowthorne.alistaircrooks.co.uk (/etc/ssh/ssh_host_rsa_key.pub) <root@osx-vm1.crowthorne.alistaircrooks.co.uk>
	% uname -a
	NetBSD osx-vm1.crowthorne.alistaircrooks.co.uk 5.99.20 NetBSD 5.99.20 (ISCSI) #0: Wed Oct  7 17:16:33 PDT 2009  agc@osx-vm1.crowthorne.alistaircrooks.co.uk:/usr/obj/i386/usr/src/sys/arch/i386/compile/ISCSI i386
	%

The ssh host keys do not need to be manipulated in any way - the information
is read from existing files.
2009-12-05 07:08:18 +00:00
christos 4ab80ffe22 Disable SSL V3 session renegotiation since the protocol parameters of the
old session are not cryptographically tied to the new session ones.
NB: Applications that require session re-negotiation will fail after this
update.
2009-12-03 23:44:33 +00:00
agc 7d576ad983 Add python bindings for netpgp, via swig.
When using python, always add the dumb symbolic link to the library name.
2009-12-02 00:32:06 +00:00
agc e5e6e15318 Re-instate perl taint checking by re-defining the possible taint check in
swig. Fix a bug whereby the generated shlib_version file got appended to,
rather than rewritten.
2009-12-01 20:44:50 +00:00