Rich Salz [Sun, 17 Jan 2016 15:34:26 +0000 (10:34 -0500)]
Add some accessors.
Author: Remi Gacogne <rgacogne-github@coredump.fr>
GH334: Add an OCSP_SINGLERESP_get0_id() accessor to the OCSP_CERTID of
a OCSP_SINGLERESP. It is possible to do it the other way around using
OCSP_resp_find(), but this is more efficient when you have a tree indexed
by OCSP_CERTID, like haproxy does. (This is also RT4251)
Author: Marek Klein <kleinmrk@gmail.com>
GH556: OCSP_resp_get_produced_at() accessor to the producedAt of a
OCSP_BASICRESP
GH555: TS_STATUS_INFO_get_status(), TS_STATUS_INFO_get_text() and
TS_STATUS_INFO_get_failure_info() accessors for a TS_STATUS_INFO
Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
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.
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>
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>
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.
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>
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.
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.
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.
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.
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.
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>
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.
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:
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.
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.
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).
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.
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.
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.
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).
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.
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()
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).
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.