oweals/openssl.git
8 years agoThe TLSProxy tests can't run if no-engine has been configured
Richard Levitte [Sat, 16 Jan 2016 23:25:44 +0000 (00:25 +0100)]
The TLSProxy tests can't run if no-engine has been configured

Make sure they detect that.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
8 years agofix no-engine build
Dr. Stephen Henson [Sat, 16 Jan 2016 16:11:34 +0000 (16:11 +0000)]
fix no-engine build

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoStart a new line after each sentence-ending period.
Viktor Dukhovni [Sat, 16 Jan 2016 20:43:14 +0000 (15:43 -0500)]
Start a new line after each sentence-ending period.

This avoids explicit double spaces between sentences.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoMake SSL_dane_enable() requirement more clear.
Viktor Dukhovni [Sat, 16 Jan 2016 20:29:44 +0000 (15:29 -0500)]
Make SSL_dane_enable() requirement more clear.

Also s/s/ssl/ as appropriate in the code example.

Suggested by Claus Assmann.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoBetter invalid SNI name error handling
Viktor Dukhovni [Sat, 16 Jan 2016 18:25:17 +0000 (13:25 -0500)]
Better invalid SNI name error handling

Also report an SSL_dane_enable error when the basedomain is an
invalid SNI name.  Avoid side-effects when such a name is valid
with X509_VERIFY_PARAM_set1_host(), as e.g. with an empty name, by
setting the SNI name first.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoEmpty SNI names are not valid
Viktor Dukhovni [Sat, 16 Jan 2016 17:57:24 +0000 (12:57 -0500)]
Empty SNI names are not valid

While empty inputs to SSL_set1_host() clear the reference identifier
list.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoRT4247: Fix EVP_CIPHER_CTX opaque on sparc
Rich Salz [Sat, 16 Jan 2016 03:37:11 +0000 (22:37 -0500)]
RT4247: Fix EVP_CIPHER_CTX opaque on sparc

Via Rainer Jung

Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
8 years agofree up gost ciphers
Dr. Stephen Henson [Thu, 14 Jan 2016 22:13:37 +0000 (22:13 +0000)]
free up gost ciphers

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
8 years agoAdd lookup_certs for a trusted stack.
Dr. Stephen Henson [Thu, 14 Jan 2016 23:56:50 +0000 (23:56 +0000)]
Add lookup_certs for a trusted stack.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
8 years agoNGX-2040 - fix wildcard match on punycode/IDNA DNS names
Zi Lin [Fri, 15 Jan 2016 19:31:11 +0000 (14:31 -0500)]
NGX-2040 - fix wildcard match on punycode/IDNA DNS names

- bugfix: should not treat '--' as invalid domain substring.
- '-' should not be the first letter of a domain

Signed-off-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoFix typo
Rich Salz [Fri, 15 Jan 2016 16:41:27 +0000 (11:41 -0500)]
Fix typo

Reviewed-by: Matt Caswell <matt@openssl.org>
8 years agoUpdate Windows installation instructions
Matt Caswell [Thu, 14 Jan 2016 20:19:23 +0000 (20:19 +0000)]
Update Windows installation instructions

The windows installation instructions were very out of date. Substantial
update to the text. Remove a lot of historical stuff that isn't relevant
any more, and merge the win64 and win32 instructions into one file.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoRename INSTALL.W32 to INSTALL.WIN
Matt Caswell [Thu, 14 Jan 2016 20:16:40 +0000 (20:16 +0000)]
Rename INSTALL.W32 to INSTALL.WIN

Also remove the INSTALL.W64 file. Next commit will update INSTALL.WIN to
cover both.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoSmall fixup, an extra line slipped in
Richard Levitte [Thu, 14 Jan 2016 21:05:09 +0000 (22:05 +0100)]
Small fixup, an extra line slipped in

The previous 'Relax the requirements for a debug build' commit had
an extra line of code that shouldn't have been there.  This fixes it.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
8 years agoCosmetic polish for last-resort depth 0 check
Viktor Dukhovni [Thu, 14 Jan 2016 20:03:15 +0000 (15:03 -0500)]
Cosmetic polish for last-resort depth 0 check

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoAvoid the r modifier for s/// (perl)
Richard Levitte [Thu, 14 Jan 2016 19:22:36 +0000 (20:22 +0100)]
Avoid the r modifier for s/// (perl)

