openssl.git
3 years agoReject out of context empty records
Matt Caswell [Wed, 1 Jun 2016 15:31:11 +0000 (16:31 +0100)]
Reject out of context empty records

Previously if we received an empty record we just threw it away and
ignored it. Really though if we get an empty record of a different content
type to what we are expecting then that should be an error, i.e. we should
reject out of context empty records. This commit makes the necessary changes
to achieve that.

RT#4395

Reviewed-by: Andy Polyakov <appro@openssl.org>
3 years agoFix pipelining bug
Matt Caswell [Wed, 1 Jun 2016 15:25:31 +0000 (16:25 +0100)]
Fix pipelining bug

The number of read pipelines should be reset in the event of reuse of an
SSL object.

Reviewed-by: Andy Polyakov <appro@openssl.org>
3 years agoAdd a BN_mod_word test()
Matt Caswell [Tue, 31 May 2016 10:38:52 +0000 (11:38 +0100)]
Add a BN_mod_word test()

The previous commit fixed a bug with BN_mod_word() which would have been
caught if we had a test for it. This commit adds one.

Reviewed-by: Andy Polyakov <appro@openssl.org>
3 years agoFix BN_mod_word bug
Matt Caswell [Tue, 31 May 2016 10:28:14 +0000 (11:28 +0100)]
Fix BN_mod_word bug

On systems where we do not have BN_ULLONG (e.g. typically 64 bit systems)
then BN_mod_word() can return incorrect results if the supplied modulus is
too big.

RT#4501

Reviewed-by: Andy Polyakov <appro@openssl.org>
3 years agoUnify d2i/i2d documentation.
Rich Salz [Tue, 7 Jun 2016 19:49:08 +0000 (15:49 -0400)]
Unify d2i/i2d documentation.

Make d2i_X509 a generic d2i/i2d manpage.
Pull common stuff out of other d2i/i2d docs.
Update find-doc-nits to know about "generic" manpages.
Cleanup some overlap.
Fix up a bunch of other references.

Reviewed-by: Matt Caswell <matt@openssl.org>
3 years agoNit about pod filenames
Rich Salz [Tue, 7 Jun 2016 17:08:20 +0000 (13:08 -0400)]
Nit about pod filenames

The asdf.pod filename must have asdf in its NAME section.
also check for names existing as a different filename (via Levitte)

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
3 years agoFix potential access of null pointer (pp)
Rob Percival [Tue, 7 Jun 2016 16:01:44 +0000 (17:01 +0100)]
Fix potential access of null pointer (pp)

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1186)

3 years agoAdd an SSL get/set test
Matt Caswell [Tue, 7 Jun 2016 15:35:38 +0000 (16:35 +0100)]
Add an SSL get/set test

We just do the getters/setter for tlsext_status_type. This could be extended
for others in the future.

Reviewed-by: Rich Salz <rsalz@openssl.org>
3 years agoAdd documentation for the newly added SSL_get_tlsext_status_type()
Matt Caswell [Tue, 7 Jun 2016 13:33:07 +0000 (14:33 +0100)]
Add documentation for the newly added SSL_get_tlsext_status_type()

And also for SSL_CTX_get_tlsext_status_type()

Reviewed-by: Rich Salz <rsalz@openssl.org>
3 years agoAdd SSL_CTX_get_tlsext_status_type()
Matt Caswell [Tue, 7 Jun 2016 14:14:14 +0000 (15:14 +0100)]
Add SSL_CTX_get_tlsext_status_type()

Reviewed-by: Rich Salz <rsalz@openssl.org>
3 years agoReturn the value of tlsext_status_type in the return not arg
Matt Caswell [Tue, 7 Jun 2016 14:13:40 +0000 (15:13 +0100)]
Return the value of tlsext_status_type in the return not arg

Reviewed-by: Rich Salz <rsalz@openssl.org>
3 years agoAdd SSL_get_tlsext_status_type() method
Alessandro Ghedini [Tue, 10 May 2016 23:48:49 +0000 (00:48 +0100)]
Add SSL_get_tlsext_status_type() method

The tlsext_status_type field in SSL is used by e.g. OpenResty to determine
if the client requested the certificate status, but SSL is now opaque.

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
3 years agoFix some GitHub issues.
Rich Salz [Tue, 7 Jun 2016 14:54:42 +0000 (10:54 -0400)]
Fix some GitHub issues.

GH1180: Local variable sometimes unused
GH1181: Missing close paren.

