Commit Graph

808 Commits

Author SHA1 Message Date
wiz
968fda6223 Fix a typo. 2011-04-28 14:40:42 +00:00
wiz
9b5852d027 Typo fix. 2011-04-28 14:38:49 +00:00
wiz
7dd3adc79d Fix a typo and punctuation. 2011-04-28 14:34:33 +00:00
wiz
7c8df5b473 Fix typo. 2011-04-28 14:29:53 +00:00
wiz
5cdd89dee6 Typo fix. 2011-04-28 14:28:47 +00:00
wiz
b319995661 Improve wording in description. 2011-04-28 14:24:18 +00:00
wiz
2fed8df9e0 Fix typo. 2011-04-28 14:21:52 +00:00
wiz
3643fab3aa Punctuation fix. 2011-04-28 14:18:08 +00:00
wiz
48b93558a9 Fix typo. 2011-04-28 14:16:40 +00:00
wiz
db9c61275b Punctuation fix. 2011-04-28 14:15:53 +00:00
wiz
ce5b3bb1f9 Heimdal is not an OS. 2011-04-28 14:04:02 +00:00
elric
bf89f75cd0 Remove the definition of various X_DEPRECATED as userland has been fixed
to stop using functions defined as deprecated by Heimdal.
2011-04-24 22:24:14 +00:00
elric
d4c49b6d11 Stop using -I/usr/include/gssapi and -I/usr/include/krb5. We must in this
case find kafs.h as krb5/kafs.h.
2011-04-24 14:09:39 +00:00
elric
25a58ef3ee Stop using functions that are marked as deprecated in Heimdal. 2011-04-24 14:01:46 +00:00
christos
1abb5f1349 Fix signed/unsigned warnings. Discover bug where < 0 case cannot happen,
and change it to >= 0 as intended.
2011-04-21 17:58:56 +00:00
christos
aa50e01f38 Don't compare a pointer < 0; this is obviously a missed * here.
While here, remove shadow variable warnings.
2011-04-21 17:56:24 +00:00
elric
fa5d8eb474 openssh and libsaslc depend on heimdal, so we need to wait for it to be
built.
2011-04-20 08:36:07 +00:00
he
847614d665 Some ports don't (need to) construct separate _pic libraries, so where
MKPICLIB != "yes", refer to libipc.a instead of libipc_pic.a.
Fixes the build for mips and vax.
2011-04-16 18:41:58 +00:00
martin
a6bdf6b9f3 Use <sys/atomic.h> ops on NetBSD (instead of MD gcc-isms). Stopgap fix
to unbreak the build on some risc platforms.
OK: elric
2011-04-16 17:45:44 +00:00
elric
9b1e92ba03 Randomness isn't terribly necessary when we are building tools. 2011-04-15 21:03:51 +00:00
elric
649d0dafa9 No need to -lfl -ly. 2011-04-15 21:02:47 +00:00
elric
46d08ee707 We need to include nbtool_config.h when we build tools. 2011-04-15 21:01:22 +00:00
elric
f321446158 Define an empty libinstall:: target instead of the prior methodology
which doesn't necessarily work everywhere.
2011-04-15 20:56:51 +00:00
elric
b125a0825f I forgot to fix this. .BEGIN: is not appropriate for the creation of
these symlinks as during the make obj phase it would attempt to create
them in the current directory.
2011-04-15 19:41:11 +00:00
elric
98fbe74f8c Upgrade Heimdal to 1.5pre1 by switching the build from crypto/dist/heimdal
to crypto/external/bsd/heimdal.  The latter was just imported as the head
of the Heimdal tree as of a few days ago.
2011-04-15 18:05:42 +00:00
elric
f8f7efe31c On reasonably modern versions of Heimdal, you should not include krb5.h
to get the krb5 GSS functions.  gssapi/gssapi_krb5.h should be included.