It seems that the r modifier for s/// is fairly new.  It's reported
not to exist in perl 5.10.1, so it's better to avoid it when
possible.

Reviewed-by: Tim Hudson <tjh@openssl.org>
8 years agoFix last-resort depth 0 check when the chain has multiple certificates
Viktor Dukhovni [Thu, 14 Jan 2016 19:34:50 +0000 (14:34 -0500)]
Fix last-resort depth 0 check when the chain has multiple certificates

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoAdd a no-egd option to disable EGD-related code
Benjamin Kaduk [Wed, 13 Jan 2016 00:02:16 +0000 (18:02 -0600)]
Add a no-egd option to disable EGD-related code

The entropy-gathering daemon is used only on a small number of machines.
Provide a configure knob so that EGD support can be disabled by default
but re-enabled on those systems that do need it.

Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
8 years agoMake SSL_set_debug deprecated in 1.1
Rich Salz [Thu, 14 Jan 2016 17:16:00 +0000 (12:16 -0500)]
Make SSL_set_debug deprecated in 1.1

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
8 years agoAlways initialize X509_STORE_CTX get_crl pointer
Viktor Dukhovni [Thu, 14 Jan 2016 17:23:35 +0000 (12:23 -0500)]
Always initialize X509_STORE_CTX get_crl pointer

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoEditorial
Viktor Dukhovni [Thu, 14 Jan 2016 16:54:39 +0000 (11:54 -0500)]
Editorial

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoIn __cwd, make sure the given directory is seen as such and not a file
Richard Levitte [Thu, 14 Jan 2016 16:38:52 +0000 (17:38 +0100)]
In __cwd, make sure the given directory is seen as such and not a file

On Unixly platforms, this doesn't matter.  On VMS, it does.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoRelax the requirements for a debug build
Richard Levitte [Thu, 14 Jan 2016 16:03:58 +0000 (17:03 +0100)]
Relax the requirements for a debug build

We required that a target be named 'debug-something' or to have at
least one of the configuration items debug_cflags and debug_lflags for
--debug to be accepted.

However, there are targets with no such markings but that will still
have debugging capabilities.  This is particularly true for mk1mf
builds, where the extra flags for debugging are figured out later on
by util/mk1mf.pl.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoRT4232: Extra space in help message.
Rich Salz [Thu, 14 Jan 2016 04:11:01 +0000 (23:11 -0500)]
RT4232: Extra space in help message.

It turns out that -pause calls the undocumented function SSL_set_debug.
That just sets flag inside the SSL structure.  That flag, despite
the command is never used.  So remove the flag, the field, and the
function.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoEDH >= 1024 bits even at security level 0
Viktor Dukhovni [Thu, 14 Jan 2016 06:16:16 +0000 (01:16 -0500)]
EDH >= 1024 bits even at security level 0

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoPrepare for 1.1.0-pre3-dev
Richard Levitte [Thu, 14 Jan 2016 14:27:14 +0000 (15:27 +0100)]
Prepare for 1.1.0-pre3-dev

Reviewed-by: Matt Caswell <matt@openssl.org>
8 years agoPrepare for 1.1.0-pre2 release OpenSSL_1_1_0-pre2
Richard Levitte [Thu, 14 Jan 2016 14:26:56 +0000 (15:26 +0100)]
Prepare for 1.1.0-pre2 release

Reviewed-by: Matt Caswell <matt@openssl.org>
8 years agoChange the last copyright year to 2016 in README
Richard Levitte [Thu, 14 Jan 2016 14:13:50 +0000 (15:13 +0100)]
Change the last copyright year to 2016 in README

Reviewed-by: Matt Caswell <matt@openssl.org>
8 years agoVMS open() doesn't take O_BINARY, but takes a context description
Richard Levitte [Thu, 14 Jan 2016 13:08:49 +0000 (14:08 +0100)]
VMS open() doesn't take O_BINARY, but takes a context description

Tell open() O_BINARY on VMS doesn't make sense, as it's possible to
use more precise file attributes.  However, if we're still going to
fdopen() it in binary mode, we must set the fd in binary context.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoRename binmode into textmode and use it correctly
Richard Levitte [Thu, 14 Jan 2016 13:07:57 +0000 (14:07 +0100)]
Rename binmode into textmode and use it correctly

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoDo not use redirection on binary files
Richard Levitte [Thu, 14 Jan 2016 12:15:45 +0000 (13:15 +0100)]
Do not use redirection on binary files

