summaryrefslogtreecommitdiffstats
path: root/crypto
AgeCommit message (Collapse)Author
2016-02-11Perl's chop / chomp considered bad, use a regexp insteadRichard Levitte
Once upon a time, there was chop, which somply chopped off the last character of $_ or a given variable, and it was used to take off the EOL character (\n) of strings. ... but then, you had to check for the presence of such character. So came chomp, the better chop which checks for \n before chopping it off. And this worked well, as long as Perl made internally sure that all EOLs were converted to \n. These days, though, there seems to be a mixture of perls, so lines from files in the "wrong" environment might have \r\n as EOL, or just \r (Mac OS, unless I'm misinformed). So it's time we went for the more generic variant and use s|\R$||, the better chomp which recognises all kinds of known EOLs and chops them off. A few chops were left alone, as they are use as surgical tools to remove one last slash or one last comma. NOTE: \R came with perl 5.10.0. It means that from now on, our scripts will fail with any older version. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-11perlasm/x86_64-xlate.pl: pass pure constants verbatim.Andy Polyakov
RT#3885 Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-11poly1305/asm/poly1305-x86_64.pl: MacOS X portability fix.Andy Polyakov
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-02-11poly1305/asm/poly1305-x86_64.pl: fix mingw64 build.Andy Polyakov
Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-02-11Move to REF_DEBUG, for consistency.Rich Salz
Add utility macros REF_ASSERT_NOT and REF_PRINT_COUNT This is also RT 4181 Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-11Fix GH 327.Rich Salz
Valgrind complains about using unitialized memory. So call OPENSSL_zalloc, not malloc. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-11GH620: second diff from rt-2275, adds error codeRich Salz
clean up and apply patches from RT-2275 Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-11Check mallocRich Salz
Noticed by Claus Assmann <ca+ssl-dev@esmtp.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-11Missing header include.Rich Salz
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-11Hide OPENSSL_INIT_SETTINGS.Rich Salz
Make OPENSSL_INIT_SETTINGS an opaque structure. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-11Add inclusion directory crypto/include for BN compilationsRichard Levitte
Some files in crypto/bn depend on internal/bn_conf.h, and so does test/bntest. Therefore, we add another inclusion directory. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-11Rework BIO_ADDRINFO_protocol() to return correct valuesRichard Levitte
As noted already, some platforms don't fill in ai_protocol as expected. To circumvent that, we have BIO_ADDRINFO_protocol() to compute a sensible answer in that case. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2016-02-11use consistent error messagesDr. Stephen Henson
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-11Print out bad content octets.Dr. Stephen Henson
If asn1parse doesn't like a structure print out the content octets for diagnostic purposes. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-10After auto init, check that the deprecated functions exist before usingRichard Levitte
The functions that have been deprecated by the auto init changes are now guarded with deprecation checks, so it's fairly easy to see if they can be used. In test/dtlsv1listentest, we simply remove all init and cleanup code, as they are call automatically when needed. Reviewed-by: Matt Caswell <matt@openssl.org>
2016-02-10After renaming init, update errors.Rich Salz
Reviewed-by: Matt Caswell <matt@openssl.org>
2016-02-10BIO_PAIR_DEBUG did nothing; remove it.Rich Salz
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-10Ensure allocation size fits into size_tDmitry-Me
Signed-off-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Rich Salz <rsalz@openssl.org> GH: #630
2016-02-10Quote the CFLAG in Unixly Makefiles, for buildinf.hRichard Levitte
Because the command line definitions of OPENSSLDIR and ENGINESDIR contain quotes, we need a variant of CFLAG where backslashes and quotes are escaped when we produce buildinf.h Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-10Make it possible to get ENGINESDIR info from OpenSSL_versionsRichard Levitte
Have apps/openssl display the result along with OPENSSLDIR As part of this, add ENGINESDIR in util/mk1mf.pl Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-10Attempt to log an error if init failedMatt Caswell
If init failed we'd like to set an error code to indicate that. But if init failed then when the error system tries to load its strings its going to fail again. We could get into an infinite loop. Therefore we just set a single error the first time around. After that no error is set. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-10The new init functions can now fail so shouldn't be voidMatt Caswell
The new init functions can fail if the library has already been stopped. We should be able to indicate failure with a 0 return value. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-10Variable was declared static when it shouldn't beMatt Caswell
The local variable tmp was declared static when it shouldn't be. This is in the no-threads implementation, and it was immediately initialised to something else on every invokation of the function so it doesn't break anything...but still shouldn't be there. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2016-02-10Deprecate the -issuer_checks debugging optionViktor Dukhovni
This was a developer debugging feature and was never a useful public interface. Added all missing X509 error codes to the verify(1) manpage, but many still need a description beyond the associated text string. Sorted the errors in x509_txt.c by error number. Reviewed-by: Stephen Henson <steve@openssl.org>
2016-02-10Update unified build after store removalRich Salz
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2016-02-10Rename INIT funtions, deprecate old ones.Rich Salz
Man, there were a lot of renamings :) Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-10No dynamic-init fix; merge goof.Rich Salz
Reviewed-by: Matt Caswell <matt@openssl.org>
2016-02-10clean away old VMS cruftRichard Levitte
The old building scripts get removed, they are hopelessly gone in bit rot by now. Also remove the old symbol hacks. They were needed needed to shorten some names to 31 characters, and to resolve other symbol clashes. Because we now compile with /NAMES=(AS_IS,SHORTENED), this is no longer required. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-10unified build scheme: add a "unified" template for VMS descrip.mmsRichard Levitte
As part of this, change util/mkdef.pl to stop adding libraries to depend on in its output. mkdef.pl should ONLY output a symbol vector. Because symbol names can't be longer than 31 characters, we use the compiler to shorten those that are longer down to 23 characters plus an 8 character CRC. To make sure users of our header files will pick up on that automatically, add the DEC C supported extra headers files __decc_include_prologue.h and __decc_include_epilogue.h. Furthermore, we add a config.com, so VMS people can configure just as comfortably as any Unix folks, thusly: @config Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-10unified build scheme: add a "unified" template for Unix MakefileRichard Levitte
This also adds all the raw sections needed for some files. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-10Configure et al: move the installation directory logic to MakefilesRichard Levitte
The logic to figure out the combinations of --prefix and --openssldir has stayed in Configure so far, with Unix paths as defaults. However, since we're making Configure increasingly platform agnostic, these defaults need to change and adapt to the platform, along with the logic to combine them. The easiest to provide for this is to move the logic and the defaults away from Configure and into the build files. This also means that the definition of the macros ENGINESDIR and OPENSSLDIR move away from include/openssl/opensslconf.h and into the build files. Makefile.in is adapted accordingly. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-10Can't re-init after stop.Rich Salz
Remoce DYANMIC once-init stuff. After the library is stopped, you can't restart it. Reviewed-by: Matt Caswell <matt@openssl.org>
2016-02-10Remove store.Rich Salz
Rebased and merged by me, with Ben's approval. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Ben Laurie <ben@openssl.org>
2016-02-10If we've not been inited don't deinitMatt Caswell
If you call an explicit deinit when we've not been inited then a seg fault can occur. We should check that we've been inited before attempting to deinit. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-10chacha/asm/chacha-x86.pl: fix nasm compilation.Andy Polyakov
Reviewed-by: Matt Caswell <matt@openssl.org>
2016-02-10poly1305/poly1305.c: work around -Wshadow warnings with POLY1305_ASM.Andy Polyakov
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-10x86[_64] assembly pack: add ChaCha20 and Poly1305 modules.Andy Polyakov
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-10VMS getnameinfo() seems to have a bug with returned service stringRichard Levitte
It seems like it gives back gibberish. If we asked for a numeric service, it's easy to check for a digit in the first position, and if there isn't any, rewrite it using older methods. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-10Make sure to always include string.h so memset gets declared.Richard Levitte
memset() is used by CRYPTO_secure_zalloc(), which isn't hidden away behind IMPLEMENTED. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-09Don't run RC4 test with no-rc4Rich Salz
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-09Use NON_EMPTY_TRANSLATION_UNIT, consistently.Rich Salz
This also closes RT 4123 Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-09Make some global variables staticMatt Caswell
Make some global variables that are only ever accessed from one file static. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-09NULL the thread_local_inits_st pointer after useMatt Caswell
After the final use of the thread_local_inits_st we should ensure it is set to NULL, just in case OPENSSL_INIT_thread_stop gets called again and it tries to use garbage. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-09Stop library before checking for mem leaksMatt Caswell
With the new init framework resources aren't released until the process exits. This means checking for mem leaks before that point finds a lot of things! We should explicitly close down the library if we're checking for mem leaks. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-09Portability fixRich Salz
Reviewed-by: Matt Caswell <matt@openssl.org>
2016-02-09s390x assembly pack: add ChaCha20 and Poly1305 modules.Andy Polyakov
Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-02-09Updates for auto init/deinit review commentsMatt Caswell
Fixes for the auto-init/deinit code based on review comments Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-09Correct copyright date for internal header fileMatt Caswell
The newly added internal async.h header file had last years date in it. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-09Update build.info files for auto-init/de-initMatt Caswell
Various Makefile.in files have changes for auto-init/de-init. Make the equivalent changes in build.info. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-09Avoid a race condition in loading config settingsMatt Caswell
A race condition can occur when sending config settings to OPENSSL_INIT_crypto_library_start() Reviewed-by: Richard Levitte <levitte@openssl.org>