[this is necesary for the next Heimdal upgrade as krb5.h inclusion is no
longer effective.]
2011-04-15 14:51:22 +00:00
elric
d8282bb7a4 Also define GSSAPI_DEPRECATED and KRB5_DEPRECATED as NULL to complete the
work of the prior check in.
2011-04-15 14:41:11 +00:00
elric
8cb5359ca5 Need a variable to disable using an existent version-script.map as
dist/lib/kadm5 contains one but builds two libs only one of which
uses it.
2011-04-15 14:39:32 +00:00
elric
8263f47726 Fix $Id$ -> $NetBSD$ in our own include. 2011-04-15 12:19:20 +00:00
elric
ecb7f4c28c For the duration of the import and upgrade, we eliminate the marking of
older interfaces as deprecated as this breaks the build and we want to
commit the changes in logical chunks.  We will revert this commit later.
2011-04-15 12:18:22 +00:00
elric
0037cd16e7 Quick makefile bits that will use a version-script.map file if it exists
when building libraries.
2011-04-15 12:16:31 +00:00
elric
df8cd236ea Updates to man pages found as diffs in prior location in a batch. 2011-04-14 19:19:19 +00:00
elric
c5a976719f From prior location. 2011-04-14 18:23:23 +00:00
elric
b20725a7b5 From prior location:
revision 1.2
	date: 2010/04/02 15:26:17;  author: christos;  state: Exp;
	handle ctime returning NULL.
2011-04-14 18:22:35 +00:00
elric
fb2eb8459a From prior location, handle ctime returning NULL.
revision 1.11
	date: 2010/04/02 15:25:04;  author: christos;  state: Exp;
	make it obvious to grep that ctime is being checked.

and

	revision 1.10
	date: 2010/04/02 15:23:17;  author: christos;  state: Exp;
	handle ctime returning NULL.
2011-04-14 18:21:32 +00:00
elric
54d91f2bd2 Turn inetd support back on. 2011-04-14 18:18:16 +00:00
elric
5792ac62ee Also take the $'s out from around $Id.*$ as well as $Id.* $. This change
was required because there are many unexanded $Id$'s in Heimdal when you
git clone.
2011-04-14 18:16:21 +00:00
elric
5d94aee4a8 Replicate changes to get_window_size() made in previous location:
revision 1.7
	date: 2010/01/24 16:45:57;  author: christos;  state: Exp;
	make the window size function return the lines and columns
	variables separately instead of depending on the existance
	of struct winsize. Technically I should bump the library
	version or version the symbol, but nothing seems to use
	this outside the library!
2011-04-14 18:12:08 +00:00
elric
363455e6cf Turn on the hack which disables Kerberos if there is no /etc/krb5.conf.
We should review this logic and come up with a better way to do this as
now that there are DNS SRV RRs for locating KDCs, the lack of a config
does not imply that Kerberos should be turned off.
2011-04-14 18:02:07 +00:00
elric
37b2f04395 Copy coverity alloc comments from old location. 2011-04-14 18:00:30 +00:00
elric
b40995a48b Reimport Heimdal dist converted into NetBSD dist format. The prior
import did not catch all of the $Id$ tags because many of them are
unexpanded and the RE was only looking for expanded keywords.
2011-04-14 14:08:03 +00:00
christos
6a493f9311 no more amd, factor out more stuff. 2011-04-13 22:16:52 +00:00
elric
7a6a7ae08a Build framework for Heimdal. 2011-04-13 19:16:44 +00:00
elric
bca0060340 Autogenerated headers for heimdal head-20110412. 2011-04-13 19:15:27 +00:00
elric
0b13a02041 Autogenerated files for HEIMDAL head-20110412. 2011-04-13 19:08:57 +00:00
elric
b8d761750a Script to convert a git clone of Heimdal into our dist format. 2011-04-13 19:04:40 +00:00
elric
170f4091e1 Autogenerated headers for heimdal head-20110412. 2011-04-13 19:03:58 +00:00
elric
893dd9bedb _gss_DES3_get_mic_compat() requires that ctx->target has been defined, and,
well, it hasn't yet.  Move the call down to after it is defined and things
are better.
2011-04-13 18:30:04 +00:00
elric
f22e4d20b3 Conditionalise the sqlite3 HDB backend. 2011-04-13 18:23:42 +00:00
elric
ca1c9b0c53 Import latest Heimdal from the head of their git repository into the
new location for externally maintained software.
2011-04-13 18:14:29 +00:00
agc
a2e4cd88b7 fix a repeated typo 2011-03-29 21:43:17 +00:00
wiz
f96ea8d1d8 Sort sections. 2011-03-22 09:42:00 +00:00
jruoho
bed0d8a5ad * Remove saslc_strmech(), which does not appear in the sources.
Instead, document saslc_sess_getmech().

