Commit Graph

2192 Commits

Author SHA1 Message Date
tteras cd00f2949d Have privilege separation child process exit if the parent exits. 2011-08-12 05:21:50 +00:00
agc 6b77872003 default the format for recovering key data to be "human", rather than hard
coding it in the embedded calls.
2011-08-02 07:18:13 +00:00
agc 7c7d9aa184 plug some memory leaks in error paths 2011-08-02 07:16:56 +00:00
agc 5f50489b1b when matching pubkeys, also return the first (pgp) uid for the key in the
resultant key listing

when using json to format keys returned from libnetpgp, also prepare for
machine-readable format ("mr") as well as human ("human"), even though
it's not yet used.
2011-08-02 05:36:45 +00:00
christos 18eab2817e PR/45200: : J. Hannken-Illjes: Scp hangs after sending:
- check for vwrite() instead of read() to avoid read() being renamed by SSP
2011-08-01 15:55:00 +00:00
plunky 84e06c949d revert previous, actually cleanup the *_asn1-template.c files
in Makefile.rules.inc. They are generated when -one-code-file
is passed.
2011-07-31 09:58:19 +00:00
plunky 7d2b0ea36f Clean up intermediate asn1 template files
(this should reeally be fixed in <${HEIMBASE}/Makefile.rules.inc>
but I don't see where since they are not generated for all asn1 sources)
2011-07-31 06:49:03 +00:00
plunky d38e8168f4 cleanup vars.texi 2011-07-31 06:43:56 +00:00
joerg aa1008d816 Drop @GOTPCREL when accessing local variables. For yet unknown reasons,
our version of GNU as decides to silently ignore it. Never versions on
other systems and Clang actually keep it around and create bad object
files. The object files are identical after the changes modulo the GOT
entry in the symbol table.
2011-07-28 20:24:36 +00:00
matt 376bdd7ba0 Workaround around make bug by using an intermediate file/rule. 2011-07-27 03:18:52 +00:00
jym 767a408b3c Get rid of the "rep ret" trick in places where it is not needed. FWIW,
the "rep ret" trick is recommended by AMD as a branch prediction
optimization in certain circumstances (quoting their manual):

- any kind of branch (either conditional or unconditional) that has the
single-byte near-return RET instruction as its target

- a conditional branch that occurs in the code directly before the
single-byte near-return RET instruction.
2011-07-25 19:11:49 +00:00
joerg 9c5ebc857f Works with the integrated assembler again. 2011-07-25 09:36:10 +00:00
joerg f40b364521 Fix obvious logic error 2011-07-25 08:51:10 +00:00
christos 185c8f9719 - Merge conflicts
- WARNS=5
2011-07-25 03:03:09 +00:00
christos 9921411534 from ftp.openbsd.org 2011-07-24 15:08:11 +00:00
jym 714fcad23a Turn AES NI support code into something more readable.
i386 and amd64 both tested with their own chroot. No regression observed.
2011-07-22 22:50:55 +00:00
joerg 5158e28f3b Disable Clang's integrated assembler for the AES-NI files for now.
Somewhere in this mess of .byte streams, corruption happens. Disassembly
only shows slightly different filling of alignment sequences, further
analysis is needed.

XXX This should be rewritten to be proper assembler code
2011-07-17 19:48:31 +00:00
drochner 929391d8b0 remove SSL3_FLAGS_ALLOW_UNSAFE_LEGACY_RENEGOTIATION -- openssl uses
another mechanism now, and these remainders break renogotiation with
(at least) tor and postgres
2011-07-07 18:11:18 +00:00
spz c22e711e00 cpuid and aesni additions for i386 2011-07-05 16:53:58 +00:00
spz 7d2aeb8d2a more pieces to enable using the assembler routines and aes-ni for amd64 2011-07-05 10:42:54 +00:00
spz e910cee8f4 fix some define and cleanliness issues relevant when test compiling
in dist (which we normally don't do)
2011-07-05 10:29:22 +00:00
spz 0d71cd5d7d use aes-ni for i386 also: from jym@ 2011-07-05 10:25:45 +00:00
spz 3619dd3d7c version bump second part 2011-07-05 10:06:10 +00:00
joerg fa1a81643b Fix memset usage. 2011-07-01 02:10:19 +00:00
agc 2008a1289b get some things off the TODO list
when initialising, recognise keys in a different order.

1. read the public keyring

2. if a userid has been specified, use it

3.  if not, check the configuration file (~/.gnupg/gpg.conf) for a
default user id

4, only read the secret keyring if we need to (decrypting or signing)

5.  if signing, and we still don't have a userid, use the first key in
the secret keyring

6.  if encrypting, and we still have no userid, use the first in the
public keyring

ssh keys remain the same as previously.
2011-06-28 03:35:28 +00:00
agc 00f7aade09 re-do the tests so that it's much easier to see at a glance which tests
passed and which failed.
2011-06-28 03:29:38 +00:00
agc e5bfab614c only attempt to load the secret key if we need to (for signing or for
decrypting).
2011-06-27 07:05:31 +00:00
wiz 7b95ccb149 Quote minus so it does not become a dash. 2011-06-25 12:43:03 +00:00
agc e63e4d57f9 change mj library to take an additional argument for a string type,
denoting its length. this allows binary strings to be encoded using
libmj.

escape magic characters in json strings in a more efficient manner.
the previous method was not scalable.

update callers to suit

bump libmj major version number

add examples to the libmj(3) man page
2011-06-25 00:37:44 +00:00
mrg c111245a78 apply some -Wno-error and/or -fno-strict-aliasing.
all of this should be looked at closer, but some of them are not
very trivial.
2011-06-22 02:49:41 +00:00
mrg 7496e29126 adjust a grep pattern to (only) match the right line with GCC 4.5.
from chuq.
2011-06-21 02:19:30 +00:00
mrg 493d341048 various build fixes for gcc 4.5. from chuq. XXX i'm not sure all of
these work properly wtf pointer aliasing, but there are no casts at
least...

the lib/libpuffs/puffs_priv.h is definately a real bug fix.

from chuq.
2011-06-20 09:11:16 +00:00
mrg 75e42fa7da remove most of the remaining HAVE_GCC tests that are always true in
the modern world.
2011-06-20 07:43:56 +00:00
spz 82dcaa0984 - fix a typo in libcrypto.pl
- refresh manpages
2011-06-13 18:53:31 +00:00
spz 9574586d3a fix AES-NI (using David Woodhouse's patch for OpenSSL 1.0.0) & re-enable
inclusion of AES-NI capability
builds, but is untested due to lack of hardware
2011-06-13 14:19:48 +00:00
spz f946e5a9cd remove unhelpful '.file' paths, just name the file itself 2011-06-13 06:22:08 +00:00
christos fd1d0fa83b fix warnings for the patented algos 2011-06-12 16:15:42 +00:00
christos abf33ee14d format fixes, prototype fixes, const fixes 2011-06-11 16:54:56 +00:00
spz f7ec5c1e8b more missing file mentions, kudos Kurt Schreiner (ks at ub.uni-mainz.de) 2011-06-06 13:43:48 +00:00
spz 0f31b40708 more missing files. Are we there yet? 2011-06-06 08:04:19 +00:00
spz 5865763239 add a bunch of files to the lib that we build. 2011-06-06 06:44:57 +00:00
spz 4a68bbbf8c re-gen of the assembler files created these
(changed files were committed previously)
2011-06-06 06:08:52 +00:00
spz 5bf0fb60b1 merge
It builds, which is an improvement to before. It may not work.
AES-NI is disabled and needs to be retrofitted yet
2011-06-05 23:09:44 +00:00
spz 4e3dcb232d Import OpenSSL 1.0.1 stable of 20110605:
this is sort of a sidegrade onto the release branch. Changes against the
last version imported:

*) Backport libcrypto audit of return value checking from HEAD, not
   all cases can be covered as some introduce binary incompatibilities.
   [Steve Henson]

*) Redirect RSA operations to FIPS module including keygen,
   encrypt, decrypt, sign and verify. Block use of non FIPS RSA methods.
   [Steve Henson]

*) Add similar low level API blocking to ciphers.
   [Steve Henson]

