Commit Graph

2075 Commits

Author SHA1 Message Date
agc 3002456f79 Add RFC5581 in the reference section - The Camellia Cipher in OpenPGP 2010-11-04 06:40:25 +00:00
agc 9104ca5d0a check return values from memory allocation routines in symmetric key
initialisation. return an error if allocation failed.

modify symmetric key initialisation function signature to return an
indication of success or failure.

get rid of one-time typedef for function definitions; their indirection
does not add any extra insight, and just obfuscates the declarations.
2010-11-04 01:18:34 +00:00
agc eb60d56a8c Clean up the test home directory in "make distclean"
Patch from Peter Pentchev in PR 44025.
2010-11-03 02:40:34 +00:00
agc 9e52ba5c80 Escape hyphens properly in manual pages, so that groff can handle them.
Patch from Peter Pentchev in PR 44026.
2010-11-03 02:36:12 +00:00
agc 40764fcb17 Don't call exit(3) from library context - brought in with the initial
import, so pink (rather than red) face here.

Pointed out by Peter Pentchev in PR 44027. Thanks!
2010-11-03 02:27:56 +00:00
stacktic fdd702c327 Typo in usage --export-keys -> --export-key 2010-10-31 20:05:04 +00:00
stacktic df2d91557b PR/42435 : Check pointers against NULL to avoid dereferencing them 2010-10-31 19:45:53 +00:00
agc 22b68feadb Make bz2 {de,}compression dependent on the header file being available.
Fixes an error reported by Anthony Bentley when compiling on OpenBSD,
which apparently lacks bzlib.h (and bz2).

Tests run to completion successfully both with and without bz2 being
available.
2010-10-31 18:31:03 +00:00
tteras 0a922db186 Change Linux Netlink address monitoring to monitor local route changes.
This works around a kernel bug, and slightly improves behaviour on some
special cases.
2010-10-22 06:26:26 +00:00
tteras 84874398b5 Introduce priorities for file descriptor polling mechanism and give
priority to admin port. If admin port is used by ISAKMP-SA hook scripts
they should be preferred, other wise heavy traffic can delay admin port
requests considerably. This in turn may cause renegotiation loop for
ISAKMP-SA. This is mostly useful for OpenNHRP setup, but can benefit
other setups too.
2010-10-21 06:15:28 +00:00
tteras af50f9e5f9 Remove initial-contact entry when all ISAKMP-SA are purged via adminport.
This will avoid stale security associations if some of the delete
notifications happens to get lost.
2010-10-21 06:04:33 +00:00
tteras 976b63b0c6 Use high-level openssl EVP and HMAC functions when possible: this allows
openssl to perform hardware acceleration if available.
2010-10-20 13:40:02 +00:00
tteras fa4803bf0a Various improvements to error log messages and a few additional error log
messages to improve diagnosing an error condition.
2010-10-20 13:37:37 +00:00
tteras 49a8dd9d23 Fix address comparison so we actually close sockets which were bound to
IP-address that got deconfigured.
2010-10-20 10:56:39 +00:00
agc b990d6628e 2 minor changes:
+ when writing out the key as an ssh key, don't include the user id
information at the end, in-line with expectations about standard ssh
key formats

+ since the signing key changed its "menu line" entry from "pub" to
"signature", the offset of the key id moved 7 chars to the right, so
take this into consideration when generating new keys
2010-10-19 00:00:00 +00:00
vanhu fe1c6ea2f2 report a higher encryption key length in approval for OBEY / CLAIM / STRICT modes 2010-10-11 14:16:30 +00:00
agc c9aae3a745 fix an off-by-two error when printing out the received key 2010-10-06 10:12:36 +00:00
agc 39e763161d don't try to print a key if an error occurred 2010-10-06 09:58:22 +00:00
agc 29365490e2 fix an off-by-one error when printing the key from the server when retrieving
with the "get" command.

fix up an erroneous error message
2010-10-06 09:57:48 +00:00
vanhu 45f0ad8281 fixed some typos in logs (reported by fazaeli (at) sepehrs.com) 2010-09-27 11:57:59 +00:00
vanhu 1da0e31bfc fixed a fd leak, patch by getlaser (at) gmail.com 2010-09-24 15:09:29 +00:00
vanhu 23e038ba26 get the correct length of username when processing ADMIN_LOGOUT_USER, patch by rweikusat (at) mssgmbh.com 2010-09-22 13:37:35 +00:00
vanhu 40e858e050 fixed a typo in macros, reported by marisp (at) mt.lv 2010-09-22 07:34:51 +00:00
vanhu a4e6ec9d93 moved from utmp.h to utmpx.h (patch provided by marcin.cieslak (at) gmail.com) 2010-09-21 13:14:17 +00:00
agc 6bae07a6a8 Fix previous differently to avoid over-padding the base64 encoded output,
by being smarter in the decode stage.
2010-09-11 04:08:34 +00:00
agc 25825605ed Allow the user specification of the secret key file as the
--sshkeyfile or -S argument, and check that the public key file exists
before trying to read it.
2010-09-10 20:14:19 +00:00
wiz 145da732a5 Fix a typo. 2010-09-10 12:18:48 +00:00
agc b1c86f5f08 Add build glue for the example client and server programs for PAA 2010-09-10 05:30:28 +00:00
agc 0a453369f8 Add build glue for libpaa (not yet hooked into the build) 2010-09-10 05:29:12 +00:00
agc 3fb45f3cb6 Add an implementation of the Pubkey Access Authentication Scheme proposed
by Oliver Gould in

	http://www.olix0r.net/PubKeyAccessAuthScheme.txt