On some platforms, the shell will determine what attributes a file
will have, so while the program might think it's safely outputting
binary data, it's not always true.

For the sake of the tests, it's therefore safer to use -out than to
use redirection.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoFall back to c_rehash if 'openssl rehash' fails
Richard Levitte [Thu, 14 Jan 2016 11:18:30 +0000 (12:18 +0100)]
Fall back to c_rehash if 'openssl rehash' fails

'openssl rehash' isn't implemented on all platforms, and since 'make
test' depends on a rehash of certs/demo being performed, it becomes an
effective block from running tests on any platform but Unix, for the
moment.

It's better to fall back to c_rehash and let the tests perform
everywhere.

Reviewed-by: Matt Caswell <matt@openssl.org>
8 years agoCall single parent free_comp routine.
Rich Salz [Thu, 14 Jan 2016 02:26:00 +0000 (21:26 -0500)]
Call single parent free_comp routine.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
8 years agoTo avoid possible time_t overflow use X509_time_adj_ex()
Dr. Stephen Henson [Thu, 14 Jan 2016 00:25:25 +0000 (00:25 +0000)]
To avoid possible time_t overflow use X509_time_adj_ex()

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
8 years agoFix double-free bugs in EC group precomputation state
Viktor Dukhovni [Thu, 14 Jan 2016 00:51:17 +0000 (19:51 -0500)]
Fix double-free bugs in EC group precomputation state

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoAdd a directry spec for mcr if there is none
Richard Levitte [Thu, 14 Jan 2016 00:46:23 +0000 (01:46 +0100)]
Add a directry spec for mcr if there is none

On VMS, the command MCR will assume SYS$SYSTEM: when the first
argument lacks a directory spec.  So for programs in the current
directory, we add [] to tell MCR it is in the current directory.
It's the same as having ./ at the start of a program on Unix so the
shell doesn't start looking along $PATH.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoFix verify(1) to report failure when verification fails
Viktor Dukhovni [Wed, 13 Jan 2016 22:08:03 +0000 (17:08 -0500)]
Fix verify(1) to report failure when verification fails

Regenerated expired test certificates, good for the next 100 years.

Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
8 years agoFix nistp512 typos, should be nistp521
Viktor Dukhovni [Wed, 13 Jan 2016 22:19:42 +0000 (17:19 -0500)]
Fix nistp512 typos, should be nistp521

Note, this now compiles, but fails tests, so further remediation
is required.

Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
8 years agoAdd missing #ifdef's to fix build break
Rich Salz [Wed, 13 Jan 2016 21:39:37 +0000 (16:39 -0500)]
Add missing #ifdef's to fix build break

Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
8 years agoFor stro[ui]max require both C99 and UINTMAX_MAX/INTMAX_MAX
Viktor Dukhovni [Wed, 13 Jan 2016 20:42:06 +0000 (15:42 -0500)]
For stro[ui]max require both C99 and UINTMAX_MAX/INTMAX_MAX

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoFix test_ordinals
Matt Caswell [Wed, 13 Jan 2016 20:51:41 +0000 (20:51 +0000)]
Fix test_ordinals

This used to work but somewhere along the line it broke and was failing to
detect duplicate ordinals - which was the whole point of the test!

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoReorder the ordinals in libeay.num
Richard Levitte [Wed, 13 Jan 2016 20:34:28 +0000 (21:34 +0100)]
Reorder the ordinals in libeay.num

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoRemove spurious ;
Richard Levitte [Wed, 13 Jan 2016 20:29:24 +0000 (21:29 +0100)]
Remove spurious ;

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoQuick fix of debugging option for mk1mf.pl.
Richard Levitte [Wed, 13 Jan 2016 19:39:58 +0000 (20:39 +0100)]
Quick fix of debugging option for mk1mf.pl.

util/mk1mf.pl was relying on the platform having the 'debug-' prefix
for doing a debug build.  Since the setup of targets has changed, this
is no longer true.  However, it can look for '--debug' in the command
line options.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoVMS C doesn't provide intmax_t/uinmax_t, use our own
Richard Levitte [Wed, 13 Jan 2016 19:25:08 +0000 (20:25 +0100)]
VMS C doesn't provide intmax_t/uinmax_t, use our own

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoAdd CRYPTO_EX_DATA; remove EC_EXTRA_DATA
Rich Salz [Tue, 5 Jan 2016 18:06:03 +0000 (13:06 -0500)]
Add CRYPTO_EX_DATA; remove EC_EXTRA_DATA

