Commit Graph

1848 Commits

Author SHA1 Message Date
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