Thanks to <wipedout@yandex.ru> for reporting these.

Reviewed-by: Richard Levitte <levitte@openssl.org>
3 years agoSet flag BN_FLG_CONSTTIME earlier
Cesar Pereida [Tue, 7 Jun 2016 13:02:01 +0000 (16:02 +0300)]
Set flag BN_FLG_CONSTTIME earlier

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
3 years agoRemove kq and set BN_FLG_CONSTTIME in k for BN_mod_inverse
Cesar Pereida [Tue, 7 Jun 2016 08:32:23 +0000 (11:32 +0300)]
Remove kq and set BN_FLG_CONSTTIME in k for BN_mod_inverse

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
3 years agoAdd script to find undocumented API
Rich Salz [Wed, 1 Jun 2016 17:10:24 +0000 (13:10 -0400)]
Add script to find undocumented API

Also tweaks to find-doc-nits, including name/synopsis checking.
Ironically, it also reports on duplicated doc names :)

Reviewed-by: Richard Levitte <levitte@openssl.org>
3 years agoDocument the issue with threads and dlopen()
Matt Caswell [Tue, 7 Jun 2016 12:24:01 +0000 (13:24 +0100)]
Document the issue with threads and dlopen()

If using threads and OpenSSL is loaded via dlopen(), and subsequently
closed again via dlclose() *before* the threads are destroyed, then
OpenSSL will not free up the per thread resources. We need to document
this restriction, and provide some guidance on what to do about it.

I did some testing and discovered/verified a few of things (at least
this is the behaviour on Linux):

- Using OpenSSL via dlopen in a mutli-threaded app does leak memory if
threads are destroyed after dlcose() is called.
- In a single threaded environment, or if threads are destroyed prior to
dlclose() being called, then no memory is leaked
- Using the RTLD_NODELETE flag to dlopen solves the above problem
- Interestingly the OpenSSL atexit() handler gets called when dlclose()
is called rather than at application exit (I was worred that it might crash
if there was an atexit() handler for a function that has been unloaded)
- RTLD_NODELETE is a non-standard flag - but it does seem to be fairly
widely supported. As far as I could determine (via google), at least Linux,
Solaris, OpenBSD, FreeBSD, HP-UX all seem to support it.

I also tested on Windows (using LoadLibrary instead of dlopen and
FreeLibrary instead of dlclose) and experienced similar behaviour, except
that (AFAIK) there is no equivalent of RTLD_NODELETE on Windows.

GitHub Issue #653

Reviewed-by: Richard Levitte <levitte@openssl.org>
3 years agoMore doc nits
Rich Salz [Mon, 6 Jun 2016 04:43:05 +0000 (00:43 -0400)]
More doc nits

Update script to look for period or POD markup in NAME section, and
fix them.

Reviewed-by: Andy Polyakov <appro@openssl.org>
3 years agoNOTES.WIN: use secure urls
Viktor Szakats [Sun, 5 Jun 2016 21:43:16 +0000 (23:43 +0200)]
NOTES.WIN: use secure urls
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1175)

3 years agotests: fix the shutting up of the shell
Richard Levitte [Mon, 6 Jun 2016 13:01:50 +0000 (15:01 +0200)]
tests: fix the shutting up of the shell

If we're going to redirect STDERR and STDOUT, it's better to do it by
the book.  This fix is a straight copy of examples in the perlfunc
manual.

Reviewed-by: Matt Caswell <matt@openssl.org>
3 years agoFix the directory target generation
Richard Levitte [Sun, 5 Jun 2016 20:12:04 +0000 (22:12 +0200)]
Fix the directory target generation

The directories for the final products were never registered, it was
plain luck that intermediary files were in the same place and
registered the directory anyway.

Also, scripts are generated directly from source (binaries go through
intermadiary object files), so we need to explicitely make sure to
avoid registering the source directory unless it's an in source
build.

Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
3 years agoDeprecate the flags that switch off constant time
Matt Caswell [Thu, 26 May 2016 09:55:11 +0000 (10:55 +0100)]
Deprecate the flags that switch off constant time

The flags RSA_FLAG_NO_CONSTTIME, DSA_FLAG_NO_EXP_CONSTTIME and
DH_FLAG_NO_EXP_CONSTTIME which previously provided the ability to switch
off the constant time implementation for RSA, DSA and DH have been made
no-ops and deprecated.