*) Low level digest APIs are not approved in FIPS mode: any attempt
   to use these will cause a fatal error. Applications that *really* want
   to use them can use the private_* version instead.
   [Steve Henson]

*) Redirect cipher operations to FIPS module for FIPS builds.
   [Steve Henson]

*) Redirect digest operations to FIPS module for FIPS builds.
   [Steve Henson]

*) Update build system to add "fips" flag which will link in fipscanister.o
   for static and shared library builds embedding a signature if needed.
   [Steve Henson]

*) Output TLS supported curves in preference order instead of numerical
   order. This is currently hardcoded for the highest order curves first.
   This should be configurable so applications can judge speed vs strength.
   [Steve Henson]

*) Add protection against ECDSA timing attacks as mentioned in the paper
   by Billy Bob Brumley and Nicola Tuveri, see:

      http://eprint.iacr.org/2011/232.pdf

   [Billy Bob Brumley and Nicola Tuveri]

*) Add TLS v1.2 server support for client authentication.
   [Steve Henson]

*) Add support for FIPS mode in ssl library: disable SSLv3, non-FIPS ciphers
   and enable MD5.
   [Steve Henson]

*) Functions FIPS_mode_set() and FIPS_mode() which call the underlying
   FIPS modules versions.
   [Steve Henson]

*) Add TLS v1.2 client side support for client authentication. Keep cache
   of handshake records longer as we don't know the hash algorithm to use
   until after the certificate request message is received.
   [Steve Henson]

*) Initial TLS v1.2 client support. Add a default signature algorithms
   extension including all the algorithms we support. Parse new signature
   format in client key exchange. Relax some ECC signing restrictions for
   TLS v1.2 as indicated in RFC5246.
   [Steve Henson]