* Add FUNCTIONS and describe the functions in a list for readability.

* Sort SYNOPSIS in the order of appearance in FUNCTIONS.

* Split couple of long paragraphs for readability.

* Split the code example into EXAMPLES.

* Add missing prototypes to SYNOPSIS.

* Small markup improvements.

No contextual change.
2011-03-22 07:06:02 +00:00
joerg
9674b81ed9 Introduce __weakref_visible to handle the different required visibility
for weak references. GCC 4.2+ and Clang require static, older GCC wants
extern. Change __weak_reference to include sym. This requires changes
the existing users to not reuse the name of the symbol, but avoids
further differences between GCC 4.1 and GCC 4.2+/clang.
2011-02-22 05:45:05 +00:00
joerg
729a0eaa85 Include bsd.prog.mk to ensure that make includes actually works. 2011-02-20 05:42:34 +00:00
christos
743bf4fef9 Re-do using bsd.files.mk 2011-02-20 05:17:47 +00:00
christos
761d5d7e88 don't install dirs. 2011-02-20 02:14:42 +00:00
christos
0498c1530c Add example configuration file from Anon Ymous and a README file from me. 2011-02-20 02:12:31 +00:00
christos
09484ebb41 improve error handling, from Anon Ymous 2011-02-20 01:59:46 +00:00
christos
acb231545c Property name change:
SASLC_PROP_SERVICENAME ("SERVICENAME")
to
  SASLC_PROP_SERVNAME ("SERVNAME")

Hopefully this will avoid confusion with SASLC_PROP_SERVICE ("SERVICE").
SERVNAME is also closer to the name used in the RFC2831 ("serv-name").
(Discussed with christos@.)

Change the hash parameters to keep that collision-less after the above
name change.