This implementation includes an example client and server program, but
is not (yet) hooked into the build.

To quote from Oliver's RFC:

	HTTP services are a core Internet technology, yet the Digest
	authentication scheme provided by RFC 2617 only describes
	authentication by way of shared-secrets (i.e.  passwords).
	This model has operational drawbacks, as authenticating
	services are required to have access to a user's secret (or a
	hash thereof), or retrograde technologies, such as cookies,
	are employed.

	Similarly to SSH's "publickey" authentication method [RFC
	4252], the PubKey Access Authentication scheme allows an HTTP
	server to authenticate clients using public key credentials.

	Like the Digest Access Authentication Scheme [RFC 2617], the
	PubKey.v1 scheme is based on a simple challenge-response
	paradigm.  The PubKey scheme responds to unauthorized clients
	with a challenge value; and a valid response contains a
	cryptographic signature of client's id, the authentication
	realm, and the server's challenge.

	The client's secret never leaves the client.  The server
	verifies the client's signed authorization request with the
	client's published public keys.

libpaa(3) uses libnetpgp(3) for its digital signatures, SHA1Init(3)
for digests, and base64 encoding for transmission of data.
2010-09-10 05:15:16 +00:00
agc 2f6667e4d4 clean up various bits of lint, and one outstanding bug:
+ properly terminate base64-encoded output, fixes a bug whereby if the input
  length was divisible by 3, a bad base64 encoding would ensue
2010-09-10 04:57:17 +00:00
wiz 394defd16e Add RCS Id, use more markup, use standard section headers,
fill in more fields in ECMA-262 reference.
2010-09-08 22:17:27 +00:00
vanhu 71f4bdc1a9 fixed remoteconf selection when no ID specified in configuration, and added some debug to remoteconf selection 2010-09-08 12:18:35 +00:00
agc 73f34b005f Changes to 3.99.12/20100907
+ add a pretty print function mj_pretty(3) to libmj
+ added netpgp_write_sshkey(3) to libnetpgp
+ added pgp2ssh(1)
+ added preliminary support for ElGamal decryption, needed for DSA keys
  as yet untested, unworking, and a WIP
+ add support for using all ssh keys, even those protected by a passphrase,
  for decryption and signing. This rounds off ssh key file support in netpgp.
+ add a single character alias [-S file] for [--sshkeyfile file] to
  netpgpkeys(1) and netpgp(1)

As far as ssh key file support goes, see the following example:

	% cp configure a
	% netpgp -S ~/.ssh/id_rsa.pub -e a
	% netpgp -S ~/.ssh/id_rsa.pub -d a.gpg
	Enter PEM pass phrase:
	% ls -al a a.gpg
	-rwxr-xr-x  1 agc  agc  758398 Sep  7 05:38 a
	-rw-------  1 agc  agc  156886 Sep  7 05:38 a.gpg
	%
2010-09-08 03:21:21 +00:00
agc 711d29d7f2 clarification comment as to why two of the bignums are reversed 2010-09-07 00:25:37 +00:00
wiz b57aee9386 More markup, end sentence with dot. 2010-09-06 20:33:18 +00:00
agc ba5555346c Add a utility function, netpgp_write_sshkey(3), which will take a PGP public
key (RSA only) and format it as an ssh pubkey.
2010-09-06 18:19:38 +00:00
agc ea98f847ab Add a reachover Makefile for pgp2ssh(1). This utility has not yet been
hooked into the build infrastructure.
2010-09-06 18:17:58 +00:00
agc 13b8cf6624 Add pgp2ssh, a utility to retrieve PGP keys via HKP, and to store the keys
in ssh format. In combination with hkpd (using ssh key files), this utility
can be used to distribute ssh pubkey files to remote computers using the
HKP protocol.
2010-09-06 18:16:52 +00:00
agc 4f0925bb20 If we get passed a key which has no subuids, sigs, fingerprint or any
other data, and has been revoked, don't even attempt to print it out.
2010-09-02 07:31:16 +00:00
agc 0bbf5d4831 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.
2010-09-02 06:00:11 +00:00
agc 267df97bea Update hkpd to return its information in JSON (via libmj).
Add a C HKP client.

