aboutsummaryrefslogtreecommitdiff
path: root/crypto/evp
AgeCommit message (Collapse)AuthorFilesLines
2016-02-25GH715: ENGINE_finish can take NULLRich Salz4-39/+18
Simplifies calling code. Also fixed up any !ptr tests that were nearby, turning them into NULL tests. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-22GH678: Add a few more zallocFdaSilvaYY1-6/+1
Remove some duplicated NULL/zero init. Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-02-20Always build library object files with shared library cflagsRichard Levitte1-1/+1
This takes us away from the idea that we know exactly how our static libraries are going to get used. Instead, we make them available to build shareable things with, be it other shared libraries or DSOs. On the other hand, we also have greater control of when the shared library cflags. They will never be used with object files meant got binaries, such as apps/openssl or test/test*. With unified, we take this a bit further and prepare for having to deal with extra cflags specifically to be used with DSOs (dynamic engines), libraries and binaries (applications). Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-18Remove all special make depend flags, as well as OPENSSL_DOING_MAKEDEPENDRichard Levitte1-1/+1
All those flags existed because we had all the dependencies versioned in the repository, and wanted to have it be consistent, no matter what the local configuration was. Now that the dependencies are gone from the versioned Makefile.ins, it makes much more sense to use the exact same flags as when compiling the object files. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-18Remove outdated DEBUG flags.Rich Salz2-14/+4
Add -DBIO_DEBUG to --strict-warnings. Remove comments about outdated debugging ifdef guards. Remove md_rand ifdef guarding an assert; it doesn't seem used. Remove the conf guards in conf_api since we use OPENSSL_assert, not assert. For pkcs12 stuff put OPENSSL_ in front of the macro name. Merge TLS_DEBUG into SSL_DEBUG. Various things just turned on/off asserts, mainly for checking non-NULL arguments, which is now removed: camellia, bn_ctx, crypto/modes. Remove some old debug code, that basically just printed things to stderr: DEBUG_PRINT_UNKNOWN_CIPHERSUITES, DEBUG_ZLIB, OPENSSL_RI_DEBUG, RL_DEBUG, RSA_DEBUG, SCRYPT_DEBUG. Remove OPENSSL_SSL_DEBUG_BROKEN_PROTOCOL. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-12evp/e_des[3].c: address compiler warnings, fix formatting.Andy Polyakov2-25/+41
RT#4210 Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-11Move to REF_DEBUG, for consistency.Rich Salz1-9/+2
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 Salz1-1/+1
Valgrind complains about using unitialized memory. So call OPENSSL_zalloc, not malloc. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-10Ensure allocation size fits into size_tDmitry-Me1-4/+11
Signed-off-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Rich Salz <rsalz@openssl.org> GH: #630
2016-02-10The new init functions can now fail so shouldn't be voidMatt Caswell1-2/+7
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-10Rename INIT funtions, deprecate old ones.Rich Salz1-6/+6
Man, there were a lot of renamings :) Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-09Use NON_EMPTY_TRANSLATION_UNIT, consistently.Rich Salz3-18/+9
This also closes RT 4123 Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-09Update build.info files for auto-init/de-initMatt Caswell1-2/+2
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-09Auto init/deinit libcryptoMatt Caswell6-158/+24
This builds on the previous commit to auto initialise/deinitialise libcrypto. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-08GH641: Don't care openssl_zmallocRich Salz3-5/+9
Don't cast malloc-family return values. Also found some places where (a) blank line was missing; and (b) the *wrong* return value was checked. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-05GH601: Various spelling fixes.FdaSilvaYY4-5/+5
Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2016-02-02GH608: Ensure 64-bit shift no matter sizeof(long)Dmitry-Me1-1/+1
Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Emilia Käsper <emilia@openssl.org>
2016-02-01unified build scheme: add build.info filesRichard Levitte1-0/+20
Now that we have the foundation for the "unified" build scheme in place, we add build.info files. They have been generated from the Makefiles in the same directories. Things that are platform specific will appear in later commits. Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-01-29Templatize util/domdRich Salz1-2/+1
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-26Remove /* foo.c */ commentsRich Salz56-56/+0
This was done by the following find . -name '*.[ch]' | /tmp/pl where /tmp/pl is the following three-line script: print unless $. == 1 && m@/\* .*\.[ch] \*/@; close ARGV if eof; # Close file to reset $. And then some hand-editing of other files. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-01-20Remove update tagsRich Salz1-2/+0
Also remove depend/local_depend. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-20make EVP_PKEY opaqueDr. Stephen Henson5-7/+10
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-19Add TLS PRF method.Dr. Stephen Henson1-1/+2
Add EVP_PKEY algorithm for TLS1 PRF. Reviewed-by: Matt Caswell <matt@openssl.org>
2016-01-17Remove some old makefile targetsRich Salz1-12/+0
Remove lint, tags, dclean, tests. This is prep for a new makedepend scheme. This is temporary pending unified makefile, and might help it. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-17RT4247: Add missing patchRich Salz1-3/+3
Missed the camellia EVP update. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-01-15RT4247: Fix EVP_CIPHER_CTX opaque on sparcRich Salz2-3/+3
Via Rainer Jung Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
2016-01-13After EVP_CIPHER turned opaque, e_rc5.c needs to include evp_int.hRichard Levitte1-0/+1
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>
2016-01-12Move Makefiles to Makefile.inRich Salz2-850/+86
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>
2016-01-12make updateRichard Levitte1-454/+531
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-01-12EVP_CIPHER_CTX_new_cipher_data was a temporary measure, not needed any moreRichard Levitte1-7/+0
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-01-12Adapt builtin cipher implementations to opaque EVP_CIPHERRichard Levitte15-301/+454
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>
2016-01-12Adapt the internal EVP routines to opaque EVP_CIPHERRichard Levitte2-3/+4
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-01-12Make EVP_CIPHER opaque and add creator/destructor/accessor/writer functionsRichard Levitte4-206/+206
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>
2016-01-12Remove EVP_CIPHER_CTX_flags, it's only confusingRichard Levitte2-6/+1
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>
2016-01-12Adapt all EVP_CIPHER_CTX users for it becoming opaqueRichard Levitte3-17/+23
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-01-12Adapt cipher implementations to opaque EVP_CIPHER_CTXRichard Levitte5-31/+47
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>
2016-01-12Adapt the internal EVP routines to opaque EVP_CIPHER_CTXRichard Levitte1-4/+3
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-01-12Add accessors and writers for EVP_CIPHER_CTXRichard Levitte1-0/+47
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>
2016-01-12Make EVP_CIPHER_CTX opaque and renew the creator / destructor functionsRichard Levitte2-36/+48
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>
2016-01-07Backwards-compatibility subject to OPENSSL_API_COMPATViktor Dukhovni1-1/+3
Provide backwards-compatiblity for functions, macros and include files if OPENSSL_API_COMPAT is either not defined or defined less than the version number of the release in which the feature was deprecated. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-07Only declare stacks in headersDr. Stephen Henson3-4/+5
Don't define stacks in C source files: it causes warnings about unused functions in some compilers. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-07Rename DECLARE*STACK_OF to DEFINE*STACK_OFDr. Stephen Henson2-2/+2
Applications wishing to include their own stacks now just need to include DEFINE_STACK_OF(foo) in a header file. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-07Fix declarations and constification for inline stack.Dr. Stephen Henson2-4/+4
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-02Fix a possible memleakRichard Levitte1-0/+7
If there's a failure allocating md_data, the destination pctx will have a shared pointer with the source EVP_MD_CTX, which will lead to problems when either the source or the destination is freed. Reviewed-by: Stephen Henson <steve@openssl.org>
2015-12-29Fix no-engine.Ben Laurie1-0/+1
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-12-18Remove the "eay" c-file-style indicatorsRichard Levitte3-3/+3
Since we don't use the eay style any more, there's no point tryint to tell emacs to use it. Reviewed-by: Matt Caswell <matt@openssl.org>
2015-12-16Rename some BUF_xxx to OPENSSL_xxxRich Salz2-2/+2
Rename BUF_{strdup,strlcat,strlcpy,memdup,strndup,strnlen} to OPENSSL_{strdup,strlcat,strlcpy,memdup,strndup,strnlen} Add #define's for the old names. Add CRYPTO_{memdup,strndup}, called by OPENSSL_{memdup,strndup} macros. Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-12-14Add EVP_PKEY_get0_* functions.Dr. Stephen Henson2-17/+50
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2015-12-14Extend EVP_PKEY_copy_parameters()Dr. Stephen Henson1-1/+4
Make EVP_PKEY_copy_parameters() work if the destination has no type (e.g. if obtained from EVP_PKEY_new()) or the underlying key is NULL. This is useful where we want to copy the parameters from an existing key to a new key. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2015-12-13Remove no longer existant structure member and direct references to ↵Ben Laurie1-5/+6
EVP_MD_CTX internals. Reviewed-by: Richard Levitte <levitte@openssl.org>