While here, go back to using .Sh in the manpage for unknown section
headers as the PostScript output from .Ss is slightly different.
(Discussed with wiz@.)
2011-02-16 02:14:22 +00:00
christos
1fa7e8d953 From Anon Ymous:
1) Fix a memory leak in cipher_context_create().
2) Fix a goof in the construction of the digest-uri.
3) Allow SASLC_PROP_SERVICENAME to be a hostname qualified comma
delimited list of service names to select from and update the manpage
to reflect this.
4) Make libsaslc.3 pass mdoclint(1).
2011-02-15 18:36:08 +00:00
christos
d02347a68e fix the loop sentinel. 2011-02-14 12:45:31 +00:00
christos
561e85ba95 Make all mechanisms optional, so we can compile in only the ones we want. 2011-02-13 05:39:52 +00:00
christos
beea8b97d4 Fix botched merges of the patch that Anon Ymous sent. From Anon Ymous 2011-02-12 23:21:32 +00:00
christos
16e81cb945 fix size_t inconsistencies. 2011-02-12 22:46:14 +00:00
matt
97519f2fe4 Fix some LP64/IPL32 issues 2011-02-12 22:24:01 +00:00
matt
bb5019fabd Don't use DPADD/LDADD for libraries. Use LIBDPLIBS instead. 2011-02-12 22:23:11 +00:00
christos
e9a3875280 glue in saslc 2011-02-12 19:07:35 +00:00
christos
e43cceb285 just include <sys/types.h>; don't inclue stdbool.h because postfix does not
like it.
2011-02-12 19:03:39 +00:00
wiz
17646a9411 Various formatting fixes and a typo or two. 2011-02-12 16:08:18 +00:00
wiz
35a4803959 Remove trailing whitespace and superfluous Pp before new sections.
Use Nm instead of Xr'ing itself.
2011-02-12 15:58:03 +00:00
christos
1fca038b42 remove NULL check, can't happen. 2011-02-12 14:24:18 +00:00
christos
19c14409b9 Changes from Anon Ymous:
Make this library work.
- several API changes (see the manpage)
- take care to match the spec (hopefully)
- deal with comma delimited lists more systematically
- addition of the DIGEST-MD5 security layer
- syslog messages including debugging messages
- many coding simplifications, changes, rewrites, and additions (i.e.,
  stuff I can't recall at the moment)
- rewrite the manpage

The API changes have been heavily influenced by hooking this up to
postfix(1).

The ANONYMOUS, LOGIN, PLAIN, CRAM-MD5, DIGEST-MD5, and GSSAPI
authentication mechanisms have been tested and shown to work for
authentication with a postfix(1) server using the cyrus-sasl library.
(A postfix(1) libsaslc(3) client wrapper was used for the testing and
will be committed separately.)

The EXTERNAL authentication mechanism should work (it is pretty
simple), but it has not been tested with any servers.

The security layers of DIGEST-MD5 and GSSAPI have also not been tested
with any servers.  Do any SMTP servers really support these security
layers?  Postfix with cyrus-sasl does not, either as a client or
server, even though the cyrus-sasl library has support for the layers.

The new DIGEST-MD5 security layer encode/decode routines have been
tested against themselves (not terribly useful), but nothing else.  As
they use the openssl EVP_* routines (which aren't well documented) to
do the cryptography, the "auth-conf" layer may or may not actually
match the rfc2831 standard.  The "auth-int" layer is much more likely
to be in compliance.

Note: I have left support for a version of AES in the DIGEST-MD5 code
even though it is not part of rfc2831 (May 2000).  This flavor of AES
was in a later draft (June 2003) that was included in the cyrus-sasl
distribution, but changed to a different flavor of AES in subsequent
drafts (and DES disappeared).  AFAIKT, none of those drafts have been
accepted; the last I could find expired in Sept 2007.  rfc2831 is
still listed as standards track.  The AES support is very minor (some
table entries and a few lines of code to construct the IV) and I was
asked to leave it for now.

Hopefully there are not too many bugs, memory leaks, or
spelling/grammar errors.  My apologies in advance.

BTW, if you would prefer to use cyrus-sasl, install it (e.g., from
pkgsrc), and then rebuild postfix with HAVE_CYRUS_SASL defined.
2011-02-11 23:44:42 +00:00
spz
03e283f07f fix for CVE-2011-0014 (OCSP stapling vulnerability in OpenSSL)
patch taken from http://www.openssl.org/news/secadv_20110208.txt
2011-02-10 06:04:54 +00:00
christos
8d527ef179 we have arc4random_buf and uniform now; no need for random.c 2011-02-05 16:01:57 +00:00
spz
0284f45be2 revert previous 2011-02-05 06:42:44 +00:00
spz
8b14c14461 fix compile 2011-02-05 06:23:58 +00:00
christos
afbb9156b8 Fix CVE-2011-0539:
Legacy certificates generated by OpenSSH might contain data
from the stack thus leaking confidential information.
2011-02-04 22:11:09 +00:00
drochner
0bac615281 fix some merge botch and enable cryptodev support on NetBSD again 2011-02-03 19:44:05 +00:00
enami
342e3df70b Note that our installed sshd_config overwrite the LoginGraceTime to 600s. 2011-02-03 04:24:23 +00:00
wiz
c147060a75 Remove trailing whitespace; new sentence, new line; mark up
NULL with Dv; fix Dd argument.
2011-01-29 23:38:34 +00:00
agc
6b63829157 sync sources with sourceforge repository, prompted by Mateusz Kocielski.
+ minor changes to free resources in error cases
+ update return values from some functions
+ wrap some long lines
+ more tests
+ add length argument to digest functions

an additional minor fix to make this build, and to libsaslc.3 man
page, by myself.
2011-01-29 23:35:30 +00:00
christos
f10f86e23c avoid unused variable warning. 2011-01-09 23:17:36 +00:00
stacktic
5df88f3e65 Fixed strvisx usage 2011-01-03 18:55:41 +00:00
agc
70fd33655d avoid a double free - from Anthony Bentley. 2011-01-03 05:34:53 +00:00
agc
61b29b3185 Fix a double free[*], pointed out by Anthony Bentley.
[*] This was actually a triple free. We go all the way to 11.
2011-01-02 18:13:10 +00:00
agc
03e4221328 clean up lint (on amd64) 2011-01-01 23:00:24 +00:00
agc
8f197579aa get rid of some lint on amd64 platform 2011-01-01 22:29:00 +00:00
agc
f14b9450fa Fix a problem with overrunning a base64 decoded number when decoding ssh
keys, from Anthony Bentley.

	% netpgpkeys --ssh -l --hash=md5
	1 key found
	signature  1024/RSA (Encrypt or Sign) 666f47feddcdb77d 2002-07-02
	Key fingerprint: e1d6 b328 8126 e8e3 666f 47fe ddcd b77d
	uid              machinename.com (/home/user/.ssh/id_rsa.pub) <user@machinename.com>

	% ssh-keygen -l -f ~/.ssh/id_rsa.pub
	1024 e1:d6:b3:28:81:26:e8:e3:66:6f:47:fe:dd💿b7:7d /home/user/.ssh/id_rsa.pub (RSA)
	%

ssh keys and netpgp work as above.
2011-01-01 19:53:53 +00:00
christos
3a75b4abed obvious pasto from Anon Ymous 2010-12-18 18:22:24 +00:00
joerg
5aa0f88941 Inline string that should have been const char [] in first place. 2010-12-07 22:50:37 +00:00
drochner
ee60145ccf fix bug introduced by last security patch, from upstream CVS:
Don't assume a decode error if session tlsext_ecpointformatlist is
not NULL: it can be legitimately set elsewhere.
2010-12-07 10:03:29 +00:00
drochner
ad512a613f openssl security patch of the day:
Fix a flaw in the OpenSSL SSL/TLS server code where an old bug
workaround allows malicous clients to modify the stored session cache
ciphersuite. In some cases the ciphersuite can be downgraded to a weaker one
on subsequent connections. See
http://www.openssl.org/news/secadv_20101202.txt
(CVE-2010-4180)
2010-12-07 09:10:21 +00:00
plunky
f33b316b63 Remove the do-external-lib and do-gnu-lib targets, along with
external/lib/Makefile and crypto/external/lib/Makefile, replacing
them all with SUBDIRs directly from lib/Makefile.

compat/compatsubdirs.mk becomes simpler now, as everything is built
from lib/Makefile, meaning all the libraries will now be built under
compat so update the set lists to account for that.
2010-12-03 21:38:46 +00:00
he
1498aa522e Make this build for platforms which don't define HAVE_DLOPEN, notably
our sun2 port.  Eliminates "defined but not used" warnings turned into
errors by our setup.
2010-12-02 10:23:51 +00:00
he
c9162fb054 Don't rely on the shared library dependencies to pull in the ssl and lber
libraries, for the benefit of static linking and our sun2 port.
2010-12-02 10:21:28 +00:00
agc
e914232be0 avoid nameclash - call the generated user id variable "generated userid"
also keep the time of structure initialisation as an internal variable.
2010-12-01 22:14:52 +00:00
agc
735f63ec03 When generating a key, set the new key's userid (last 16 bytes of
fingerprint) as an internal netpgp variable.

This can then be queried using netpgp_getvar(netpgp, "userid") to find the
new key's id.
2010-12-01 22:01:41 +00:00
agc
2f97867c2d fastctype.[ch] source files are gone - use native <ctype.h> 2010-11-29 06:22:20 +00:00
agc
fdfbba4976 I forgot that the fastctype.[ch] files were still in this directory, and
have no need to be here - remove them, and just use native <ctype.h>
2010-11-29 06:21:40 +00:00
agc
ea16259905 Fix PR 44075 from Peter Pentchev, but do this by adding a
--numtries=<attempts> option to netpgp(1) to provide the maximum
number of attempts to retrieve the correct passphrase when signing or
decrypting, and use it in libnetpgp(3).  The default number of
attempts is 3, and a value of "unlimited" will loop until the correct
passphrase has been entered.
2010-11-29 04:20:12 +00:00
agc
231558cb25 Initial import of Mateusz Kociels SASL client library Summer of Code
project into the repository. The project was mentored by Christos
Zoulas, and written up here:

	http://netbsd-soc.sourceforge.net/projects/sasl_client_lib/

As discussed with Christos Zoulas.
2010-11-27 21:23:57 +00:00
adam
1d1ee67612 Removed roaming_common.c from COPTS sections 2010-11-23 07:12:01 +00:00
christos
e0b2bf0fed - Remove ifdefs for roaming support, and enable by default
- Put roaming_dummy.c in libssh.a to satisfy linking needs for most programs
  other than ssh and sshd. ssh and sshd override the shared library (and static
  library) functions by linking in their own copy of the roaming functions.
- Bump libssh major.
- Fix compilation issue in evp hash buffer.
2010-11-22 22:19:53 +00:00
christos
cfdd905320 add a missing GLOB_LIMIT to the new glob for completion. 2010-11-22 13:45:26 +00:00
adam
b1f1f2bb9c Fix compiler warnings 2010-11-22 09:53:01 +00:00
adam
5db11ae917 Updated custom makefiles for OpenSSH 5.6 2010-11-21 19:19:21 +00:00
adam
e2e742d499 We don't need dist/ssh-pkcs11-helper/Makefile 2010-11-21 19:11:09 +00:00
adam
aef795aa71 Merge in our changes:
- Updated OpenSSH-HPN to hpn13v10
- Added OpenSSH-LPK patches to retrive pubkey from LDAP
- Replaced arc4random_buf() (which is not available on NetBSD) with arc4random
- Disabled roaming reconnect (otherwise: problem with undef symbols in libssh)
2010-11-21 18:59:04 +00:00
adam
34b27b53f1 Resolve conflicts 2010-11-21 18:29:48 +00:00
adam
264ec8a849 Imported openssh-5.6 2010-11-21 17:05:52 +00:00
drochner
fe04c71aa0 apply patch from http://www.openssl.org/news/secadv_20101116.txt
to fix a race condition which can be exploited in a buffer
overrun attack (CVE-2010-3864)
2010-11-17 12:09:34 +00:00
wiz
9d2172fc04 Remove trailing whitespace. 2010-11-15 21:29:21 +00:00
agc
6b3f11714a There were still some throwbacks with the prefix '_ops' - rectify that to
be the standard "pgp_" - no functional change.
2010-11-15 08:56:30 +00:00
agc
e2c60ad188 Don't prefix function names with "pgp_" if the functions are static. 2010-11-15 08:50:32 +00:00
agc
451e742596 Use a regular expression to match the various ASCII-armoured headers we
may encounter - fixes PR 44074 from Peter Pentchev in a different way.
2010-11-15 08:27:40 +00:00
agc
05e6b0bbe6 Changes to help with netpgp key generation and interoperability:
+ use plain SHA1 for session key s2k negotiation
+ don't warn on some conditions when inflating (reading a compressed file)
  since the conditions don't hold for partial block lengths
+ prompt for a passphrase when generating a new key - used in the upcoming
  secret-sharing functionality for netpgp
2010-11-15 08:03:39 +00:00
agc
b2d38cefdf Bring the netpgpverify(1) manual page into line with current output, etc.
With thanks to Jeremy Reed for the fixes.
2010-11-11 04:51:18 +00:00
agc
98c5ed6b49 make this compile on amd64: clean up a debug statement, pointed out by jak 2010-11-11 01:08:26 +00:00
agc
b0df0a2281 Changes to 3.99.15/20101110
+ add support for partial blocks, defined in rfc 4880, and used fairly
extensively by gnupg where the input size may not be known in advance
(e.g. for encrypted compressed data, as produced by default by gpg -e)
2010-11-11 00:58:04 +00:00
agc
2e1539dfc7 Rename internal ops-ssh.h header file to ssh2pgp.h to better reflect its
use.
2010-11-07 21:41:38 +00:00
agc
67149907d3 Fix a build problem on OpenBSD (we're not the only one who has trouble
with their header files, it seems - insight from the tor project mailing
list).

And just so that the search engines can find it:

> In file included from ssh2pgp.c:39:
> /usr/include/arpa/inet.h:74: warning: 'struct in_addr' declared inside parameter list
> /usr/include/arpa/inet.h:74: warning: its scope is only this definition or declaration, which is probably not what you want
> /usr/include/arpa/inet.h:75: warning: 'struct in_addr' declared inside parameter list
> *** Error code 1

is fixed by including <netinet/in.h> before <arpa/inet.h> - found after a
long-distance debug session with Anthony Bentley - thanks!
2010-11-07 21:16:00 +00:00
agc
fc1f8641b7 Take the internal functions and definitions back out of the implementation
namespace:

	:g/\<__ops/s//pgp/g
	:g/\<__OPS/s//__PGP/g
	:g/\<OPS/s//PGP/g

No functional change, regression tests complete successfully.
2010-11-07 08:39:59 +00:00
agc
3184965a25 Elgamal encryption and decryption has been done - take it off the list of
tasks to do.
2010-11-07 07:34:27 +00:00
agc
c2430ca2f9 Add Elgamal decryption to netpgp. Inspired by (BSD-licensed) the
Elgamal decryption code from Postgresql by Marko Kreen.

% cp config.h f
% netpgp -e f
netpgp: default key set to "d4a643c5"
% netpgp -d < f.gpg > f.netpgp
netpgp: default key set to "d4a643c5"
signature  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>
encryption 2048/Elgamal (Encrypt-Only) a97a7db6d727bc1e 2010-05-19 [EXPIRES 2013-05-18]
netpgp passphrase:
% ls -al f*
-rw-r--r--  1 agc  agc  5730 Nov  6 23:53 f
-rw-------  1 agc  agc  1727 Nov  6 23:53 f.gpg
-rw-r--r--  1 agc  agc  5730 Nov  6 23:54 f.netpgp
% diff f f.netpgp
%

This makes DSA keys into first class citizens, since encryption and
decryption using DSA/Elgamal is now supported.
2010-11-07 06:56:52 +00:00
agc
37d8b79b30 Add the ability to perform Elgamal encryption to netpgp. Some of this
code is inspired by the (BSD-licensed) Elgamal crypto code in
Postgresql by Marko Kreen, but netpgp uses BIGNUM numbers instead of
MPIs, and its keys have a completely different structure, so much has
changed.

% cp config.h f
% netpgp -e f
netpgp: default key set to "d4a643c5"
% gpg -d f.gpg > f2

You need a passphrase to unlock the secret key for
user: "Alistair Crooks (DSA TEST KEY - DO NOT USE) <agc@netbsd.org>"
2048-bit ELG-E key, ID D727BC1E, created 2010-05-19 (main key ID D4A643C5)

gpg: encrypted with 2048-bit ELG-E key, ID D727BC1E, created 2010-05-19
      "Alistair Crooks (DSA TEST KEY - DO NOT USE) <agc@netbsd.org>"
% diff f f2
% ls -al f*
-rw-r--r--  1 agc  agc  5730 Nov  6 05:40 f
-rw-------  1 agc  agc  1727 Nov  6 05:40 f.gpg
-rw-r--r--  1 agc  agc  5730 Nov  6 05:41 f2
%
2010-11-07 02:29:28 +00:00
agc
83b45ea713 specify the libmj.la archive as a pre-req for libnetpgp.la in the
correct way - tested on RHEL 6 and Mac OS X.
2010-11-06 03:42:59 +00:00
agc
aaec28fcb2 re-run automake to pick up changes to Makefile.am files. 2010-11-06 00:14:35 +00:00
agc
243b0fa9b8 Avoid specifying the manual page twice in the Makefile.am files, which
can lead to problems at installation time on some platforms (RHEL 6,
for example), whereas Mac OS X seems to install things fine.
2010-11-06 00:03:32 +00:00
agc
6ca3cd6172 Apply the patch provided in PR 44047 by Peter Pentchev to fix a problem
in the GNU autoconf infrastructure with ltmain.sh script - change all
occurrences of "$echo" to "$ECHO".

(Incidentally, this does not show up under pkgsrc, since pkgsrc uses
the platform's libtool instead of the script which comes with the
distribution)
2010-11-05 23:37:57 +00:00
agc
863876dc04 Explicitly link netpgpverify with libmj, rather than letting libnetpgp
bring it in.

Fixes a build issue on RHEL 6.
2010-11-05 07:41:20 +00:00
agc
9e1b7959ce Explicitly link netpgp with libmj, rather than letting libnetpgp bring it
in.

Fixes a build issue on RHEL 6.
2010-11-05 07:39:59 +00:00
agc
23e62cae6d Miscellaneous changes to bring the GNU autoconf framework into a state
where a package can be build and install properly.
2010-11-05 03:37:18 +00:00
agc
484002bc2a avoid calling a debug function that's not exported in libnetpgp 2010-11-05 03:30:52 +00:00
agc
e63bd9282f Find the libmj header file in the correct directory 2010-11-05 03:01:57 +00:00
agc
701ed11c84 run autoconf so we can generate a Makefile in src/libmj 2010-11-05 02:50:43 +00:00
agc
2dd0a33d09 generate the Makefile in src/libmj too 2010-11-05 02:36:01 +00:00
agc
9b9aeb8d81 Apply the patch from Peter Pentchev in PR 44041
``When netpgp thinks (even for a little while, even if it
	should change its mind almost immediately) that it's
	processing a detached signature, it sends a message to that
	effect to io->outs.
	This kind of interferes with "netpgp --cat" :)''