*) Add server support for TLS v1.2 signature algorithms extension. Switch
   to new signature format when needed using client digest preference.
   All server ciphersuites should now work correctly in TLS v1.2. No client
   support yet and no support for client certificates.
   [Steve Henson]

*) Initial TLS v1.2 support. Add new SHA256 digest to ssl code, switch
   to SHA256 for PRF when using TLS v1.2 and later. Add new SHA256 based
   ciphersuites. At present only RSA key exchange ciphersuites work with
   TLS v1.2. Add new option for TLS v1.2 replacing the old and obsolete
   SSL_OP_PKCS1_CHECK flags with SSL_OP_NO_TLSv1_2. New TLSv1.2 methods
   and version checking.
   [Steve Henson]

*) New option OPENSSL_NO_SSL_INTERN. If an application can be compiled
   with this defined it will not be affected by any changes to ssl internal
   structures. Add several utility functions to allow openssl application
   to work with OPENSSL_NO_SSL_INTERN defined.
   [Steve Henson]

*) Add SRP support.
   [Tom Wu <tjw@cs.stanford.edu> and Ben Laurie]

*) Add functions to copy EVP_PKEY_METHOD and retrieve flags and id.
   [Steve Henson]

*) Add EC_GFp_nistp224_method(), a 64-bit optimized implementation for
   elliptic curve NIST-P224 with constant-time single point multiplication on
   typical inputs.  EC_GROUP_new_by_curve_name() will automatically use this
   (while EC_GROUP_new_curve_GFp() currently won't and prefers the more
   flexible implementations).

   The implementation requires support for the nonstandard type __uint128_t,
   and so is disabled by default.  To include this in your build of OpenSSL,
   use -DEC_NISTP224_64_GCC_128 on the Configure (or config) command line,
   and run "make depend" (or "make update").
   [Emilia K<E4>sper <emilia.kasper@esat.kuleuven.be> (Google)]

*) Permit abbreviated handshakes when renegotiating using the function
   SSL_renegotiate_abbreviated().
   [Robin Seggelmann <seggelmann@fh-muenster.de>]

*) Add call to ENGINE_register_all_complete() to
   ENGINE_load_builtin_engines(), so some implementations get used
   automatically instead of needing explicit application support.
   [Steve Henson]

*) Add support for TLS key exporter as described in RFC5705.
   [Robin Seggelmann <seggelmann@fh-muenster.de>, Steve Henson]
2011-06-05 14:55:58 +00:00
tsutsui 5fbf2258b9 Handle implicit library dependency for static builds:
- libheimbase is required by libkrb5
 - libwind is required by libhx509
2011-06-04 02:08:50 +00:00
drochner b9e08c16fb replace questionable pointer games which could cause reads of
uninitialized memory, from Wolfgang Stukenbrock per PR bin/44951
2011-05-27 18:00:21 +00:00
drochner 0a8dabda40 pull in AES-GCM/GMAC support from OpenBSD
This is still somewhat experimental. Tested between 2 similar boxes
so far. There is much potential for performance improvement. For now,
I've changed the gmac code to accept any data alignment, as the "char *"
pointer suggests. As the code is practically used, 32-bit alignment
can be assumed, at the cost of data copies. I don't know whether
bytewise access or copies are worse performance-wise. For efficient
implementations using SSE2 instructions on x86, even stricter
alignment requirements might arise.
2011-05-26 21:50:02 +00:00
joerg a216da57a6 Default to -Wno-sign-compare -Wno-pointer-sign for clang.
Push -Wno-array-bounds down to the cases that depend on it.
Selectively disable warnings for 3rd party software or non-trivial
issues to be reviewed later to get clang -Werror to build most of the
tree.
2011-05-26 12:56:24 +00:00
he 6cf367a4a1 Fix up Heimdal so that it can be built statically, allowing the
sun2 port to proceed beyond trying and failing to build Heimdal.
This is done by:

1) Stop pretending that libipc is a separate library, and instead
   build it as part of libkrb5.  The version map for libkrb5 needed
   to be updated to expose the required symbols from libipc.

2) The lexer in libhx509 needs to use its own prefix, so that the
   resulting library can be statically linked with a lexer which
   uses the default prefix.  This was hidden because libhx509's
   version map file (which is only used for the shared libs) hid
   away the lexer symbols.  Some defines needed tweaking as well
   to restore buildability.

3) Excplicitly mention all the required libraries in LDADD+= and
   make sure DPADD is set to correspond.  This allows static linking;
   earlier this relied on shared library dependencies to have all the
   libs pulled in.  In the process, convert to single-line LDADD+=
   and DPADD+= settings.  Use Makefile.inc for the common libraries
   to the extent possible.

Successfully built from scratch for i386 and sun2 several times,
and for lots of other ports as well.

Discussed with elric@ and christos@.
2011-05-25 19:21:16 +00:00
joerg e6f855c3ea Kill redundant unused extern. 2011-05-24 14:27:07 +00:00