Reviewed-by: Richard Levitte <levitte@openssl.org>
3 years agoSimplify dsa_ossl.c
Matt Caswell [Thu, 26 May 2016 09:06:27 +0000 (10:06 +0100)]
Simplify dsa_ossl.c

The dsa_ossl.c file defined a couple of multi-line macros, but then only
used each one once. The macros just serve to complicate the code and make
it more difficult to understand what is really going on. Hence they are
removed.

Reviewed-by: Richard Levitte <levitte@openssl.org>
3 years agoFix DSA, preserve BN_FLG_CONSTTIME
Cesar Pereida [Mon, 23 May 2016 09:45:25 +0000 (12:45 +0300)]
Fix DSA, preserve BN_FLG_CONSTTIME

Operations in the DSA signing algorithm should run in constant time in
order to avoid side channel attacks. A flaw in the OpenSSL DSA
implementation means that a non-constant time codepath is followed for
certain operations. This has been demonstrated through a cache-timing
attack to be sufficient for an attacker to recover the private DSA key.

CVE-2016-2178

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
3 years agos390x assembly pack: improve portability.
Andy Polyakov [Mon, 30 May 2016 20:16:31 +0000 (22:16 +0200)]
s390x assembly pack: improve portability.

Some of the instructions used in latest additions are extension
ones. There is no real reason to limit ourselves to specific
processors, so [re-]adhere to base instruction set.

RT#4548

Reviewed-by: Rich Salz <rsalz@openssl.org>
3 years agotests: Shut the shell up unless verbose
Richard Levitte [Sun, 5 Jun 2016 21:01:24 +0000 (23:01 +0200)]
tests: Shut the shell up unless verbose

In rare cases, the shell we run test programs in may have complaints.
Shut those up unless testing verbosely.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
3 years agoRemove extra include's in synopsis.
Rich Salz [Fri, 3 Jun 2016 20:19:49 +0000 (16:19 -0400)]
Remove extra include's in synopsis.

Reviewed-by: Richard Levitte <levitte@openssl.org>
3 years agoConfigure: complete the changed fuzz option checks
Richard Levitte [Sun, 5 Jun 2016 08:59:31 +0000 (10:59 +0200)]
Configure: complete the changed fuzz option checks

Reviewed-by: Andy Polyakov <appro@openssl.org>
3 years agoSilence misleading test_abort stderr output
Viktor Dukhovni [Sun, 5 Jun 2016 15:13:34 +0000 (11:13 -0400)]
Silence misleading test_abort stderr output

Reviewed-by: Rich Salz <rsalz@openssl.org>
3 years agoConstify X509V3_EXT_*_conf*
FdaSilvaYY [Sat, 14 May 2016 21:09:34 +0000 (23:09 +0200)]
Constify X509V3_EXT_*_conf*

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1074)

3 years agoConstify ASN1_generate_nconf
FdaSilvaYY [Sat, 14 May 2016 21:18:49 +0000 (23:18 +0200)]
Constify ASN1_generate_nconf

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1074)

3 years agoConstify ASN1_generate_v3
FdaSilvaYY [Sat, 14 May 2016 20:23:55 +0000 (22:23 +0200)]
Constify ASN1_generate_v3

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1074)

3 years agoConstify s2i_ASN1_IA5STRING
FdaSilvaYY [Sat, 14 May 2016 21:03:22 +0000 (23:03 +0200)]
Constify s2i_ASN1_IA5STRING

Return directly NULL after ASN1_STRING_set, as it already has set an error code.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1074)

3 years agoConstify s2i_ASN1_INTEGER
FdaSilvaYY [Sat, 14 May 2016 06:59:16 +0000 (08:59 +0200)]
Constify s2i_ASN1_INTEGER

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1074)

3 years agoConstify X509_OBJECT_get_type & X509_OBJECT_get0_X509
FdaSilvaYY [Sat, 14 May 2016 06:58:28 +0000 (08:58 +0200)]
Constify X509_OBJECT_get_type & X509_OBJECT_get0_X509

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1074)

3 years agoClean away the last unixmake vestiges
Richard Levitte [Sat, 4 Jun 2016 18:35:58 +0000 (20:35 +0200)]
Clean away the last unixmake vestiges

Reviewed-by: Rich Salz <rsalz@openssl.org>
3 years agoFix re-used function code
Rich Salz [Sat, 4 Jun 2016 16:28:08 +0000 (12:28 -0400)]
Fix re-used function code

Reviewed-by: Richard Levitte <levitte@openssl.org>
3 years agoIgnore buildtest artifacts.
Rich Salz [Sat, 4 Jun 2016 12:23:11 +0000 (08:23 -0400)]
Ignore buildtest artifacts.

