summaryrefslogtreecommitdiffstats
path: root/ssl/s3_enc.c
AgeCommit message (Collapse)Author
2015-06-21remove unnecessary NULL checksDr. Stephen Henson
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-30clear/cleanse cleanupRich Salz
Where we called openssl_cleanse, make sure we do it on all error paths. Be consistent in use of sizeof(foo) when possible. Reviewed-by: Andy Polyakov <appro@openssl.org>
2015-05-05memset, memcpy, sizeof consistency fixesRich Salz
Just as with the OPENSSL_malloc calls, consistently use sizeof(*ptr) for memset and memcpy. Remove needless casts for those functions. For memset, replace alternative forms of zero with 0. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-05-04Use safer sizeof variant in mallocRich Salz
For a local variable: TYPE *p; Allocations like this are "risky": p = OPENSSL_malloc(sizeof(TYPE)); if the type of p changes, and the malloc call isn't updated, you could get memory corruption. Instead do this: p = OPENSSL_malloc(sizeof(*p)); Also fixed a few memset() calls that I noticed while doing this. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-05-01free NULL cleanup 11Rich Salz
Don't check for NULL before calling free functions. This gets: ERR_STATE_free ENGINE_free DSO_free CMAC_CTX_free COMP_CTX_free CONF_free NCONF_free NCONF_free_data _CONF_free_data A sk_free use within OBJ_sigid_free TS_TST_INFO_free (rest of TS_ API was okay) Doc update for UI_free (all uses were fine) X509V3_conf_free X509V3_section_free X509V3_string_free Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-04-30free cleanup almost the finaleRich Salz
Add OPENSSL_clear_free which merges cleanse and free. (Names was picked to be similar to BN_clear_free, etc.) Removed OPENSSL_freeFunc macro. Fixed the small simple ones that are left: CRYPTO_free CRYPTO_free_locked OPENSSL_free_locked Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-04-16Code style: space after 'if'Viktor Dukhovni
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-03-26Move ssl3_record_sequence_update into record layerMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Move read_sequence and write_sequence from s->s3 to s->rlayerMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Introduce macro RECORD_LAYER_setup_comp_bufferMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Move more SSL3_RECORD oriented functions into ssl3_record.cMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Encapsulate s->s3->wrecMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Encapsulate s->s3->rrecMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-25free NULL cleanupRich Salz
This commit handles BIO_ACCEPT_free BIO_CB_FREE BIO_CONNECT_free BIO_free BIO_free_all BIO_vfree Reviewed-by: Matt Caswell <matt@openssl.org>
2015-03-23Fix missing return value checksMatt Caswell
Ensure that all functions have their return values checked where appropriate. This covers all functions defined and called from within libssl. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-11Cleanse buffersMatt Caswell
Cleanse various intermediate buffers used by the PRF. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-01-22More comment realignmentmaster-post-reformatMatt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22Run util/openssl-format-source -v -c .Matt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22Fix source where indent will not be able to copeMatt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22More commentsMatt Caswell
Conflicts: crypto/dsa/dsa_vrf.c crypto/ec/ec2_smpl.c crypto/ec/ecp_smpl.c Conflicts: demos/bio/saccept.c ssl/d1_clnt.c Conflicts: bugs/dggccbug.c demos/tunala/cb.c Reviewed-by: Tim Hudson <tjh@openssl.org>
2014-12-10ssl3_digest_cached_records: check for NULL after allocating ↵Jonas Maebe
s->s3->handshake_dgst Signed-off-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Matt Caswell <matt@openssl.org>
2014-12-08Remove some unnecessary OPENSSL_FIPS referencesDr. Stephen Henson
FIPS_mode() exists in all versions of OpenSSL but always returns 0 if OpenSSL is not FIPS capable. Reviewed-by: Tim Hudson <tjh@openssl.org>
2014-12-04Remove SSLv2 supportKurt Roeckx
The only support for SSLv2 left is receiving a SSLv2 compatible client hello. Reviewed-by: Richard Levitte <levitte@openssl.org>
2014-11-27Add checks to the return value of EVP_Cipher to prevent silent encryption ↵Matt Caswell
failure. PR#1767 Reviewed-by: Richard Levitte <levitte@openssl.org>
2014-10-15Support TLS_FALLBACK_SCSV.Bodo Moeller
Reviewed-by: Stephen Henson <steve@openssl.org>
2014-08-18RT1815: More const'ness improvementsJustin Blanchard
Add a dozen more const declarations where appropriate. These are from Justin; while adding his patch, I noticed ASN1_BIT_STRING_check could be fixed, too. Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
2014-06-13Fixed incorrect return code handling in ssl3_final_finish_mac.Matt Caswell
Based on an original patch by Joel Sing (OpenBSD) who also originally identified the issue.
2014-06-13Revert "Fixed incorrect return code handling in ssl3_final_finish_mac"Matt Caswell
This reverts commit 2f1dffa88e1b120add4f0b3a794fbca65aa7768d. Missing attribution.
2014-06-10Fixed incorrect return code handling in ssl3_final_finish_macMatt Caswell
2013-09-08Experimental encrypt-then-mac support.Dr. Stephen Henson
Experimental support for encrypt then mac from draft-gutmann-tls-encrypt-then-mac-02.txt To enable it set the appropriate extension number (0x10 for the test server) using e.g. -DTLSEXT_TYPE_encrypt_then_mac=0x10 For non-compliant peers (i.e. just about everything) this should have no effect.
2013-09-05misspellings fixes by https://github.com/vlajos/misspell_fixerVeres Lajos
2013-02-08ssl/*: revert "remove SSL_RECORD->orig_len" and merge "fix IV".Andy Polyakov
Revert is appropriate because binary compatibility is not an issue in 1.1.
2013-02-06ssl/*: remove SSL3_RECORD->orig_len to restore binary compatibility.Andy Polyakov
Kludge alert. This is arranged by passing padding length in unused bits of SSL3_RECORD->type, so that orig_len can be reconstructed. (cherry picked from commit 8bfd4c659f180a6ce34f21c0e62956b362067fba)
2013-02-06Update DTLS code to match CBC decoding in TLS.Ben Laurie
This change updates the DTLS code to match the constant-time CBC behaviour in the TLS. (cherry picked from commit 9f27de170d1b7bef3d46d41382dc4dafde8b3900)
2013-02-06Don't crash when processing a zero-length, TLS >= 1.1 record.Ben Laurie
The previous CBC patch was bugged in that there was a path through enc() in s3_pkt.c/d1_pkt.c which didn't set orig_len. orig_len would be left at the previous value which could suggest that the packet was a sufficient length when it wasn't. (cherry picked from commit 6cb19b7681f600b2f165e4adc57547b097b475fd)
2013-02-06Make CBC decoding constant time.Ben Laurie
This patch makes the decoding of SSLv3 and TLS CBC records constant time. Without this, a timing side-channel can be used to build a padding oracle and mount Vaudenay's attack. This patch also disables the stitched AESNI+SHA mode pending a similar fix to that code. In order to be easy to backport, this change is implemented in ssl/, rather than as a generic AEAD mode. In the future this should be changed around so that HMAC isn't in ssl/, but crypto/ as FIPS expects. (cherry picked from commit e130841bccfc0bb9da254dc84e23bc6a1c78a64e)
2012-08-28oops, typoDr. Stephen Henson
2012-08-28New compile time option OPENSSL_SSL_TRACE_CRYPTO, when set this passesDr. Stephen Henson
all derived keys to the message callback. Add code to SSL_trace to include support for printing out keys.
2012-01-04Clear bytes used for block padding of SSL 3.0 records. (CVE-2011-4576)Dr. Stephen Henson
2011-05-31set FIPS permitted flag before initalising digestDr. Stephen Henson
2011-05-20PR: 2295Dr. Stephen Henson
Submitted by: Alexei Khlebnikov <alexei.khlebnikov@opera.com> Reviewed by: steve OOM checking. Leak in OOM fix. Fall-through comment. Duplicate code elimination.
2011-05-19Implement FIPS_mode and FIPS_mode_setDr. Stephen Henson
2011-04-29Initial incomplete TLS v1.2 support. New ciphersuites added, new versionDr. Stephen Henson
checking added, SHA256 PRF support added. At present only RSA key exchange ciphersuites work with TLS v1.2 as the new signature format is not yet implemented.
2010-06-12Fix warnings.Ben Laurie
2009-04-20Updates from 1.0.0-stable branch.Dr. Stephen Henson
2009-04-06Updates from 1.0.0-stableDr. Stephen Henson
2008-12-29If we're going to return errors (no matter how stupid), then we shouldBen Laurie
test for them!
2008-12-29Die earlier if hash is NULL. (Coverity IDs 137 & 138).Ben Laurie
2008-12-29Die earlier if we have no hash function.Ben Laurie
2008-12-27Handle the unlikely event that BIO_get_mem_data() returns -ve.Ben Laurie