Provide reachover Makefiles for each, but do not hook them up to the build
just yet.

The HKP client and server can be embedded in other programs.
2010-09-02 05:58:00 +00:00
agc 46af1e88a3 Bump version number for latest changes 2010-09-01 19:46:14 +00:00
agc 4464721681 Various minor changes to netpgp:
+ be smarter when checking for a null id
+ add test for rubbish being returned when listing specific keys in netpgpkeys(1)
+ take the public key from the pubring, not the secring when exporting
  keys
+ allow hkpd to serve ssh keys in pgp format
+ test on whether a seckey is needed, not on a userid needed, for ssh keys
2010-09-01 17:25:57 +00:00
agc 98c1347b2a Denote the signing key with the word "signature" (the encryption key
already has the tag "encryption"). This is a bit more meaningful than
"pub" and "sub".
2010-09-01 06:20:23 +00:00
agc c2a7bb795c + if we're going to the trouble of testing the return value from the
setoption() function, probably best to return one

+ check for a valid entry in the JSON array instead of trusting that
we have one

+ if there is no JSON value to print, don't print it

+ if we've set the keyring from an ssh key file, then we're using ssh
keys - no need to set that value separately. This means that

	% netpgpkeys --sshkeyfile ~/.ssh/id_test.pub -l
	1 key found
	signature  2048/RSA (Encrypt or Sign) 8368881b3b9832ec 2010-08-26
	Key fingerprint: 3abd bf38 33a5 1f87 d704 ad42 8368 881b 3b98 32ec
	uid              osx-vm1.crowthorne.alistaircrooks.co.uk (/home/agc/.ssh/id_test.pub) <agc@osx-vm1.crowthorne.alistaircrooks.co.uk>

	%

lists ssh pubkeys properly, no need for other tautological arguments
2010-09-01 06:18:21 +00:00
agc f28c63c7c9 Fix a problem reported by moof whereby the build would fail on Sun2 due
to shared library lossage on the Sun2 platform. Sorry, I thought that the
change had already been made, but it was just to netpgpkeys' Makefile.
2010-09-01 06:02:58 +00:00
vanhu 12865805af fix by Sergio.Gelato (at) astro.su.se: duplicate some dynamic values in duprmconf() 2010-08-26 13:31:55 +00:00
reed 75d9fdeb7e Add copyright and license.
I reported this in October 2009 and it was fixed upstream.
http://github.com/heimdal/heimdal/commits/master/kpasswd/kpasswdd.8
2010-08-25 15:08:22 +00:00
agc 67effcdd3a avoid false positives when matching a (non-existent) encryption subkey
use debugging output to point to the matching key
2010-08-21 19:00:43 +00:00
joerg 398cced2a2 Include DHparams_print_fp 2010-08-21 13:47:37 +00:00
agc 593d671c7e get rid of more 64-bit lint 2010-08-15 16:36:24 +00:00
agc 3f685a7839 fix some more amd64 lint 2010-08-15 16:10:56 +00:00
agc 69d4f30f78 + rationalise birthtime/expiration timestamps into a single function
+ clean up some 64-bit (amd64) lint
2010-08-15 07:52:26 +00:00
agc a135dcc2d8 get rid of a debugging statement 2010-08-15 02:39:46 +00:00
agc 9b987001ab Changes to 3.99.9/20100809
+ add single character options to netpgp(1) and netpgpkeys(1)
+ add -o long-option(=value)? options to netpgp(1) and netpgpkeys(1)
+ add some small preparations for using the first subkey for encryption
  (much more to follow)