Reviewed-by: Richard Levitte <levitte@openssl.org>
3 years agoAdd developer targets for each subdirectory we have something to build in
Richard Levitte [Sat, 2 Apr 2016 20:26:38 +0000 (22:26 +0200)]
Add developer targets for each subdirectory we have something to build in

Previous build scheme allowed building just the stuff in one
subdirectory, like this:

    make -C crypto/aes

Because the unified only has a top-level Makefile, this is not
possible with it.  This change adds a replacement where each directory
we have something to build in becomes a target in its own right,
allowing building something like this:

    make crypto/aes

The exception is the directory test, because we already have such a
target.

Reviewed-by: Stephen Henson <steve@openssl.org>
3 years agoSpecifiy size of arrays
Kurt Roeckx [Fri, 27 May 2016 19:10:05 +0000 (21:10 +0200)]
Specifiy size of arrays

Reviewed-by: Rich Salz <rsalz@openssl.org>
GH: #1139

3 years agoCheck for overflows in EOC.
Dr. Stephen Henson [Sat, 4 Jun 2016 11:48:00 +0000 (12:48 +0100)]
Check for overflows in EOC.

RT#4474 (partial)

Reviewed-by: Rich Salz <rsalz@openssl.org>
3 years agoAdd support for fuzzing with AFL
Kurt Roeckx [Sat, 7 May 2016 20:09:13 +0000 (22:09 +0200)]
Add support for fuzzing with AFL

Reviewed-by: Ben Laurie <ben@links.org>
MR: #2740

3 years agoRT3895: Remove fprintf's from SSL library.
Rich Salz [Sat, 4 Jun 2016 02:45:47 +0000 (22:45 -0400)]
RT3895: Remove fprintf's from SSL library.

Reviewed-by: Richard Levitte <levitte@openssl.org>
3 years agoMore utils cleanup.
Rich Salz [Fri, 3 Jun 2016 18:49:20 +0000 (14:49 -0400)]
More utils cleanup.

Remove some unused files.
Rename doc-nit-check to be consistent.
Add check for multiple #include in synopsis.

Reviewed-by: Richard Levitte <levitte@openssl.org>
3 years agoMake 25-test_gen.t and 25-test_req.t into one
Richard Levitte [Fri, 3 Jun 2016 23:05:06 +0000 (01:05 +0200)]
Make 25-test_gen.t and 25-test_req.t into one

Since one generates files that the other depends on, there's no
real reason to keep them separate.  Since they were both different
aspects of 'openssl req', the merge ends up in 25-test_req.t.

This also makes cleanup easier.

Reviewed-by: Rich Salz <rsalz@openssl.org>
3 years agoHave some more test recipes clean up after themselves
Richard Levitte [Fri, 3 Jun 2016 22:50:17 +0000 (00:50 +0200)]
Have some more test recipes clean up after themselves

Reviewed-by: Rich Salz <rsalz@openssl.org>
3 years agoWindows build: Remove .manifest files in test/ as well
Richard Levitte [Fri, 3 Jun 2016 22:48:13 +0000 (00:48 +0200)]
Windows build: Remove .manifest files in test/ as well

Reviewed-by: Rich Salz <rsalz@openssl.org>
3 years agoChange inclusion of sys/types.h to stdlib.h in include/openssl/ebcdic.h
Richard Levitte [Fri, 3 Jun 2016 18:28:39 +0000 (20:28 +0200)]
Change inclusion of sys/types.h to stdlib.h in include/openssl/ebcdic.h

Needed to get size_t on Windows

Reviewed-by: Rich Salz <rsalz@openssl.org>
3 years agoAdd inclusion of stdlib.h in include/openssl/mdc2.h
Richard Levitte [Fri, 3 Jun 2016 13:04:22 +0000 (15:04 +0200)]
Add inclusion of stdlib.h in include/openssl/mdc2.h

Needed to get size_t

Reviewed-by: Rich Salz <rsalz@openssl.org>
3 years agoAdd inclusion of openssl/x509.h in include/openssl/tls1.h
Richard Levitte [Fri, 3 Jun 2016 13:05:03 +0000 (15:05 +0200)]
Add inclusion of openssl/x509.h in include/openssl/tls1.h

Needed to get the needed declarations for STACK_OF(X509)

