summaryrefslogtreecommitdiffstats
path: root/crypto
AgeCommit message (Collapse)Author
2016-01-02Fix a possible memleakRichard Levitte
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-31Use X509_get0_pubkey where appropriateDr. Stephen Henson
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-12-30Fix some missing or faulty header file inclusionsRichard Levitte
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-12-30Check for missing DSA parameters.Dr. Stephen Henson
If DSA parameters are absent return -1 (for unknown) in DSA_security_bits. If parameters are absent when a certificate is set in an SSL/SSL_CTX structure this will reject the certificate by default. This will cause DSA certificates which omit parameters to be rejected but that is never (?) done in practice. Thanks to Brian 'geeknik' Carpenter for reporting this issue. Reviewed-by: Emilia Käsper <emilia@openssl.org>
2015-12-29Fix no-engine.Ben Laurie
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-12-23Avoid using a dangling pointer when removing the last itemKurt Roeckx
When it's the last item that is removed int_thread_hash == hash and we would still call int_thread_release(&hash) while hash is already freed. So int_thread_release would compare that dangling pointer to NULL which is undefined behaviour. Instead do already what int_thread_release() would do, and make the call do nothing instead. Reviewed-by: Rich Salz <rsalz@openssl.org> RT: #4155, MR: #1519
2015-12-22Cleanup CRYPTO_{push,pop}_infoRich Salz
Rename to OPENSSL_mem_debug_{push,pop}. Remove simple calls; keep only calls used in recursive functions. Ensure we always push, to simplify so that we can always pop Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-12-22Rename *_realloc_clean to *_clear_reallocRich Salz
Just like *_clear_free routines. Previously undocumented, used a half-dozen times within OpenSSL source. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-12-22Also change the non-debug versions to use size_tKurt Roeckx
Reviewed-by: Richard Levitte <levitte@openssl.org> MR: #1518
2015-12-22Fix memory leak in DSA redo case.David Benjamin
Found by clang scan-build. Signed-off-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Richard Levitte <levitte@openssl.org> RT: #4184, MR: #1496
2015-12-22bn/asm/bn-c64xplus.asm: update commentary.Andy Polyakov
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-12-21sha/asm/sha256-armv4.pl: one of "universal" flags combination didn't compile.Andy Polyakov
(and unify table address calculation in ARMv8 code path). Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-12-19Fix URLs mangled by reformatMatt Caswell
Some URLs in the source code ended up getting mangled by indent. This fixes it. Based on a patch supplied by Arnaud Lacombe <al@aerilon.ca> Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-12-18Remove the "eay" c-file-style indicatorsRichard Levitte
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-17Modify the lower level memory allocation routines to take size_tRichard Levitte
We've been using int for the size for a long time, it's about time... Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-12-16mem-cleanup, cont'd.Rich Salz
Remove LEVITTE_DEBUG_MEM. Remove {OPENSSL,CRYPTO}_remalloc. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2015-12-16Rename sec_mem to mem_sec, like other files.Rich Salz
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-12-16Rename some BUF_xxx to OPENSSL_xxxRich Salz
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-16Constify EC_KEY in ECDH_compute_key.Dr. Stephen Henson
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-12-16New EC functions.Dr. Stephen Henson
New functions EC_POINT_point2buf and EC_KEY_key2buf which encode a point and allocate a buffer in one call. New function EC_KEY_oct2key() which sets public key in an EC_KEY structure from an encoded point. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-12-15Fix build on SolarisMatt Caswell
Solaris builds were failing during async compilation because the .o files created from compiling the corresponding .c files held in async/arch were ending up in the top level async directory. Consequently the link fails because it can't find the .o files. Thanks to Richard Levitte for pointing me in the right direction on this. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-12-15Remove GMP engine.Rich Salz
Reviewed-by: Ben Laurie <ben@openssl.org>
2015-12-14make updateDr. Stephen Henson
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2015-12-14New function X509_get0_pubkeyDr. Stephen Henson
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2015-12-14Add EVP_PKEY_get0_* functions.Dr. Stephen Henson
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2015-12-14Extend EVP_PKEY_copy_parameters()Dr. Stephen Henson
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-14Fix a ** 0 mod 1 = 0 for real this time.Emilia Kasper
Commit 2b0180c37fa6ffc48ee40caa831ca398b828e680 attempted to do this but only hit one of many BN_mod_exp codepaths. Fix remaining variants and add a test for each method. Thanks to Hanno Boeck for reporting this issue. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
2015-12-14crpyto/ppccpuid.pl: add FPU probe and fix OPENSSL_rdtsc.Andy Polyakov
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-12-14crypto/ppccap.c: add SIGILL-free processor capability detection code.Andy Polyakov
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-12-13x86_64 assembly pack: tune clang version detection even further.Andy Polyakov
RT#4171 Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-12-13Configure: add framework for ChaCha and Poly1305 assembly.Andy Polyakov
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-12-13Remove no longer existant structure member and direct references to ↵Ben Laurie
EVP_MD_CTX internals. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-12-13Fix (incorrect) uninitialised variable warning.Ben Laurie
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-12-12Fix compile failure with no-threadsMatt Caswell
The async code was causing a compile failure if no-threads was used. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-12-11evp/e_chacha20_poly1305.c: TLS interop fixes.Andy Polyakov
Thanks to: David Benjamin of Chromuim. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-12-11Make no-dh work, plus other no-dh problems found by Richard.Ben Laurie
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-12-11make updateRichard Levitte
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-12-11Adapt PEM routines to the opaque EVP_ENCODE_CTXRichard Levitte
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-12-11Adapt BIO_f_base64 to the opaque EVP_ENCODE_CTXRichard Levitte
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-12-11Make EVP_ENCODE_CTX opaqueRichard Levitte
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-12-10Support the TLS Feature (aka Must Staple) X.509v3 extension (RFC7633).Rob Stradling
Signed-off-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Dr. Stephen Henson <steve@openssl.org> GH: #495, MR: #1435
2015-12-10make updateMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-12-10evp/e_aes.c: wire hardware-assisted block function to OCB.Andy Polyakov
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-12-10x86[_64] assembly pack: add optimized AES-NI OCB subroutines.Andy Polyakov
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-12-10modes/ocb128.c: fix overstep.Andy Polyakov
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-12-10Configure: make no-chacha and no-poly1305 work.Andy Polyakov
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-12-10evp/c_allc.c: wire ChaCha20-Poly1305 and add tests.Andy Polyakov
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-12-10crypto/evp: add e_chacha20_poly1305.c.Andy Polyakov
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-12-10evp/evp_enc.c: allow EVP_CIPHER.ctx_size to be 0.Andy Polyakov
In such case it would be EVP_CIPHER.cleanup's reponsibility to wipe EVP_CIPHEX_CTX.cipher_data. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-12-10Add ChaCha20-Poly1305 and ChaCha20 NIDs.Andy Polyakov
Reviewed-by: Richard Levitte <levitte@openssl.org>