2010-08-13 18:29:40 +00:00
he d9c41d3081 Add reference to libmj, so that static-linkers (sun2) can make
build progress beyond this point.
2010-08-13 05:16:28 +00:00
drochner f6781b59b4 fix a double free() in error case, see the thread
"openssl-1.0.0a and glibc detected sthg ;)" in openssl-dev.
I was getting a SEGV with the example posted there.
2010-08-10 11:01:00 +00:00
agc 306ca2b851 fix up 64-bit lint 2010-08-07 04:53:56 +00:00
agc 338b88adf7 re-fix this typo once again... 2010-08-07 04:50:35 +00:00
agc d7b1bf3228 catch up with autoconf changes 2010-08-07 04:40:07 +00:00
agc cd0b82c317 Build libraries in the correct order, also waiting for prereqs to build first 2010-08-07 04:34:03 +00:00
agc b142b74bb7 also make the JSON library 2010-08-07 04:27:00 +00:00
agc f06ff54b5a mj.[ch] source files have moved 2010-08-07 04:26:03 +00:00
agc e65cf58b45 mj.c source file has moved 2010-08-07 04:25:19 +00:00
agc ba514e2329 use any alternate location for openssl 2010-08-07 04:23:56 +00:00
agc 7b5aa756da new directory structure - look in the right place for libraries 2010-08-07 04:18:54 +00:00
agc f619980947 NetBSD mk files for JSON functions 2010-08-07 04:17:49 +00:00
agc 922661dde1 Catch up the JSON routines being in their own library. Use the JSON routines
to return all the text as a JSON-encoded string for all keys and sigs which
are returned.
2010-08-07 04:16:40 +00:00
agc 00d25ba4ee Move the minimalist JSON routines into their own library 2010-08-07 04:13:57 +00:00
agc 61ac445f2c Check in mods from Alan Horn to allow an alternate location for (a more
up to date?) version of openssl to be specified at configuration time.
2010-08-06 06:58:53 +00:00
vanhu 4020e47561 fixed answer for IP4_SUBNET request 2010-08-04 09:16:58 +00:00
vanhu 62c45492f0 updated link to NetBSD's documentation 2010-07-30 14:50:47 +00:00
agc 026072e736 fix a build problrm pointed out by moof on source-changes-discuss 2010-07-26 17:24:32 +00:00
agc 736e4816e4 Hook minimalist JSON implementation into the BSD build 2010-07-26 06:40:38 +00:00
agc ae58342f30 hook minimalist JSON sources into the autoconf build 2010-07-26 06:39:43 +00:00
agc 16aefefa5e add a minimalist JSON implementation, and add a new function to access the
data, and serialise it using JSON.
2010-07-26 06:37:35 +00:00
agc 9569eb3a26 be a bit less typedef-happy when it's not needed - no functional change 2010-07-09 15:12:06 +00:00
agc 49d2b5257a minor clean up after ourselves - free a compiled regexp 2010-07-09 14:45:43 +00:00
agc 1223862bd3 update version in generated config.h file to 20100707 2010-07-09 05:37:30 +00:00
agc 275353f256 minor changes to the ssh host key test invocations 2010-07-09 05:36:28 +00:00
agc 520c968fd9 Changes to 3.99.7/20100701
+ recognise ascii-armoured encrypted messages properly, in memory and
  in files
+ print error message and exit for now when trying to encrypt with a DSA key
+ fix bug reported by dyoung when trying to print out the encryption key
  fingerprint
2010-07-09 05:35:34 +00:00
rmind 9444f6bd91 Add missing sys/param.h 2010-07-08 21:16:44 +00:00
christos 8993f5949b Add GLOB_LIMIT to the glob calls to prevent DoS attacks. 2010-07-06 15:09:41 +00:00
mrg 4c92852a80 remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

this doesn't remove any of the support for exec_aout or any actually
required-for-boot a.out support, only the ability to build a netbsd
release in a.out format.  ie, most of this code has been dead for
over a decade.

i've tested builds on vax, amd64, i386, mac68k, macppc, sparc, atari,
amiga, shark, cats, dreamcast, landisk, mmeye and x68k.  this covers
the 5 MACHINE_ARCH's affected, and all the other arch code touched.
it also includes some actual run-time testing of sparc, i386 and
shark, and i performed binary comparison upon amiga and x68k as well.


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
  down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h
2010-07-06 05:59:50 +00:00
agc 2473820b58 take advantage of appropriate defaults when calling ssh key commands 2010-07-01 04:28:33 +00:00
agc f46123a333 if using ssh keys with any of the netpgp programs, set the home
directory appropriately.

add some aliases for long command options across all programs
2010-07-01 04:27:21 +00:00
agc 8aede0d81f Use the correct default ssh user key file (just a typo).
Use the portable strcasecmp() function.
2010-07-01 03:52:13 +00:00
agc 5d9dc9f8e8 check both host and user ssh keys match the host and user keys from netpgpkeys.
also echo the keys being compared
2010-07-01 03:51:07 +00:00
agc c24741dcba factor out the code which recognises ASCII-armour into its own function. 2010-07-01 00:42:51 +00:00
agc 708e54dea7 also calculate the length of DSA keys as well as RSA ones 2010-06-30 15:18:10 +00:00
agc 3f7db2c559 factor out code to append a key to the pubring file.
recognise ascii-armoured headers on keys when importing.
2010-06-30 15:17:40 +00:00
agc ad39646b85 Fix build problems on LP64 platforms - thanks to Paul Goyette for the nudge. 2010-06-25 18:30:16 +00:00
wiz 5cee6a1fc5 Remove trailing whitespace. Use command without path (not
necessary on NetBSD, wrong if installed from pkgsrc). Bump date for previous.
2010-06-25 07:40:35 +00:00
agc 47561e266e Changes to 3.99.5
+ make ssh fingerprints (md5) match netpgp listing
+ use the more functional hexdump function from ssh2pgp in place of the
  older hexdump function from openpgpsdk
+ pass hash type down from command line where needed
+ add test for netpgp/ssh key fingerprint matching
+ make netpgpkeys(1) take a --hash= option