Reviewed-by: Rich Salz <rsalz@openssl.org>
3 years agoGenerate simple build test files
Richard Levitte [Fri, 3 Jun 2016 13:02:10 +0000 (15:02 +0200)]
Generate simple build test files

Generate small test programs to check that external programs can be
built with our stuff at a very basic level.

For now, they check that each of our header files can be included
individually without compile failure.

Reviewed-by: Rich Salz <rsalz@openssl.org>
3 years agoFix documentation error in x509 app certopt flag
Matt Caswell [Fri, 3 Jun 2016 20:49:01 +0000 (21:49 +0100)]
Fix documentation error in x509 app certopt flag

According to the x509 man page in the section discussing -certopt it says
that the ca_default option is the same as that used by the ca utility and
(amongst other things) has the effect of suppressing printing of the
signature - but in fact it doesn't. This error seems to have been present
since the documentation was written back in 2001. It never had this effect.

The default config file sets the certopt value to ca_default. The ca utility
takes that and THEN adds additional options to suppress printing of the
signature. So the ca utility DOES suppress printing of the signature - but
it is not as a result of using the ca_default option.

GitHub Issue #247

Reviewed-by: Rich Salz <rsalz@openssl.org>
3 years agoBIO_printf() can fail to print the last character
Matt Caswell [Fri, 3 Jun 2016 14:53:54 +0000 (15:53 +0100)]
BIO_printf() can fail to print the last character

If the string to print is exactly 2048 character long (excluding the NULL
terminator) then BIO_printf will chop off the last byte. This is because
it has filled its static buffer but hasn't yet allocated a dynamic buffer.
In cases where we don't have a dynamic buffer we need to truncate but that
is not the case for BIO_printf(). We need to check whether we are able to
have a dynamic buffer buffer deciding to truncate.

Reviewed-by: Rich Salz <rsalz@openssl.org>
3 years agocryptodev_asym, zapparams: use OPENSSL_* allocation routines, handle errors
Jonas Maebe [Sun, 8 Dec 2013 16:24:18 +0000 (17:24 +0100)]
cryptodev_asym, zapparams: use OPENSSL_* allocation routines, handle errors

zapparams modification based on tip from Matt Caswell

RT#3198

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
3 years agoHandle a memory allocation failure in ssl3_init_finished_mac()
Matt Caswell [Fri, 3 Jun 2016 10:59:19 +0000 (11:59 +0100)]
Handle a memory allocation failure in ssl3_init_finished_mac()

The ssl3_init_finished_mac() function can fail, in which case we need to
propagate the error up through the stack.

RT#3198

Reviewed-by: Rich Salz <rsalz@openssl.org>
3 years agoUpdate INSTALL instructions
Matt Caswell [Thu, 2 Jun 2016 19:18:33 +0000 (20:18 +0100)]
Update INSTALL instructions

Fill out the INSTALL instructions with more information on Configure
arguments, environment variables and Makefile targets.

Reviewed-by: Richard Levitte <levitte@openssl.org>
3 years agoAdded define for STATUS_SUCCESS
Mat [Thu, 2 Jun 2016 21:38:56 +0000 (23:38 +0200)]
Added define for STATUS_SUCCESS

Use STATUS_SUCCESS instead of 0.
Renamed USE_BCRYPT to RAND_WINDOWS_USE_BCRYPT to avoid possible collisions with other defines.
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1142)

3 years agoAdds casts for 64-bit
Mat [Sun, 29 May 2016 18:44:27 +0000 (20:44 +0200)]
Adds casts for 64-bit

Adds missing casts for 64-bit.
Removed zero initialization of hProvider. hProvider is an "out" parameter of CryptAcquireContextW.
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1142)

3 years agoDefine USE_BCRYPT
Mat [Sun, 29 May 2016 18:38:37 +0000 (20:38 +0200)]
Define USE_BCRYPT

Define USE_BCRYPT
Removed _WIN32_WINNT define
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1142)

3 years agoUse BCryptGenRandom on Windows 7 or higher
Mat [Sun, 29 May 2016 18:23:22 +0000 (20:23 +0200)]
Use BCryptGenRandom on Windows 7 or higher

When openssl is compiled with MSVC and _WIN32_WINNT>=0x0601 (Windows 7), BCryptGenRandom is used instead of the legacy CryptoAPI.

This change brings the following benefits:
- Removes dependency on CryptoAPI (legacy API) respectively advapi32.dll
- CryptoAPI Cryptographic Service Providers (rsa full) are not dynamically loaded.
- Allows Universal Windows Platform (UWP) apps to use openssl (CryptGenRandom is not available for Windows store apps)
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1142)