Add CRYPTO_EX_DATA add EndC_KEY_[gs]et_method, From Roumen Petrov.
Had to add various exdata calls to init/copy/free the exdata.
Had to remove const from some EC functions because exdata isn't
const-correct. :(
Also remove EC_EXTRA_DATA and use a union to hold the possible
pre-computed values and an enum to tell which value is in the
union. (Rich Salz)

Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
8 years agoRemove test_probable_prime_coprime from test/bntest.c
Richard Levitte [Wed, 13 Jan 2016 18:34:45 +0000 (19:34 +0100)]
Remove test_probable_prime_coprime from test/bntest.c

This test relies on a private function, which isn't exported.
This test would work better as a unit test in crypto/bn/bn_prime.c.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoSimplify the EXIT macrot for VMS
Richard Levitte [Wed, 13 Jan 2016 17:58:15 +0000 (18:58 +0100)]
Simplify the EXIT macrot for VMS

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agorecognise no-crypto-mdebug
Dr. Stephen Henson [Wed, 13 Jan 2016 17:56:37 +0000 (17:56 +0000)]
recognise no-crypto-mdebug

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoVMS perl doesn't implement fork(), so don't run the TLSProxy tests there
Richard Levitte [Wed, 13 Jan 2016 02:53:47 +0000 (03:53 +0100)]
VMS perl doesn't implement fork(), so don't run the TLSProxy tests there

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
8 years agoFix DES_LONG breakage
Viktor Dukhovni [Wed, 13 Jan 2016 17:12:17 +0000 (12:12 -0500)]
Fix DES_LONG breakage

For some strange reason opensslconf.h was only defining DES_LONG
when included via des.h, but that's exceedingly fragile (as a
result of include guards the include via des.h might not actually
process the content again).

Ripped out the nesting constraint, now always define OSSL_DES_LONG
if not already defined.  Note, this could just be DES_LONG, but
trying to avoid exposing DES_LONG in places where it has never been
seen before, so it is up to des.h to actually define DES_LONG as
OSSL_DES_LONG.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoFor stroimax need C99 inttypes.h
Viktor Dukhovni [Wed, 13 Jan 2016 16:16:08 +0000 (11:16 -0500)]
For stroimax need C99 inttypes.h

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoDon't return from main(), use EXIT() instead
Richard Levitte [Wed, 13 Jan 2016 16:04:19 +0000 (17:04 +0100)]
Don't return from main(), use EXIT() instead

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoHave the VMS exit code follow POSIX conventions
Richard Levitte [Wed, 13 Jan 2016 16:00:22 +0000 (17:00 +0100)]
Have the VMS exit code follow POSIX conventions

It seems like the convention for VMS exit codes is to combine the VMS
C facility code (0x35a000) with a recoded exit code as follows:

    0     => 1
    1-255 => 8*code + 2

We also add 0x10000000, which is the control bit that has DCL not
report the error on the terminal.  That's just as well, since it would
be quite nonsensical, for example:

    %C-W-NOMSG, Message number 0035A018

We could do all this by using the normal exit() function after having
defined the macro _POSIX_EXIT.  Unfortunately, this feature only
exists in VMS C V7.1 and up.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoAfter EVP_CIPHER turned opaque, e_rc5.c needs to include evp_int.h
Richard Levitte [Wed, 13 Jan 2016 16:15:28 +0000 (17:15 +0100)]
After EVP_CIPHER turned opaque, e_rc5.c needs to include evp_int.h

We missed this one because rc5 is disabled by default.

Notified by The Doctor <doctor@doctor.nl2k.ab.ca>

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoPipes on VMS do not work well with binary data, use an intermediary file
Richard Levitte [Wed, 13 Jan 2016 16:27:06 +0000 (17:27 +0100)]
Pipes on VMS do not work well with binary data, use an intermediary file

VMS being a record oriented operating system, it's uncertain how the
'pipe' passes binary data from one process to another.  Experience
shows that we get in trouble, and it's probably due to the pipe in
itself being opened in text mode (variable length records).

It's safer to pass data via an intermediary file instead.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoFix test/recipes/80-test_ca.t to work on VMS
Richard Levitte [Wed, 13 Jan 2016 14:16:41 +0000 (15:16 +0100)]
Fix test/recipes/80-test_ca.t to work on VMS