With these changes, netpgp can be made to generate the same fingerprint as
openssh (by default, ssh-keygen(1) uses an md5 digest)

% /usr/bin/netpgpkeys --ssh-keys --sshkeyfile=/etc/ssh/ssh_host_rsa_key.pub --list-keys --hash=md5
1 key
pub 1024/RSA (Encrypt or Sign) fcdd1c608bef4c4b 2008-08-11
Key fingerprint: e935 902d ebf1 76ba fcdd 1c60 8bef 4c4b
uid              osx-vm1.crowthorne.alistaircrooks.co.uk (/etc/ssh/ssh_host_rsa_key.pub) <root@osx-vm1.crowthorne.alistaircrooks.co.uk>

% ssh-keygen -l -f /etc/ssh/ssh_host_rsa_key.pub
1024 e9:35:90:2d:eb:f1:76:ba:fc:dd:1c:60:8b:ef:4c:4b /etc/ssh/ssh_host_rsa_key.pub (RSA)
%
2010-06-25 03:37:27 +00:00
wiz 432f682f2f Bump date for previous. 2010-06-22 20:51:04 +00:00
vanhu 9049130b27 added a specific script hook when a dead peer is detected 2010-06-22 09:41:33 +00:00
agc 5d13bf3258 At the request of Alan Horn, clarify the purpose of netpgp_get_info(). 2010-06-18 00:20:28 +00:00
wiz ee938d1113 New sentence, new line. Bump date for previous. 2010-06-04 21:53:36 +00:00
vanhu a0bdaf1b16 Added support for spdupdate command in setkey 2010-06-04 13:06:03 +00:00
agc 79874ba501 Check for a null keyring before listing keys - with thanks to Jeff Rizzo
for the problem report.
2010-06-02 03:38:01 +00:00
agc d4dd9b7f87 commit version number change 2010-06-02 03:15:14 +00:00
agc c1b0e8cc6b avoid another compiler warning 2010-06-01 06:07:56 +00:00
agc b74565db46 remove an unused variable 2010-06-01 06:01:29 +00:00
agc 2ecd1d0a69 Update netpgp to 3.99.3
Changes since 3.99.2:
+ avoid possible free() of new value passed to netpgp_setvar(),
  with thanks to Anon Ymous.
+ netpgpkeys(1):  print keys to stdout, not stderr - reported by Anon
  Ymous.
+ fix DSA signatures and verification
+ simplify and shorten the internals of packet processing by getting rid of
  the intermediate pseudo-abstraction layer, which detracted from understanding
  and had no benefit whatsoever. Rename some enums and some definitions.
+ add some checking to new key generation, and don't try to read in
  the keys after writing them - reported by Tyler Retzlaff
2010-06-01 05:55:55 +00:00
agc 0e3d0b8191 make sure we have created a directory when generating a new key.
don't try to re-read the key after writing it - that's done by a separate
function. Problem found by Tyler Retzlaff, fixed in a different way.

check that keyrings are non-NULL before attempting to free them - from a
nudge by Tyler Retzlaff.
2010-06-01 05:22:38 +00:00
agc 9fc2904ac1 when cleaning up, don't try to free the public key which is part of the
secret key - shown up by Mac OS X malloc.
2010-06-01 03:19:26 +00:00
agc 806171a804 catch up with new structure for netpgpverify - from Tyler Retzlaff 2010-05-31 06:09:41 +00:00
agc 352d609304 WARNS=5 now 2010-05-25 01:06:41 +00:00
agc d427c17d1e Simplify and shorten the internals of packet processing by getting rid of
the intermediate pseudo-abstraction layer, which detracted from understanding
and had no benefit whatsoever. Rename some enums and some definitions.
2010-05-25 01:05:10 +00:00
agc 2f931ff55c correct indentation - no functional change 2010-05-21 14:28:44 +00:00
agc b70f7cde8e Protect against NULL pointers in key output in a different way - only
advance its counter if it's non-NULL.

Regression test for this is:

	netpgpkeys --list-key '\.de\>'

with my standard keyring (to list all keys which have at least one subuid
with a German email address).
2010-05-21 06:53:51 +00:00
agc 85e1ce333a avoid a duplicated error message 2010-05-20 14:43:42 +00:00
agc 8f036637a6 extend the resolve_userid() function to take a keyring, and use it for
functions which require a secret key as well.
2010-05-20 14:42:21 +00:00
agc c2035aa4d5 add a static function to resolve the userid in one place, and start to use it 2010-05-20 00:36:31 +00:00
agc 9ec81417ee The experiment in keeping a separate, trimmed-down codebase for just the
verify functionality was useful, but the time has come to learn lessons
and move on.

Replace the trimmed down code with a call to the verification code from
libnetpgp(3).
2010-05-20 00:33:01 +00:00
agc 0eeb5498cc One more reason not to use DSA keys:
The DSA algorithm seems to require a digest value which is 20 bytes
long, which kind of implies SHA-1.

