Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2015-04-06Factor out sequence number updates.David Benjamin
Also check for overflow, although it really shouldn't happen. Change-Id: I34dfe8eaf635aeaa8bef2656fda3cd0bad7e1268 Reviewed-on: https://boringssl-review.googlesource.com/4235 Reviewed-by: Adam Langley <agl@google.com>
2015-04-06Clean up do_ssl3_write fragment handling.David Benjamin
Separate actually writing the fragment to the network from assembling it so there is no need for is_fragment. record_split_done also needn't be a global; as of 7fdeaf11017b82368e0a97547fc491b90ad40f67, it is always reset to 0 whether or not SSL3_WANT_WRITE occurred, despite the comment. I believe this is sound, but the pre-7fdeaf1 logic wasn't quiiite right; ssl3_write_pending allows a retry to supply *additional* data, so not all plaintext had been commited to before the IV was randomized. We could fix this by tracking how many bytes were committed to the last time we fragmented, but this is purely an optimization and doesn't seem worth the complexity. This also fixes the alignment computation in the record-splitting case. The extra byte was wrong, as demonstrated by the assert. Change-Id: Ia087a45a6622f4faad32e501942cc910eca1237b Reviewed-on: https://boringssl-review.googlesource.com/4234 Reviewed-by: Adam Langley <agl@google.com>
2015-03-10Get rid of the RSMBLY macros.David Benjamin
Turn them into static functions that take in an hm_fragment. It's not immediately obvious that the frag_off/frag_len bounds checks and the msg_len consistency check are critical to avoiding an out-of-bounds write. Better to have dtls1_hm_fragment_mark also check internally. Also rework the bitmask logic to be clearer and avoid a table. Change-Id: Ica54e98f66295efb323e033cb6c67ab21e7d6cbc Reviewed-on: https://boringssl-review.googlesource.com/3765 Reviewed-by: Adam Langley <agl@google.com>
2015-03-10Rework DTLS handshake message reassembly logic.David Benjamin
Notably, drop all special cases around receiving a message in order and receiving a full message. It makes things more complicated and was the source of bugs (the MixCompleteMessageWithFragments tests added in this CL did not pass before). Instead, every message goes through an hm_fragment, and dtls1_get_message always checks buffered_messages to see if the next is complete. The downside is that we pay one more copy of the message data in the common case. This is only during connection setup, so I think it's worth the simplicity. (If we want to optimize later, we could either tighten ssl3_get_message's interface to allow the handshake data being in the hm_fragment's backing store rather than s->init_buf or swap out s->init_buf with the hm_fragment's backing store when a mesasge completes. This CL does not address ssl_read_bytes being an inappropriate API for DTLS. Future work will revise the handshake/transport boundary to align better with DTLS's needs. Also other problems that I've left as TODOs. Change-Id: Ib4570d45634b5181ecf192894d735e8699b1c86b Reviewed-on: https://boringssl-review.googlesource.com/3764 Reviewed-by: Adam Langley <agl@google.com>
2015-02-12Reset all the error codes.David Benjamin
This saves about 6-7k of error data. Change-Id: Ic28593d4a1f5454f00fb2399d281c351ee57fb14 Reviewed-on: https://boringssl-review.googlesource.com/3385 Reviewed-by: Adam Langley <agl@google.com>
2015-02-10Precompute sorted array for error strings.Adam Langley
Previously, error strings were kept in arrays for each subdirectory and err.c would iterate over them all and insert them at init time to a hash table. This means that, even if you have a shared library and lots of processes using that, each process has ~30KB of private memory from building that hash table. This this change, all the error strings are built into a sorted list and are thus static data. This means that processes can share the error information and it actually saves binary space because of all the pointer overhead in the old scheme. Also it saves the time taken building the hash table at startup. This removes support for externally-supplied error string data. Change-Id: Ifca04f335c673a048e1a3e76ff2b69c7264635be