VMS uses a variant of openssl.cnf named openssl-vms.cnf.

There's a Perl on VMS mystery where a open pipe will not SIGPIPE when
the child process exits, which means that a loop sending "y\n" to it
will never stop.  Adding a counter helps fix this (set to 10, we know
that none of the CA.pl commands will require more).

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoVMS will downcase all command parameters unless they're quoted
Richard Levitte [Wed, 13 Jan 2016 14:13:02 +0000 (15:13 +0100)]
VMS will downcase all command parameters unless they're quoted

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoFix missing casts for c++
Mathias Berchtold [Wed, 13 Jan 2016 03:11:38 +0000 (04:11 +0100)]
Fix missing casts for c++

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Stephen Henson <steve@openssl.org>
8 years agoMaximize time_t when intmax_t is available
Viktor Dukhovni [Wed, 13 Jan 2016 02:13:34 +0000 (21:13 -0500)]
Maximize time_t when intmax_t is available

Well, I'm not actually changing time_t, just changing how time_t
valued opt values are converted from string to time_t.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoFix typo in error message
Rich Salz [Tue, 12 Jan 2016 22:35:22 +0000 (17:35 -0500)]
Fix typo in error message

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
8 years agoMove Makefiles to Makefile.in
Rich Salz [Tue, 12 Jan 2016 21:25:30 +0000 (16:25 -0500)]
Move Makefiles to Makefile.in

Create Makefile's from Makefile.in
Rename Makefile.org to Makefile.in
Rename Makefiles to Makefile.in
Address review feedback from Viktor and Richard

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoSTACK_OF(SSL_COMP) is a public type
Viktor Dukhovni [Tue, 12 Jan 2016 19:03:30 +0000 (14:03 -0500)]
STACK_OF(SSL_COMP) is a public type

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agofix jpaketest and correct comment
Dr. Stephen Henson [Tue, 12 Jan 2016 18:09:34 +0000 (18:09 +0000)]
fix jpaketest and correct comment

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoCorrect a small typo in CHANGES
Richard Levitte [Tue, 12 Jan 2016 13:21:15 +0000 (14:21 +0100)]
Correct a small typo in CHANGES

Reviewed-by: Stephen Henson <steve@openssl.org>
8 years agoAdd notes in CHANGES and NEWS
Richard Levitte [Sat, 2 Jan 2016 19:11:26 +0000 (20:11 +0100)]
Add notes in CHANGES and NEWS

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoRemove unused internal macros
Richard Levitte [Sun, 20 Dec 2015 16:07:22 +0000 (17:07 +0100)]
Remove unused internal macros

The M_EVP_* macros related to EVP_CIPHER / EVP_CIPHER_CTX are not
public, and are unused.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agomake update
Richard Levitte [Fri, 18 Dec 2015 16:13:39 +0000 (17:13 +0100)]
make update

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoDocument the new EVP_CIPHER and EVP_CIPHER_CTX functionality
Richard Levitte [Fri, 18 Dec 2015 16:09:45 +0000 (17:09 +0100)]
Document the new EVP_CIPHER and EVP_CIPHER_CTX functionality

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoAdd back deprecated functions in macro form
Richard Levitte [Fri, 8 Jan 2016 12:24:15 +0000 (13:24 +0100)]
Add back deprecated functions in macro form

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoAdapt all EVP_CIPHER users for it becoming opaque
Richard Levitte [Fri, 18 Dec 2015 16:08:49 +0000 (17:08 +0100)]
Adapt all EVP_CIPHER users for it becoming opaque

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoEVP_CIPHER_CTX_new_cipher_data was a temporary measure, not needed any more
Richard Levitte [Fri, 18 Dec 2015 16:06:38 +0000 (17:06 +0100)]
EVP_CIPHER_CTX_new_cipher_data was a temporary measure, not needed any more

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoAdapt all engines that need it to opaque EVP_CIPHER
Richard Levitte [Fri, 18 Dec 2015 16:05:57 +0000 (17:05 +0100)]
Adapt all engines that need it to opaque EVP_CIPHER

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoAdapt builtin cipher implementations to opaque EVP_CIPHER
Richard Levitte [Fri, 18 Dec 2015 16:01:28 +0000 (17:01 +0100)]
Adapt builtin cipher implementations to opaque EVP_CIPHER

