summaryrefslogtreecommitdiff
path: root/src/lib/libssl/t1_enc.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Oops, revert changes commited by mistake. The previous commit was supposedmiod2014-08-071-4/+3
| | | | to only apply to s23_srvr.c.
* When you expect a function to return a particular value, don't put a commentmiod2014-08-071-3/+4
| | | | | | | | | | | saying that you expect it to return that value and compare it against zero because it is supposedly faster, for this leads to bugs (especially given the high rate of sloppy cut'n'paste within ssl3 and dtls1 routines in this library). Instead, compare for the exact value it ought to return upon success. ok deraadt@
* Remove more compression related code.jsing2014-07-101-8/+1
|
* decompress libssl. ok beck jsingtedu2014-07-101-44/+1
|
* tedu the SSL export cipher handling - since we do not have enabled exportjsing2014-07-091-63/+1
| | | | | | ciphers we no longer need the flags or code to support it. ok beck@ miod@
* pedantic avoidance of division by zero, likely not actuallybeck2014-07-081-1/+6
| | | | | possible to hit for real. ok miod@ jsing@
* Pull the code that builds a DTLS sequence number out into its own functionjsing2014-06-211-20/+10
| | | | | | to avoid duplication. Also use fewer magic numbers. ok miod@
* Pull out the sequence number selection and handle this up front. Also, thejsing2014-06-211-9/+6
| | | | correct record is already known, so avoid reassignment.
* More KNF and clean up.jsing2014-06-211-13/+9
|
* Rename ssl3_record_sequence_update() to ssl3_record_sequence_increment(),jsing2014-06-151-19/+5
| | | | | | | so that it reflects what it is actually doing. Use this function in a number of places that still have the hand rolled version. ok beck@ miod@
* Correctly calculate the key block length when using export ciphers.jsing2014-06-131-1/+5
|
* Swap compress/expand around so they are in the correct order - these endedjsing2014-06-131-14/+14
| | | | up in the wrong order when the code was refactored.
* Combine the MAC handling for both !EVP_CIPH_FLAG_AEAD_CIPHER andjsing2014-06-131-14/+11
| | | | EVP_CIPH_FLAG_AEAD_CIPHER into the same if/else block.
* Add support for handling SSL_CIPHER_ALGORITHM2_AEAD ciphers, which arejsing2014-06-131-27/+238
| | | | | | | | | | | | | those that use EVP_AEAD instead ov EVP_CIPHER. This means being able to change cipher state with an EVP_AEAD and being able to encrypt/decrypt TLS using the EVP_AEAD. This has no change on existing non-SSL_CIPHER_ALGORITHM2_AEAD ciphers. Based on Adam Langley's chromium patches. Rides the recent libssl bump. Tested by sthen@
* Remove support for the `opaque PRF input' extension, which draft has expiredmiod2014-06-131-18/+1
| | | | | | | | 7 years ago and never made it into an RFC. That code wasn't compiled in anyway unless one would define the actual on-the-wire extension id bytes; crank libssl major. With help and enlightenment from Brendan MacDonell.
* tags as requested by miod and teduderaadt2014-06-121-1/+1
|
* Stop setting the EVP_MD_CTX_FLAG_NON_FIPS_ALLOW - it has been ignored sincejsing2014-06-111-2/+0
| | | | | | OpenSSL 1.0.0. ok miod@ (a little while back)
* In tls1_cert_verify_mac(), check the return value of EVP_MD_CTX_copy_ex()jsing2014-06-101-3/+5
| | | | | | | | | to avoid a possible NULL function call on ctx.final(). None of the callers currently check the return value of calls to cert_verify_mac(), however the function already returns 0 in another case and the MAC comparison will later fail. Issue reported by David Ramos.
* Add a define for the SSLv3 sequence size and use it, rather than sprinklingjsing2014-06-081-2/+2
| | | | | | magic numbers around. ok deraadt@
* Be explicit with types. No binary change.jsing2014-06-081-3/+3
|
* Factor out the part of tls1_change_cipher_state() that is specific tojsing2014-06-081-126/+153
| | | | | | | switching cipher states using an EVP_CIPHER. This will facilitate the addition of cipher state changes for EVP_AEAD. No functional change. Based on Adam Langley's chromium patches.
* Factor out the sequence number reset code to aid in upcoming changes.jsing2014-06-081-8/+10
|
* Add missing NULL check after calling EVP_PKEY_new_mac_key().jsing2014-06-071-0/+2
| | | | Based on Adam Langley's chromium patches.
* Use !is_read to imply SSL3_CC_WRITE.jsing2014-06-071-3/+2
| | | | | | | While this is not strictly correct (since the presence of SSL3_CC_READ does not guarantee the absence of SSL3_CC_WRITE), in practice only one of these flags is set at a time and there is existing logic which already relies on this behaviour.
* Move the export label initialisation into the export handling code, sincejsing2014-06-071-6/+11
| | | | this is the only place where these variables are used.
* Remove pointless casts - no binary change.jsing2014-06-071-2/+2
|
* Rename variables to make it clear that these are only used in the exportjsing2014-06-071-15/+18
| | | | | | code. Additionally, these need to be cleaned in the export case. Based on Adam Langley's chromium patches.
* Further clean up of context handling in tls1_change_cipher_state().jsing2014-06-071-21/+17
| | | | | | | | | | | Rather than doing a complex dance to figure out if we should reuse the cipher context and clean it later on, just free it and allocate a new one. This simplifies the code path, especially in the write case where special handling is required for DTLS. Also, calling EVP_CIPHER_CTX_init() for a newly created cipher context is unnecessary, since EVP_CIPHER_CTX_new() already does this (not to mention that it was already missing from the write case).
* Rename more variables for readability and consistency.jsing2014-06-021-25/+25
|
* Overhaul the key block handling in tls1_change_cipher_state() - usejsing2014-06-011-46/+66
| | | | | | | | | meaningful variable names with pointer arithmitic, rather than n, i, j and p with array indexing. Based on Adam Langley's chromium diffs. ok miod@
* In tls1_setup_key_block(), use the correct IV length for GCM mode, whichjsing2014-06-011-17/+24
| | | | | | | | | | results in the key block length calculation also being correct. Rename a number of variables so that their purpose becomes clear and simplify some of the code. Inspired by Adam Langley's chromium diffs. ok miod@
* Clean up the tls1_change_cipher_state() key length handling and use ajsing2014-06-011-10/+12
| | | | | | | | | single variable with a descriptive name, instead of two poorly named variables. Largely based on Adam Langley's chromium patches. ok miod@
* remove some #if 0 code. we don't need any more reminders that we're usingtedu2014-05-301-4/+0
| | | | a not quite appropriate data structure. ok jsing
* Make use of SSL_IS_DTLS, SSL_USE_EXPLICIT_IV, SSL_USE_SIGALGS andjsing2014-05-301-8/+5
| | | | | | SSL_USE_TLS1_2_CIPHERS. Largely based on OpenSSL head.
* Fix another two cases where the return value of ssl_replace_hash() isjsing2014-05-291-8/+18
| | | | | | | | | | | | | | | unchecked. In the case of tls1_change_cipher_state(), it is fairly pointless to use ssl_replace_hash(), since it does not initialise the hash and there is special handling required in the DTLS write case. Instead, just inline the part of ssl_replace_hash() that is needed and only ssl_clear_hash_ctx() the write hash in the non-DTLS case. Also add a detailed comment explaining why there needs to be specialised handling for DTLS write context and where the contexts are actually freed. ok miod@
* More KNF.jsing2014-05-281-11/+12
|
* Refactor tls1_change_cipher_state() and split the compression handling outjsing2014-05-281-32/+44
| | | | | | | | from the cipher and message digest handling, allowing for upcoming changes. Based on Adam Langley's chromium diffs. ok miod@
* There is no point in checking if a pointer is non-NULL before calling free,jsing2014-05-281-4/+2
| | | | | | | | since free already does this for us. Also remove some pointless NULL assignments, where the result from malloc(3) is immediately assigned to the same variable. ok miod@
* Remove TLS_DEBUG, SSL_DEBUG, CIPHER_DEBUG and OPENSSL_RI_DEBUG. Much ofjsing2014-05-251-46/+0
| | | | | | | this is sporadic, hacked up and can easily be put back in an improved form should we ever need it. ok miod@
* The ssl_ciper_get_evp() function is currently overloaded to also return thejsing2014-05-251-3/+10
| | | | | | | | | | | compression associated with the SSL session. Based on one of Adam Langley's chromium diffs, factor out the compression handling code into a separate ssl_cipher_get_comp() function. Rewrite the compression handling code to avoid pointless duplication and so that failures are actually returned to and detectable by the caller. ok miod@
* Invoke OPENSSL_cleanse() with the size of the variable you are cleaning.miod2014-05-241-1/+1
| | | | ok jsing@
* KSSL is dead... nuke KSSL_DEBUG from orbit.jsing2014-05-201-83/+0
| | | | ok beck@ miod@
* use the correct algorithm mask. reported by satish lvr viatedu2014-04-281-1/+1
| | | | | http://marc.info/?l=openssl-dev&m=139779977532459&w=2 ok miod
* more malloc/realloc/calloc cleanups; ok beck kettenisderaadt2014-04-211-2/+2
|
* Chop off more SSLv2 tentacles and start fixing and noting y2038 issues.guenther2014-04-201-1/+0
| | | | | | | APIs that pass times as longs will have to change at some point... Bump major on both libcrypto and libssl. ok tedu@
* More KNF.jsing2014-04-191-31/+36
|
* now that knf carpet bombing is finished, switch to hand to hand combat.tedu2014-04-181-82/+75
| | | | | still not sure what to make of mysteries like this: for (i = 7; i >= 0; i--) { /* increment */
* Change library to use intrinsic memory allocation functions instead ofbeck2014-04-171-9/+9
| | | | | | | | OPENSSL_foo wrappers. This changes: OPENSSL_malloc->malloc OPENSSL_free->free OPENSSL_relloc->realloc OPENSSL_freeFunc->free
* remove FIPS mode support. people who require FIPS can buy something thattedu2014-04-151-7/+0
| | | | | meets their needs, but dumping it in here only penalizes the rest of us. ok miod
* First pass at applying KNF to the OpenSSL code, which almost makes itjsing2014-04-141-604/+582
| | | | | readable. This pass is whitespace only and can readily be verified using tr and md5.