3 years agoAdd a paragraph on documentation to CONTRIBUTING
Matt Caswell [Fri, 3 Jun 2016 09:51:13 +0000 (10:51 +0100)]
Add a paragraph on documentation to CONTRIBUTING

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
3 years agoFurther update CONTRIBUTING
Matt Caswell [Fri, 3 Jun 2016 09:42:20 +0000 (10:42 +0100)]
Further update CONTRIBUTING

Tweak to the wording on merge commits.

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
3 years agoTweaks to NOTES.PERL
Matt Caswell [Thu, 2 Jun 2016 10:09:13 +0000 (11:09 +0100)]
Tweaks to NOTES.PERL

Fix some typos and other minor amendments to NOTES.PERL.

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
3 years agoUpdate NOTES.WIN
Matt Caswell [Thu, 2 Jun 2016 10:03:45 +0000 (11:03 +0100)]
Update NOTES.WIN

Make the recommendation for MSYS perl in an MSYS environment more forceful.

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
3 years agoUpdate CONTRIBUTING
Matt Caswell [Thu, 2 Jun 2016 10:03:10 +0000 (11:03 +0100)]
Update CONTRIBUTING

Fix typos and clarify a few things in the CONTRIBUTING file.

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
3 years agoBring the README file up to date
Matt Caswell [Thu, 2 Jun 2016 10:01:32 +0000 (11:01 +0100)]
Bring the README file up to date

The README file was a little out of date so needed a refresh

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
3 years agoFix threading issue that at best will leak memory
Pauli [Fri, 3 Jun 2016 14:52:32 +0000 (10:52 -0400)]
Fix threading issue that at best will leak memory

The problem is the checking in policy_cache_set, there is a race
condition between the null check and obtaining the lock.  The fix is in
policy_cache_new to detect if the creation has happened already.

Reviewed-by: Richard Levitte <levitte@openssl.org>
3 years agotests: clean up temporary SSL session files.
Richard Levitte [Fri, 3 Jun 2016 11:56:20 +0000 (13:56 +0200)]
tests: clean up temporary SSL session files.

RT#4557

Reviewed-by: Rich Salz <rsalz@openssl.org>
3 years agoAdd ct fuzzer.
Ben Laurie [Fri, 3 Jun 2016 10:07:42 +0000 (11:07 +0100)]
Add ct fuzzer.

Reviewed-by: Rich Salz <rsalz@openssl.org>
3 years agoLinkify libfuzzer.
Ben Laurie [Thu, 12 May 2016 09:39:43 +0000 (10:39 +0100)]
Linkify libfuzzer.

Reviewed-by: Rich Salz <rsalz@openssl.org>
3 years agoFuzz everything with every input.
Ben Laurie [Wed, 11 May 2016 15:07:14 +0000 (16:07 +0100)]
Fuzz everything with every input.

Reviewed-by: Rich Salz <rsalz@openssl.org>
3 years agoSort.
Ben Laurie [Sat, 7 May 2016 17:58:44 +0000 (18:58 +0100)]
Sort.

Reviewed-by: Rich Salz <rsalz@openssl.org>
3 years agoUpdate client authentication tests
Emilia Kasper [Tue, 31 May 2016 14:42:58 +0000 (16:42 +0200)]
Update client authentication tests

Port client auth tests to the new framework, add coverage. The old tests
were only testing success, and only for some protocol versions; the new
tests add all protocol versions and various failure modes.

Reviewed-by: Rich Salz <rsalz@openssl.org>
3 years agochacha/chacha_enc.c: harmonize counter width with subroutine name.
Andy Polyakov [Wed, 27 Apr 2016 13:07:32 +0000 (15:07 +0200)]
chacha/chacha_enc.c: harmonize counter width with subroutine name.

_ctr32 in function name refers to 32-bit counter, but it was implementing
64-bit one. This didn't pose problem to EVP, but 64-bit counter was just
misleading.

RT#4512

Reviewed-by: Richard Levitte <levitte@openssl.org>
3 years agoGH1123: sort dir before rehash
Rich Salz [Wed, 25 May 2016 12:59:10 +0000 (08:59 -0400)]
GH1123: sort dir before rehash

This is needed to generate stable output names/symlinks.