They all stop including evp_locl.h, so we also take care of their
adaptation to opaque EVP_CIPHER_CTX, as was promised in an earlier
commit.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoAdapt the internal EVP routines to opaque EVP_CIPHER
Richard Levitte [Fri, 18 Dec 2015 16:00:46 +0000 (17:00 +0100)]
Adapt the internal EVP routines to opaque EVP_CIPHER

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoMake EVP_CIPHER opaque and add creator/destructor/accessor/writer functions
Richard Levitte [Fri, 18 Dec 2015 15:37:02 +0000 (16:37 +0100)]
Make EVP_CIPHER opaque and add creator/destructor/accessor/writer functions

We follow the method used for EVP_MD.
Also, move all the internal EVP_CIPHER building macros from evp_locl.h
to evp_int.h.  This will benefit our builtin EVP_CIPHERs.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoRemove EVP_CIPHER_CTX_flags, it's only confusing
Richard Levitte [Fri, 18 Dec 2015 14:06:30 +0000 (15:06 +0100)]
Remove EVP_CIPHER_CTX_flags, it's only confusing

EVP_CIPHER_CTX_flags was returning the flags of its associated
EVP_CIPHER.  However, EVP_CIPHER_CTX has flags of its own, so this
function is quite confusing and therefore error prone.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoAdapt all EVP_CIPHER_CTX users for it becoming opaque
Richard Levitte [Sun, 13 Dec 2015 21:08:41 +0000 (22:08 +0100)]
Adapt all EVP_CIPHER_CTX users for it becoming opaque

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoAdapt cipher implementations to opaque EVP_CIPHER_CTX
Richard Levitte [Sun, 13 Dec 2015 21:06:14 +0000 (22:06 +0100)]
Adapt cipher implementations to opaque EVP_CIPHER_CTX

Note: there's a larger number of implementations in crypto/evp/ that
aren't affected because they include evp_locl.h.  They will be handled
in a separate commit.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoAdapt the internal EVP routines to opaque EVP_CIPHER_CTX
Richard Levitte [Sun, 13 Dec 2015 20:36:33 +0000 (21:36 +0100)]
Adapt the internal EVP routines to opaque EVP_CIPHER_CTX

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoAdd accessors and writers for EVP_CIPHER_CTX
Richard Levitte [Sun, 13 Dec 2015 20:25:42 +0000 (21:25 +0100)]
Add accessors and writers for EVP_CIPHER_CTX

New functions:

- EVP_CIPHER_CTX_encrypting()
- EVP_CIPHER_CTX_iv()
- EVP_CIPHER_CTX_iv_noconst()
- EVP_CIPHER_CTX_original_iv()
- EVP_CIPHER_CTX_buf_noconst()
- EVP_CIPHER_CTX_num()
- EVP_CIPHER_CTX_set_num()
- EVP_CIPHER_CTX_cipher_data()
- EVP_CIPHER_CTX_new_cipher_data()

Note that the accessors / writers for iv, buf and num may go away, as
those rather belong in the implementation's own structure (cipher_data)
when the implementation would affect them (that would be the case when
they are flagged EVP_CIPH_CUSTOM_IV or EVP_CIPH_FLAG_CUSTOM_CIPHER).

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoMake EVP_CIPHER_CTX opaque and renew the creator / destructor functions
Richard Levitte [Sun, 13 Dec 2015 15:03:02 +0000 (16:03 +0100)]
Make EVP_CIPHER_CTX opaque and renew the creator / destructor functions

Following the method used for EVP_MD_CTX and HMAC_CTX,
EVP_CIPHER_CTX_init and EVP_CIPHER_CTX_cleanup are joined together
into one function, EVP_CIPHER_CTX_reset, with EVP_CIPHER_CTX_init kept
as an alias.
EVP_CIPHER_CTX_cleanup fills no purpose of its own any more and is
therefore removed.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoRT4227: Range-check in apps.
Rich Salz [Tue, 12 Jan 2016 01:40:38 +0000 (20:40 -0500)]
RT4227: Range-check in apps.

Implement range-checking in all counts in apps.  Turns out only a couple
of cases were missing.  And make the range-checking code more strict.
Replace almost all opt_ulong() calls with opt_long()

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
8 years agoYet another make update.
Rich Salz [Tue, 12 Jan 2016 00:22:47 +0000 (19:22 -0500)]
Yet another make update.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoMake sure to have both upper and mixed case symbols in SYMBOL_VECTOR
Richard Levitte [Tue, 12 Jan 2016 02:42:56 +0000 (03:42 +0100)]
Make sure to have both upper and mixed case symbols in SYMBOL_VECTOR

