addressed: CVE-2009-1377, CVE-2009-1378, CVE-2009-1379, CVE-2009-1386
and CVE-2009-1387.
Changes deal mostly with size checking of various elements and fixes
to various error paths.
NAT-T port information. This might break compatibility with some kernels,
but as discussed this is the proper way to pass NAT-T ports and the broken
kernels need to be fixed.
than CTR modes. Also, in order to avoid creating oracles unnecessarily,
change behavior in various situations from "Drop connection" to "Ignore
packets up to 256kB". This affects CBC mode ciphers only.
Patch from OpenBSD.
from another fd's callback. That could lead to still have callback pending
after unmonitoring the fd resulting in a call to null pointer.
This is fixed by making unmonitor_fd now clear the pending fd_set too.
Bug was introduced by my commit in 2008-12-23.
Don't require a userid to be set in the gpg.conf file - it can be set
on the command line when it's needed (for signing and encryption, the
other operations in netpgp(1) will take the userid from the
signed/encrypted file).
Add tests for the lack of a default userid in the config file.
CHANGES 1.99.11 -> 1.99.12
+ only prompt for the passphrase for the secret key if the secret key is
protected by a passphrase
+ portability fix for Mac OS X
+ address keys array from 0 with unsigned indices
+ print results to io->res stream - default to stderr, and set using
netpgp_setvar(..., "results", filename)
+ __ops_keyid()'s third arg was always the size of the keyid array - no need
to pass it
+ get rid of the excessive type-checking in packet-show-cast.h, which wasn't
necessary, and fold all the show routines into packet-show.c
+ introduce a generic __ops_new() and use it for some structure allocation
The original code had dynamic arrays indexed by unsigned indices,
except for the array of keys, which was indexed by a signed integer,
and initialised to -1. Subsequently, when a new id was created, the
index was pre-incremented, and later on, in a different call, the
userid (a different packet) was assigned to the current index. This
has implications for growing the array, for signed comparison checks,
and just general cleanliness.
This change overhauls the construct: don't special case anything,
just address the array from 0, use unsigned indices same as everything
else, and complain if we get a user id for which we haven't received a
public or secret key.
+ fix a bug in decryption whereby a bad passphrase would cause a segmentation
violation
+ fix some regressions in key searching in the underlying find keys routines
+ add C++ declaration protection to the external interface in netpgp.h
+ split out the key management parts of netpgp(1) into netpgpkeys(1)
+ make more use of __ops_io_t structure
+ addition of standalone, stripped-down netpgpverify utility
+ addition of test for --list-packets on an empty file
+ bring forward some simplifications from netpgpverify
+ some name changes
+ get rid of the increment and then decrement keycount around
accumulated data ("it's to do with counting")
+ then use unsigned integers for the size and counts for the
dynamic array of keys, and use the common dynamic array macros
for keys in a keyring
+ if it's a union, let's use it as a union, not a struct
+ modified documentation to correct the --list-packets command (sorry, ver)
+ add a new directory structure for both the distribution and the
reachover Makefiles. The autotest framework has been partially overhauled
but more TLC is needed here.
+ add a --pass-fd=n option so that external programs can provide the
passphrase on a file descriptor without going through the callback,
requested by joerg
+ get rid of __ops_malloc_passphrase() - strdup() works just as well
+ generalise __ops_seckey_forget() to become __ops_forget(), give it a size
parameter, and make it work on things other than secret keys (passphrases
for instance)
+ minor struct field enum renaming
+ minor function call renaming
+ add ops_io_t struct to hold pointers to IO streams, and pass it down
where necessary
+ added to the regression tests
+ get rid of some magic constants, replace with more obvious names
+ zero out the memory used for a passphrase before freeing it in one place
+ made --homedir=d consistent with POLS. Default is $HOME/.gnupg, and
if a directory is specified with --homedir=d, the directory containing
conf file and keyrings is taken to be "d".
+ Luke Mewburn completely overhauled the auto tools infrastructure
+ changed signature (hah!) of some netpgp file management prototypes to
use const char * for file names and user ids, not char * - suggested by
christos
+ change some of the openpgpsdk display functions to return integer values,
and send those values back from the netpgp functions - suggested by
christos
+ rather than passing a shedload of variables to netpgp_init(), get rid
of them, and set variables using the netpgp_[gs]etvar() interface
+ replace some magic constants with descriptive names
+ use a netpgp variable to skip userid checks if necessary
+ add ability to allow coredumps via --coredumps if (a) you have taken
leave of your sanity, and (b) you have some magical persistent
storage which doesn't spare sectors, and (c) you know how to remove
a file securely
+ bumped library version on NetBSD to 1.0 for interface changes
- use automake to generate the Makefile.in
- style reorg in configure.ac
- ensure <openssl/sha.h> provides SHA256_CTX (openssl 0.9.8 or greater)
- move the "build helpers" to buildaux
- add a rudimentary (and not yet functional) test suite
(There's still more to do.)
Per chat with Alistair.
+ get rid of some magic constants
+ revamped regression test script to count number of tests passed
+ made checkhash array in ops_seckey_t dynamic, rather than statically
allocated
+ made mdc array dynamic, and added a length field to mdc for future use
+ revamped usage message to match reality
+ made portable version again for the autoconfed package sources
+ add separate netpgpdigest.h file so that separate digest sizes can be
used without having to include "packet.h" in everything
+ modified regression tests to make it easier to see status messages
+ modified --encrypt, --decrypt, --sign, and --clearsign as well as --cat
to respect the --output argument for the output file. Default behaviour
remains unchanged - if --output is not specified, standard file names
and suffixes apply. Note that --verify has not been changed - this is
for compatibility with gpg, POLA/POLS, and because --verify-cat/--cat
provides this behaviour
+ various minor cleanups
+ fix longstanding pasto where the key server preference packets are
displayed with the correct ptag information
+ up until now, there has been an asymmetry in the command line
options for netpgp(1) - whilst a file may have signature information
added to it with the "--sign" command, there has been no way to
retrieve the contents of the file without the signature. The new
"--cat" option does this (there are synonyms of "--verify-show" and
"--verify-cat") - the signature is verified, and if it matches, the
original contents of the file are sent to the output file (which
defaults to stdout, and can be set with the --output option on the
command line). If the signature does not match, there is no output,
and an EXIT_FAILURE code is returned.
+ revamped netpgp(1) to make it clear what commands are available, how
these commands relate to each other, and which commands take custom
options
+ released and tagged version 1.0.0; development version now 1.99.1
+ get rid of some fields which are no longer needed
+ minor name changes
+ add mmapped field to ops_data_t struct to denote that the array needs an
munmap(2) and not a free(3)
+ add an __ops_mem_readfile() function, and use it for reading files.
The function does mmap(2), and then falls back to read(2) if that fails.
Retire unused __ops_fileread() which had an unusual interface
+ drop sign_detached() from netpgp.c down into signature.c as
__ops_sign_detached()
+ we've had the ability to sign files with a detached signature for
a while now. We can now verify the files using the detached signature
file.
+ in honour of this, update version numbers - 1.0.0/20090517
unsigned or not - just use a single character itself
+ misc cleanup
+ rename cinfo to "output" and ops_createinfo_t to "ops_output_t" to
be a bit more descriptive
+ shorten some long names
+ get rid of test for libgen.h - it's not needed anymore
+ bump to version 0.99.4, and 20090515 sources, regenerate configure and co
+ numerous name changes to be more consistent and more concise
+ add verbosity level to the variables that can be set and retrieved by
netpgp_setvar() and netpgp_getvar()
+ added --verbose option to netpgp(1)
+ add __RCSID() to all files
code was modified to all be in the same directory
+ added netpgp_getvar() and netpgp_setvar(), and use them to get and set the
user id and hash algorithm preference
+ get rid of <stdbool.h> usage - I'm still not sure this is the way we should
be going long term, but the bool changes got integrated with the others,
and are there in cvs history if we want to resurrect them. Correct autoconf
accordingly. Bump netpgp minimus version, and autoconf-based date version.
+ updated documentation to reflect these changes
+ minor name changes
+ remove duplicated code (commented out) in packet-print.c
+ original code contained abstraction violations for hash size - fix them
+ get rid of some magic constants related to length of hash arrays
+ allow a choice of hash algorithms for the signature digest (rather
than hardcoding SHA1 - it is looking as though collisions are easier
to manufacture based on recent findings)
+ move default signature RSA hash algorithm to SHA256 (from SHA1). This is
passed as a string parameter from the high-level interface. We'll
revisit this later after a good way to specify the algorithm has been
found.
+ display the size of the keys in --list-packets
+ display the keydata prior to file decryption
+ if setrlimit exists, set the core dump size to be 0
(with thanks to mrg for the reference implementation)
+ get rid of __ops_start_cleartext_sig/__ops_start_msg_sig abstractions
and just "export" the __ops_start_sig function - the function is not
actually exported, just usable by other __ops functions
+ bump internal version number to 0.99.2, autoconf version to 20090506
+ prettify usage message output
+ __ops_parser_content_t -> __ops_packet_t
+ rename some other long names
51 chars is the record function name length so far
+ preliminary moves to support detached signatures
as yet, incomplete
+ add back command line option to list packets in a signed or encrypted file
+ make __ops_parse() take an argument whether to print errors, and kill the
__ops_parse_and_print_errors() function
+ get rid of some assertions in the code - this is a library - about 100 to go
version of openpgpsdk, and will replace it. Differences between netpgp
and the NetBSD repository version of openpgpsdk are:
+ Wrap source code in GNU autoconf/configure
+ New high-level interface for libnetpgp(3) and netpgp(1)
+ Hide prolifery of local headers in the internal lib directory -
there is now one exported header called netpgp.h
+ Hide all ops_* functions and structs behind __ops_* names
+ Fix long-standing bug - make decryption work with files > 8192 bytes
(fix for signature verification of signed files > 8192 bytes was already
brought forward from the NetBSD repository of openpgpsdk)
+ Use mmap(2) to read files, falls back to read(2) if can't do mmap
+ Compile portable package using libtool
+ Rationalise the number of source files - merge a number of smaller ones
+ Case-insensitive matching of key ids
+ Use PRIsize throughout
+ Use calloc(3) throughout to zero memory
+ Get rid of global symbols which abused a macro
+ Use more descriptive names - remove "_arg_" components, name things for their
purpose, rather than what they are (their type)
+ No more --passphrase= argument to netpgp(1) - this is now always
done through callbacks
+ Report source code date and build date in version number, as well as the
version number itself
This will form the basis of the portable netpgp package.
1) If the length of the banner is zero, don't bother printing it.
This can happen if the remote server has a zero-length /etc/issue
file. Previously, ssh would die with "xmalloc: zero size".
2) strvisx() needs an extra byte for the nul terminator.
we don't have. Replace ".Dd $Mdocdate" with ".Dd Month Day Year" so
that the date comes out right when man pages get built. This will
doubtless need hand conflict resolution whenever these pages are
re-imported.
Note that it would be interesting to have some similar facility for
NetBSD, but I don't think a custom rcs keyword is the right thing --
maybe we can teach groff to parse $Date$
of ${TOOL_COMPILE_ET} seen in lib/*/Makefile, using make(1) suffix rule.
But I have not figured out the best way yet.
(The reason why I want to rewrite them is to strip absolute paths embedded in
/usr/include/krb5/*.h.)
Print out the version number of the openpgpsdk library when showing the
version string.
Parse the existing ~/.gnupg/gpg.conf to get the default user id, if any.
Use the actual size of the arrays in snprintf(), rather than a size which
may or may not be accurate.
Get rid of an unused 8K array on the stack - it's not needed.
the size we've allocated; instead, if the current size is more than 8 MiB,
then add 1 MiB on; current behaviour remains unchanged for re-allocations
less than 8 MiB.
Sort option descriptions.
Describe --passphrase, while it still is supported.
Use more markup.
Comment out block of text that didn't make sense to me in the context.
Punctuation improvements.
all contributions gratefully received.
Also add a convenience header file, which includes the other necessary
openpgpsdk header files - this means that
#include <openpgpsdk/openpgpsdk.h>
will get all the necessary definitions and declarations.
but it seems not).
Bump default number of bits from 1024 to 2048.
Add --armor as a synonym for --armour, and prepare for the great spelling war
of 2009.
Always print fingerprint information for keys when listing them.
Always display the publick key algorithm used (because of a bug, the
algorithm name was being ignored, rather than printed out).
With thanks to uwe for the information to make this portable.
Expose the ops_memory_t structure, since we're now using it outside
its own source file.
Various cosmetic changes, mainly for debugging purposes.
than 8192 bytes long, as the callback data simply assigns any data it
receives to a buffer, and then calls the hash function on that buffer
when EOF is reached.
Use an inefficient temporary workaround for this by holding the memory
in a temporary buffer in the callback argument structure.
argument, they take an *int, and those are not necessarily compatible.
Papering that over with a cast just gets us a warning that
de-referencing a type-punned pointer will break strict-aliasing
rules, which is turned into an error by our WARNS setting.
Instead, change the "num" field in _opt_crypt_t from size_t to int, and
get rid of the now-redundant casts.
when matching userid, cheecck if the given userid has a '@' in it.
If so, treat it as an email address, and search for a case-insensitivee
match for the text in between '<' and '>' delimiters.
Otherwise, look for a case insensitive match on the full name.
On the responder (for instance), there is a need to not only migrate local
and remote addresses of Phase 1 that match previous addresses but also
the local and remote addresses of a Phase 1 *associated* with a migrated
Phase 2. For instance, we have that need when receiving the first
MIGRATE/KMADDRESS message because the old addresses are still the HoA and
the address of the HA (while the peer has contacted us using the CoA and
we have negotiated this address as src attribute in Phase 2). The patch
fixes that by having migrate_ph1_ike_addresses() called from
migrate_ph2_ike_addresses() callback.
library.
A good signature verification now shows the filename, time of signing,
and the public keys of the signatories.
Made the interface much more standard by using any argv components after
the options have been parsed to indicate files, rather than a single
--file=filename long option.
Get rid of all assert() calls in the program - dumping core when an
argument is missing is a trifle uncompromising.
When matching userids, if the given userid contains a '@' character,
consider all characters from the rightmost '<' to the terminating
'>' of the file-based userid to be an email address. If there's no
'@' character, consider the given name as a real name, and match
from the start of the file-based userid. All comparisons are done
using case-insensitive searching. I'll consider implementing regexp
matching when enough chocolate bribes are received.
Rework the internals to call a major internal function, rather than doing
everything in main().
Run the results of all this through indent, since the current sources
bear little resemblance to what went before.
(not such a great idea), use getpass() to get the passphrase.
Various debugging additions.
When verifying files, print out the file name which was verified, and exit
with either EXIT_FAILURE or EXIT_SUCCESS, depending upon the verification
result. This still needs to be reworked to print out the signatory to the
file, and the date of signing.