Reviewed-by: Richard Levitte <levitte@openssl.org>
3 years agoBuild the 'openssl rehash' command on VMS version 8.3 and up
Richard Levitte [Thu, 2 Jun 2016 18:44:11 +0000 (20:44 +0200)]
Build the 'openssl rehash' command on VMS version 8.3 and up

Include a note in INSTALL that tests must be run from an unprivileged
process.

Reviewed-by: Rich Salz <rsalz@openssl.org>
3 years agoFix test failures when using enable-ubsan
Matt Caswell [Thu, 2 Jun 2016 12:53:49 +0000 (13:53 +0100)]
Fix test failures when using enable-ubsan

Numerous test failures were occuring when Configured with enable-ubsan
although they could all be traced back to one issue.

Reviewed-by: Andy Polyakov <appro@openssl.org>
3 years agoTidy up OCSP print handling.
Dr. Stephen Henson [Thu, 26 May 2016 15:57:25 +0000 (16:57 +0100)]
Tidy up OCSP print handling.

Also fixes -Wstrict-oveflow warning on this file.

RT#4474 (partial)

Reviewed-by: Richard Levitte <levitte@openssl.org>
3 years agoperl: refactor .pod name section extractor into its own module
Richard Levitte [Thu, 2 Jun 2016 13:38:16 +0000 (15:38 +0200)]
perl: refactor .pod name section extractor into its own module

Adapt util/process_docs.pl

Reviewed-by: Rich Salz <rsalz@openssl.org>
3 years agoAdd a warning about using enable-crypto-mdebug-backtrace
Richard Levitte [Thu, 2 Jun 2016 10:14:52 +0000 (12:14 +0200)]
Add a warning about using enable-crypto-mdebug-backtrace

Reviewed-by: Matt Caswell <matt@openssl.org>
3 years agoTesting symbol presence: also take note of small objects
Richard Levitte [Thu, 2 Jun 2016 00:06:25 +0000 (02:06 +0200)]
Testing symbol presence: also take note of small objects

The S symbol class wasn't checked.

Notified by Sebastian Andrzej Siewior

Reviewed-by: Tim Hudson <tjh@openssl.org>
3 years agoRemove NOEXIST entries
Rich Salz [Wed, 1 Jun 2016 15:49:36 +0000 (11:49 -0400)]
Remove NOEXIST entries

checkpoint before release.

Reviewed-by: Richard Levitte <levitte@openssl.org>
3 years agoDon't leak memory on set_reasons() error path
Matt Caswell [Thu, 28 Apr 2016 13:00:10 +0000 (14:00 +0100)]
Don't leak memory on set_reasons() error path

The set_reasons() function in v3_crld.c leaks a STACK_OF(CONF_VALUE)
object on an error path.

Reviewed-by: Richard Levitte <levitte@openssl.org>
3 years agoDon't leak memory on int X509_PURPOSE_add() error path
Matt Caswell [Thu, 28 Apr 2016 12:53:52 +0000 (13:53 +0100)]
Don't leak memory on int X509_PURPOSE_add() error path

The int X509_PURPOSE_add() function was leaking an X509_PURPOSE object
on error.

Reviewed-by: Richard Levitte <levitte@openssl.org>
3 years agoDon't leak memory on X509_TRUST_add() error path
Matt Caswell [Thu, 28 Apr 2016 12:46:31 +0000 (13:46 +0100)]
Don't leak memory on X509_TRUST_add() error path

The X509_TRUST_add() function was leaking an X509_TRUST object on error.

Reviewed-by: Richard Levitte <levitte@openssl.org>
3 years agoDon't leak memory on ASN1_item_pack() error path
Matt Caswell [Wed, 27 Apr 2016 16:19:01 +0000 (17:19 +0100)]
Don't leak memory on ASN1_item_pack() error path

The ASN1_item_pack() function was leaking an ASN1_STRING object on error
paths.

Reviewed-by: Richard Levitte <levitte@openssl.org>
3 years agoDon't leak memory on ASN1_GENERALIZEDTIME_adj() error path
Matt Caswell [Wed, 27 Apr 2016 15:59:49 +0000 (16:59 +0100)]
Don't leak memory on ASN1_GENERALIZEDTIME_adj() error path

The ASN1_GENERALIZEDTIME_adj() function leaks an ASN1_GENERALIZEDTIME
object on an error path.

Reviewed-by: Richard Levitte <levitte@openssl.org>
3 years agoDon't leak memory in v2i_POLICY_MAPPINGS() on error path
Matt Caswell [Wed, 27 Apr 2016 15:50:14 +0000 (16:50 +0100)]
Don't leak memory in v2i_POLICY_MAPPINGS() on error path