If we have a DSA signature, use SHA-1 as a hash algorithm, for backwards
compatibility. RSA signatures continue to use SHA256 by default, although
this can be given as an argument, if desired.

This fixes DSA signatures with netpgp:

% netpgp --sign --userid d4a643c5 a
pub 1024/DSA 8222c3ecd4a643c5 2010-05-19 [EXPIRES 2013-05-18]
Key fingerprint: 3e4a 5df4 033b 2333 219b 1afd 8222 c3ec d4a6 43c5
uid              Alistair Crooks (DSA TEST KEY - DO NOT USE) <agc@netbsd.org>
sub 1024/DSA 8222c3ecd4a643c5 2010-05-19 [EXPIRES 2013-05-18]
netpgp passphrase:
% netpgp --verify a.gpg
Good signature for a.gpg made Tue May 18 05:41:25 2010
using DSA key 8222c3ecd4a643c5
pub 1024/DSA 8222c3ecd4a643c5 2010-05-19 [EXPIRES 2013-05-18]
Key fingerprint: 3e4a 5df4 033b 2333 219b 1afd 8222 c3ec d4a6 43c5
uid              Alistair Crooks (DSA TEST KEY - DO NOT USE) <agc@netbsd.org>
sub 1024/DSA 8222c3ecd4a643c5 2010-05-19 [EXPIRES 2013-05-18]
%
2010-05-19 02:50:16 +00:00
agc 8755cbec2a When setting up res (results), errs (error) and outs (outputs) streams,
change the pre-defined stdio streams to be denoted by "<stdout>" and
"<stderr>", to distinguish them from file names.

In netpgpkeys(1), send the default "res" (results) stream to stdout,
rather than stderr. Requested by Anon Ymous (and makes perfect sense).
2010-05-16 06:48:52 +00:00
agc b4f06d28e0 Avoid a possible overwrite of a value in the (key, value) array, in
the event that a reference to the value is passed to the
netpgp_setvar() function as the new value.  Problem noted, cause
detected, and most of the fix contributed by, Anon Ymous.  Thanks!
2010-05-16 06:21:14 +00:00
agc 37bb0457f6 fix a piece of lint 2010-05-16 02:46:25 +00:00
joerg c0597ae815 RETURN VALUES -> EXIT STATUS 2010-05-14 17:27:35 +00:00
joerg db8ff3b4ab Fix .Dd format. 2010-05-14 01:46:04 +00:00
joerg 5289091371 Fix date. Fix trailing whitespace. 2010-05-14 01:44:05 +00:00
jnemeth ee8753142e Fix tunnelling (ssh -w). The kernel expects a device to be passed
to the socked, not a path.
2010-05-10 20:28:05 +00:00
agc 5111f71337 if the home directory does not exist, still set its value as a netpgp
variable, as the netpgpkeys(1) program, for one, will try to create the
home directory if it does not exist.

should fix PR 42435
2010-05-08 04:17:45 +00:00
agc 763a92f619 create the home directory, if it doesn't exist, in a slightly less opaque manner 2010-05-08 04:16:20 +00:00
agc 313fa53dd5 use the correct filed type for a size_t 2010-05-08 02:54:25 +00:00
agc 5c29ffdc5b regen for netpgp 3.99.2, 20100507 version 2010-05-08 02:45:45 +00:00
agc 3c1d4d3626 enumerate all the tests to see easily which ones failed.
add a test for signed armored detached signature and verification
2010-05-08 02:18:05 +00:00
agc a6115c8c26 more uses of hexdump() rather than open-coded equivalents 2010-05-08 02:17:15 +00:00
agc 651dd2889a use hexdump() where possible.
get rid of all traces of dmalloc - it's not used anymore. we can now g/c
initialisation functions which do not do anything.

also get rid of the pkeyid() functions, which just prints a
hexadecimal string
2010-05-08 00:33:28 +00:00
agc afcc02d5b5 use hexdump() function where appropriate.
change the way that we generate a detached signature file, so that ascii
armour is used if --armor is specified. addresses PR 43248 from Juan RP.
2010-05-08 00:31:07 +00:00
agc c31f7586f7 minor cosmetic indentation fixes - no functional change 2010-05-08 00:27:08 +00:00
agc 026af9fa14 don't try to be too clever and guess the signature file name from the
raw data - just conform to expected practice, and only infer names if
given an ascii armoured detached signature, or a binary detached
signature.
2010-05-08 00:26:39 +00:00
agc 3c9ac68a81 not much point in defining a function to dump in hexadecimal if we don't
use it.
2010-05-08 00:24:47 +00:00
agc 2c8603b102 Sync with reality using patch provided by Juan RP in PR 43259. Thanks! 2010-05-07 16:29:09 +00:00
agc 24bfedc52f Don't rely on \r\n line endings when doing comparisons on strings for
the presence of ASCII armored signatures. Be consistent with the spelling
of certain transatlanticly-munged words.
2010-05-07 16:22:39 +00:00
agc 3644eb843e Overhaul the mechanism used to decide what is a detached signature, and
a detached armoured signature, as well as just a plain standard signed
file.