It was assumed that the syntax FOO/Foo=PROCEDURE would create both an
upper case and mixed case symbol in the GST.  Not so, it requires
having both FOO/Foo=PROCEDURE (to create the upper case alias) and
Foo=PROCEDURE (to create the mixed case slot).

We make sure that any symbol always occupies two slots (even those
that don't exist) by filling up with SPARE when necessary.  That will
assure that any changes will still have the same symbols in the same
slots no matter what (save a complete rewrite of the ordinals files).

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoUse SPARE instead of PRIVATE_PROCEDURE to reserve unused SYMBOL_VECTOR slots
Richard Levitte [Tue, 12 Jan 2016 02:40:27 +0000 (03:40 +0100)]
Use SPARE instead of PRIVATE_PROCEDURE to reserve unused SYMBOL_VECTOR slots

It was assumed that a dummy with the type PRIVATE_PROCEDURE would
simply occupy a slot but otherwise ignore the symbol.  Not so, but
there is SPARE for that purpose.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoThe limit per SYMBOL_VECTOR isn't the amount of symbols, it's the line length
Richard Levitte [Tue, 12 Jan 2016 00:07:46 +0000 (01:07 +0100)]
The limit per SYMBOL_VECTOR isn't the amount of symbols, it's the line length

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoVMS INDENTIFICATION should only have the version number
Richard Levitte [Mon, 11 Jan 2016 23:51:26 +0000 (00:51 +0100)]
VMS INDENTIFICATION should only have the version number

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoGH528: "cipher -v" output is confusing.
Rich Salz [Sun, 10 Jan 2016 00:25:52 +0000 (19:25 -0500)]
GH528: "cipher -v" output is confusing.

Fix the docs, and refactor some common code.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
8 years agoHave mkdef.pl use case sensitive symbols for shareable symbol vector
Richard Levitte [Mon, 11 Jan 2016 21:33:35 +0000 (22:33 +0100)]
Have mkdef.pl use case sensitive symbols for shareable symbol vector

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoFunction pop_info() returned a dangling pointer
Pascal Cuoq [Sun, 10 Jan 2016 12:43:37 +0000 (13:43 +0100)]
Function pop_info() returned a dangling pointer

Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoupdate ordinals
Dr. Stephen Henson [Mon, 11 Jan 2016 15:36:54 +0000 (15:36 +0000)]
update ordinals

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoUse ossl_inline and DEFINE_LHASH_OF
Dr. Stephen Henson [Mon, 11 Jan 2016 15:22:30 +0000 (15:22 +0000)]
Use ossl_inline and DEFINE_LHASH_OF

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoRemove mkstack.pl: it is no longer needed.
Dr. Stephen Henson [Thu, 24 Dec 2015 16:24:15 +0000 (16:24 +0000)]
Remove mkstack.pl: it is no longer needed.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoAdd lh_doall_arg inlining
Dr. Stephen Henson [Thu, 24 Dec 2015 16:20:54 +0000 (16:20 +0000)]
Add lh_doall_arg inlining

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoAdd lh_doall inlining
Dr. Stephen Henson [Thu, 24 Dec 2015 16:07:21 +0000 (16:07 +0000)]
Add lh_doall inlining

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoAdd lh_new() inlining
Dr. Stephen Henson [Thu, 24 Dec 2015 15:51:23 +0000 (15:51 +0000)]
Add lh_new() inlining

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoInline LHASH_OF
Dr. Stephen Henson [Mon, 11 Jan 2016 14:11:13 +0000 (14:11 +0000)]
Inline LHASH_OF

Make LHASH_OF use static inline functions.

Add new lh_get_down_load and lh_set_down_load functions and their
typesafe inline equivalents.

Make lh_error a function instead of a macro.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoGH540: add casts to safestack.h
Alessandro Ghedini [Sun, 10 Jan 2016 23:02:17 +0000 (23:02 +0000)]
GH540: add casts to safestack.h

Signed-off-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
8 years agoFix jpaketest compilation error.
Dr. Stephen Henson [Mon, 11 Jan 2016 17:11:24 +0000 (17:11 +0000)]
Fix jpaketest compilation error.

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