The v2i_POLICY_MAPPINGS() function leaked ASN1_OBJECT pointers on error
paths.

Reviewed-by: Richard Levitte <levitte@openssl.org>
3 years agoDon't leak memory from notice_section function on error path
Matt Caswell [Wed, 27 Apr 2016 15:41:43 +0000 (16:41 +0100)]
Don't leak memory from notice_section function on error path

The notice_section() function allocates a STACK_OF(CONF_VALUE) but
then fails to free it on an error path.

Reviewed-by: Richard Levitte <levitte@openssl.org>
3 years agoDon't leak memory in v2i_AUTHORITY_KEYID
Matt Caswell [Wed, 27 Apr 2016 14:03:26 +0000 (15:03 +0100)]
Don't leak memory in v2i_AUTHORITY_KEYID

The v2i_AUTHORITY_KEYID() function can leak memory under an error
condition.

Reviewed-by: Richard Levitte <levitte@openssl.org>
3 years agoFix memory leak in crl2pkcs7 app
Matt Caswell [Wed, 27 Apr 2016 13:59:35 +0000 (14:59 +0100)]
Fix memory leak in crl2pkcs7 app

The crl2pkcs7 app leaks a stack of OPENSSL_STRINGs in error paths.

Reviewed-by: Richard Levitte <levitte@openssl.org>
3 years agoFree a temporary buffer used by dsaparam application
Matt Caswell [Wed, 27 Apr 2016 13:54:58 +0000 (14:54 +0100)]
Free a temporary buffer used by dsaparam application

The dsaparam application allocates a temporary buffer but then doesn't
free it.

Reviewed-by: Richard Levitte <levitte@openssl.org>
3 years agoFree buffer on error in a2i_ASN1_INTEGER()
Matt Caswell [Wed, 27 Apr 2016 13:50:32 +0000 (14:50 +0100)]
Free buffer on error in a2i_ASN1_INTEGER()

The function a2i_ASN1_INTEGER() allocates a buffer |s| but then fails
to free it on error paths.

Reviewed-by: Richard Levitte <levitte@openssl.org>
3 years agoFree memory on error in cms app
Matt Caswell [Wed, 27 Apr 2016 13:46:09 +0000 (14:46 +0100)]
Free memory on error in cms app

The make_receipt_request() function in the cms app can leak memory on
an error condition.

Reviewed-by: Richard Levitte <levitte@openssl.org>
3 years agoFree tempory data on error in ec_wNAF_mul()
Matt Caswell [Wed, 27 Apr 2016 13:38:44 +0000 (14:38 +0100)]
Free tempory data on error in ec_wNAF_mul()

The ec_wNAF_mul() function allocates some temporary storage that it
doesn't always free on an error condition.

Reviewed-by: Richard Levitte <levitte@openssl.org>
3 years agoFix nits in crypto.pod,ssl.pod
Rich Salz [Tue, 31 May 2016 16:20:08 +0000 (12:20 -0400)]
Fix nits in crypto.pod,ssl.pod

After this merge, the only things left (from doc-nit-check) is
74 pages without a "RETURN VALUES" section.

Reviewed-by: Richard Levitte <levitte@openssl.org>
3 years agoFix various doc nits.
Rich Salz [Wed, 25 May 2016 18:29:57 +0000 (14:29 -0400)]
Fix various doc nits.

Reviewed-by: Richard Levitte <levitte@openssl.org>
3 years agoRemove/rename some old files.
Rich Salz [Fri, 20 May 2016 20:16:07 +0000 (16:16 -0400)]
Remove/rename some old files.

Reviewed-by: Richard Levitte <levitte@openssl.org>
3 years agoAdd final(?) set of copyrights.
Rich Salz [Wed, 1 Jun 2016 15:26:40 +0000 (11:26 -0400)]
Add final(?) set of copyrights.

Add copyright to missing assembler files.
Add copyrights to missing test/* files.
Add copyrights
Various source and misc files.

Reviewed-by: Richard Levitte <levitte@openssl.org>
3 years agoFix some RAND bugs
Rich Salz [Sun, 29 May 2016 18:11:44 +0000 (14:11 -0400)]
Fix some RAND bugs

RT2630 -- segfault for int overlow
RT2877 -- check return values in apps/rand
Update CHANGES file for previous "windows rand" changes.

Reviewed-by: Richard Levitte <levitte@openssl.org>