This is in response to PR 43245 from Juan RP, and addresses the
verification of detached armoured signatures, but in a different way
to the patch provided in the PR which is hopefully more generic, and
less reliant upon size of detached signature files.
2010-05-07 16:20:07 +00:00
agc 4a8a90f84b Remove a duplicate example - from Juan RP in private mail - thanks! 2010-05-07 05:58:25 +00:00
agc 3b87f49f1b refer to the key fingerprint, and show how to find it in normal output. 2010-05-07 05:55:46 +00:00
agc 9ce8176ea5 Make this compile with gcc 4.5 - patch from Juan RP in PR pkg/43244 2010-05-04 00:02:46 +00:00
wiz 45d13a5b07 Fix date strings. 2010-04-29 18:14:09 +00:00
tron ed8d7a6df6 Don't mention "umac-64@openssh.com" MAC algorithm which is not enabled
in our SSH client and daemon as it causes crashes on architectures which
strict aligment requirements (e.g. NetBSD/sparc64).

This fixes PR bin/43221 by myself.
2010-04-29 17:56:53 +00:00
agc 902794345f update python bindings to work with newer library interface 2010-04-28 14:41:13 +00:00
agc cc1edcab1c refresh the perl bindings to catch up with the changes in the library 2010-04-28 14:01:27 +00:00
wiz 5543ce710d Remove trailing whitespace; use standard section headers. 2010-04-14 08:14:26 +00:00
agc 67957bdf5e Update netpgp to version 3.99.1
Changes to 3.99.1/20100413

+ bump major command versions to be compatible with shlib major
+ fixed a number of bugs in (RSA) key generation
+ modified netpgpkeys(1) to take an optional argument to --generate-key
  if the argument is provided, it is used as the equivalent of the gecos
  field for the newly-generated key.
2010-04-14 06:31:23 +00:00
agc a01ab05761 WARNS=4 fix for an unused arg 2010-04-14 06:23:37 +00:00
agc 8c81a236f7 add a test for RSA key generation 2010-04-14 06:22:55 +00:00
agc dbd4d2db70 sync manual page with reality, catch up with key generation 2010-04-14 04:01:55 +00:00
agc d10356af5f allow the user to pass the equivalent of the gecos information into the
key generation function.
2010-04-14 00:26:25 +00:00
agc 38beab948a get rid of a hardcoded test for the hash agorithm being SHA1, which was just
plain wrong these days.

don't duplicate functionality needlessly.
2010-04-14 00:25:10 +00:00
agc b286ee594c allow the desired hash algorithm to be passed down from the user to the place
where it matters - change the required prototype.
2010-04-14 00:24:00 +00:00
agc 77e396863d use a better name for a key in a function - no functional change 2010-04-14 00:23:09 +00:00
agc 10cd83189e Fix (RSA) key generation.
Part of the fix for PR 42435 from Jukka Ruohonen.
2010-04-14 00:22:21 +00:00
agc f0264dce79 Fixes to make key generation work properly - duplicate the public key RSA
BIGNUM fields - part of long-standing bug inherited from openpgpsdk.

Part of the fix for PR 42435 from Jukka Ruohonen.

Also pass the desired hash algorithm down, so that SHA1 is no longer
hardcoded.
2010-04-14 00:21:40 +00:00
agc ed10b84f91 optimise one function a bit 2010-04-14 00:19:52 +00:00
agc b71b7b3dbc remove a comment which makes no sense any longer - subkey logic is done elsewhere 2010-04-14 00:19:22 +00:00
agc 4312921835 Don't warn about erroneous errors in skey_checksum_finaliser().
Allocate space for the checkhash before attempting to use it - a
long-standing bug from openpgpsdk.  Part of the fix for PR 42435 from
Jukka Ruohonen.
2010-04-14 00:18:46 +00:00
joerg 1236f09bea Regen with modern pod2man and drop trailing whitespace. 2010-04-12 18:03:46 +00:00
joerg c987ee8936 Rename management target to not overlap with the normal mk rules.
Explicitly drop trailing whitespace after pod2man.
2010-04-12 18:02:46 +00:00
joerg 86c2d11e12 Regen man pages with modern pod2man to get more normalised version. 2010-04-12 17:59:37 +00:00
joerg 1e8d9fce59 Add management target for the man pages. 2010-04-12 17:58:40 +00:00
bouyer 769c627b01 Fix crash in openssl (I suspect caused by malformed packets):
handshake_dgst[] may be used without being allocated, causing NULL
pointer dereference.
Fix by checking that handshake_dgst is not NULL before use.
Reported to openssl as ticket openssl.org #2214.
Fix tested on netbsd-5 by Luke Mewburn with apache, and by me with
freeradius (fixing segmentation fault in both cases).
2010-04-09 04:34:13 +00:00
vanhu ba30b496b8 by Eric Preston: fixed a typo 2010-04-07 14:53:52 +00:00
christos f1b28409da ctime can return NULL 2010-04-04 01:36:03 +00:00
christos 4167ec87c5 make it obvious what ctime it is used for. 2010-04-02 15:28:16 +00:00
christos ec03fa3be9 handle ctime returning NULL. 2010-04-02 15:26:17 +00:00
christos 467b66f1cd make it obvious to grep that ctime is being checked. 2010-04-02 15:25:04 +00:00
christos ef20b5e868 handle ctime returning NULL. 2010-04-02 15:23:17 +00:00
christos 53ab8e0b3c make it obvious what ctime is used for. 2010-04-02 15:19:02 +00:00
christos bd7ae6bd09 handle ctime returning NULL. 2010-04-02 15:13:26 +00:00
mrg 10c07693d7 for now, use the C versions of bn and des, not the (32 bit) versions,
on powerpc64.