Use io->errs instead of io->outs for the informational message.
2010-11-04 16:24:22 +00:00
agc
d22b8667a6 Apply patch from Peter Pentchev in PR 44040
The patch fixes two problems when verifying a clearsigned message:
- a copy/paste error - "litdata" should be "cleartext"
- a use of an uninitialized variable, resulting in freeing
  an uninitialized pointer on the stack... resulting in a segfault
2010-11-04 16:13:35 +00:00
agc
8d65eff422 Note the user-specified cipher has been implemented 2010-11-04 15:40:43 +00:00
agc
4b284f7789 add an additional test for the user-specified cipher 2010-11-04 15:39:42 +00:00
agc
f36027304f allow user-specification of cipher to be used when encrypting packets.
at the user level, this is specified using the --cipher=<ciphername>
option.
2010-11-04 15:39:08 +00:00
agc
f7745f8410 allow user-specification of cipher to be used when encrypting packets.
preserve the CAST5 default for now.

at the user level, this is specified using the --cipher=<ciphername>
option.
2010-11-04 15:38:45 +00:00
agc
c59501b234 Add the new --cipher option to usage message, pointed out by Thomas
Klausner -- thanks, wiz!
2010-11-04 13:45:30 +00:00
wiz
9569e8e4ad Bump date for --cipher. 2010-11-04 09:30:33 +00:00
agc
a4afbbbf7e use the correct manual page name 2010-11-04 07:47:30 +00:00
agc
ea2cbd9f75 Only include camellia cipher if openssl supports it 2010-11-04 07:35:08 +00:00
agc
87dbcd56bd add a Makefile.in file for libmj 2010-11-04 07:33:46 +00:00
agc
722a40f938 autoconf guard for <openssl/camellia.h> 2010-11-04 07:03:41 +00:00
agc
46e6961a97 update version string to 20101103 2010-11-04 07:02:25 +00:00
agc
da498fd5a2 Update base version to 20101103
Add openssl/camellia.h to the list of header files we look for in autoconf

Re-generate configure scripts
2010-11-04 07:01:52 +00:00
agc
f8aefef305 + add ability in netpgpkeys(1) to specify the cipher (symmetric algorithm)
as specified in RFC 5581
+ add the camellia cipher implementation from openssl
2010-11-04 06:46:15 +00:00
agc
3dc7aea18b Update to version 3.99.13:
+ add ability in netpgpkeys(1) to specify the cipher (symmetric algorithm)
  as specified in RFC 5581
+ add the camellia cipher implementation from openssl
2010-11-04 06:45:28 +00:00
agc
839eb285fa put RFC 5581 in the reference section 2010-11-04 06:42:22 +00:00
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
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
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
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
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
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
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
agc
5d13bf3258 At the request of Alan Horn, clarify the purpose of netpgp_get_info(). 2010-06-18 00:20:28 +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