aboutsummaryrefslogtreecommitdiff
path: root/ssl/d1_srtp.cc
AgeCommit message (Collapse)AuthorFilesLines
2021-05-21Const-correct SSL_get_srtp_profiles.David Benjamin1-1/+1
This is part of a very deep dependency chain. I'm sniffing at making all the add_clienthello callbacks const. Between HelloVerifyRequest, HelloRetryRequest, and soon ECH, we're creating lots of ClientHellos per connection. That's probably easiest to manage if constructing a ClientHello had no side effects. Update-Note: The change to the return type isn't quite compatible, but I only found one caller of this function, which has since been fixed. (If we need to return a non-const value for compatibility, we can do that and document that the caller should not mutate the output.) Change-Id: I21f18f7438920a5b03d874fa548f054af3a42c4a Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/47664 Reviewed-by: Adam Langley <agl@google.com>
2018-07-06A bunch more scopers.David Benjamin1-6/+7
Change-Id: I5c8dbfec4a404d8d1501725a90b383eb3e05c664 Reviewed-on: https://boringssl-review.googlesource.com/29591 Reviewed-by: Adam Langley <agl@google.com>
2018-05-03Move srtp_profiles to SSL_CONFIG.David Benjamin1-10/+9
These are also not needed after the handshake. Change-Id: I5de2d5cf18a3783a6c04c0a8fe311069fb51b939 Reviewed-on: https://boringssl-review.googlesource.com/27986 Reviewed-by: Steven Valdez <svaldez@google.com> Commit-Queue: Steven Valdez <svaldez@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2018-04-16Move srtp_profile to ssl->s3.David Benjamin1-1/+1
This too is connection-level state to be reset on SSL_clear. Change-Id: I071c9431c28a7d0ff3eb20c679784d4aa4c236a5 Reviewed-on: https://boringssl-review.googlesource.com/27490 Commit-Queue: David Benjamin <davidben@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org> Reviewed-by: Steven Valdez <svaldez@google.com>
2017-09-22Clear a goto in d1_srtp.cc.David Benjamin1-11/+7
Bug: 132 Change-Id: I4ba12f1dfbbdc75cb3841dc70f9007bd8695da97 Reviewed-on: https://boringssl-review.googlesource.com/20665 Reviewed-by: Steven Valdez <svaldez@google.com> Commit-Queue: David Benjamin <davidben@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2017-08-29Convert comments in ssl.David Benjamin1-2/+2
That's the last of it! Change-Id: I93d1f5ab7e95b2ad105c34b24297a0bf77625263 Reviewed-on: https://boringssl-review.googlesource.com/19784 Reviewed-by: David Benjamin <davidben@google.com> Commit-Queue: David Benjamin <davidben@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2017-07-20Switch BORINGSSL_INTERNAL_CXX_TYPES in favor of subclassing games.David Benjamin1-2/+0
The previous attempt around the 'struct ssl_st' compatibility mess offended OSS-Fuzz and UBSan because one compilation unit passed a function pointer with ssl_st* and another called it with bssl::SSLConnection*. Linkers don't retain such types, of course, but to silence this alert, instead make C-visible types be separate from the implementation and subclass the public type. This does mean we risk polluting the symbol namespace, but hopefully the compiler is smart enough to inline the visible struct's constructor and destructor. Bug: 132 Change-Id: Ia75a89b3a22a202883ad671a630b72d0aeef680e Reviewed-on: https://boringssl-review.googlesource.com/18224 Commit-Queue: David Benjamin <davidben@google.com> Commit-Queue: Steven Valdez <svaldez@google.com> Reviewed-by: Steven Valdez <svaldez@google.com>
2017-07-19Move libssl's internals into the bssl namespace.David Benjamin1-3/+5
This is horrible, but everything else I tried was worse. The goal with this CL is to take the extern "C" out of ssl/internal.h and move most symbols to namespace bssl, so we can start using C++ helpers and destructors without worry. Complications: - Public API functions must be extern "C" and match their declaration in ssl.h, which is unnamespaced. C++ really does not want you to interleave namespaced and unnamespaced things. One can actually write a namespaced extern "C" function, but this means, from C++'s perspective, the function is namespaced. Trying to namespace the public header would worked but ended up too deep a rabbithole. - Our STACK_OF macros do not work right in namespaces. - The typedefs for our exposed but opaque types are visible in the header files and copied into consuming projects as forward declarations. We ultimately want to give SSL a destructor, but clobbering an unnamespaced ssl_st::~ssl_st seems bad manners. - MSVC complains about ambiguous names if one typedefs SSL to bssl::SSL. This CL opts for: - ssl/*.cc must begin with #define BORINGSSL_INTERNAL_CXX_TYPES. This informs the public headers to create forward declarations which are compatible with our namespaces. - For now, C++-defined type FOO ends up at bssl::FOO with a typedef outside. Later I imagine we'll rename many of them. - Internal functions get namespace bssl, so we stop worrying about stomping the tls1_prf symbol. Exported C functions are stuck as they are. Rather than try anything weird, bite the bullet and reorder files which have a mix of public and private functions. I expect that over time, the public functions will become fairly small as we move logic to more idiomatic C++. Files without any public C functions can just be written normally. - To avoid MSVC troubles, some bssl types are renamed to CPlusPlusStyle in advance of them being made idiomatic C++. Bug: 132 Change-Id: Ic931895e117c38b14ff8d6e5a273e868796c7581 Reviewed-on: https://boringssl-review.googlesource.com/18124 Reviewed-by: David Benjamin <davidben@google.com>
2017-07-12Switch a number of files to C++.David Benjamin1-0/+236
http://i1.kym-cdn.com/photos/images/original/000/242/631/382.gif In the first step, switch C files to C++ individually, keeping everything in internal.h C-compatible. We'll make minimal changes needed to get things compiling (notably a lot of goto errs will need to turn to bssl::UniquePtr right away), but more aggressive changes will happen in later steps. (To avoid a rebase, I'm intentionally avoiding files that would conflict with CLs in flight right now.) Bug: 132 Change-Id: Id4cfd722e7b57d1df11f27236b4658b5d39b5fd2 Reviewed-on: https://boringssl-review.googlesource.com/17667 Reviewed-by: David Benjamin <davidben@google.com> Commit-Queue: David Benjamin <davidben@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>