from dennis.c.ferguson@gmail.com in PR#43073.
2010-03-30 07:23:51 +00:00
bouyer 542d193bfe Apply patchset 19476 from openssl repository, fixing CVE-2010-0740.
from http://www.openssl.org/news/secadv_20100324.txt:
"In TLS connections, certain incorrectly formatted records can cause an OpenSSL
client or server to crash due to a read attempt at NULL".
2010-03-28 11:32:29 +00:00
joerg 57d3f386e1 Quote lines that start with . and should appear literally. 2010-03-20 20:34:56 +00:00
uwe 2ff643e1f6 Move openssl to the front of SUBDIR list and add .WAIT after it since
both netpgp and openssh depend on it.  This should fix intermittent
failures of parallel builds (as seen e.g. on the autobuild cluster).
2010-03-20 02:07:33 +00:00
wiz 5bf3ce156d Sort options. Capitalize first letter in sentence. Use standard
section headers.
2010-03-16 08:29:09 +00:00
agc 65386b7262 Changes to 2.99.2/20100315
+ make subkey sigs available by hkp as well as on the command line
+ use the sketchily-defined vindex option to the hkp protocol to
  return the subkey signature information
+ add a netpgp_unsetvar() function as a corollary to netpgp_setvar()
+ use a variable name of ''subkey sigs'' to denote that subkey
  signatures should be returned with the pubkey uids
2010-03-16 04:14:29 +00:00
agc 298da0bcbe kill 2 benign errors - don't try to listen on a socket if it's not been
opened and bound.
2010-03-16 00:24:49 +00:00
agc aa9b203774 various changes to the hkpd server
+ add a man page for hkpd(8)
+ add support for ipv6 as well as ipv4. individual families can be specified
  on the command line using the -f argument. default to inet4 and inet6.
+ rationalise the process of getting a socket and binding to it for hkpd.
2010-03-16 00:22:52 +00:00
agc 66373914f1 catch up with the change in signature (hah!) for netpgp_list_keys(3). 2010-03-14 00:55:32 +00:00
agc 5aae2c74b0 Changes to 2.99.1/20100313
+ add functionality to parse basic signature subkeys
+ in doing so, add expiration of keys
+ at the same time, add revocation of keys
+ recognise the primary user id, and use it when displaying user ids
+ recognise self signed keys and subkeys
+ rework the indentation of output
+ add the --list-sigs [userid] option to netpgpkeys(1)
+ use memcmp(3) rather than strcmp(3) when checking binary user ids to
  be exported
+ add expiration display to subkey signature output
+ update libnetpgp library version major number to 3
2010-03-13 23:30:40 +00:00
agc 989a0aa6c2 make sure that the expiration date and time are attached to the correct key 2010-03-12 01:22:01 +00:00
christos fcbd1014fb PR/42363: Yasuoka Masahiko: Second part of the patch: iterate only on the
phase2 handles that are bound by the given phase1 handle.
2010-03-11 15:44:48 +00:00
agc 582004928e ensure that we have an element in the array before we try to store a value
in it.
2010-03-08 08:56:03 +00:00
agc c973dd493c Changes to 1.99.22/20100307
+ add key expiry information to public key information display
2010-03-08 07:37:23 +00:00
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
tteras e3413574b5 From Stefan Bauer: Fix multiple typoes and manpage formatting errors. 2010-03-05 06:47:58 +00:00
vanhu 709abc828e From Pierre POMES: fixed admin port initialization 2010-03-04 15:13:53 +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
snj ccaf1e96be Fight the ever-increasing size of src checkouts by spelling "useful"
without an extra l.
2010-02-28 15:52:16 +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