| commit | 4f36cc932045abfb52997dc024a6d29d2dd5a635 | [log] [tgz] |
|---|---|---|
| author | Rudolf Polzer <rpolzer@google.com> | Fri Oct 17 04:41:44 2025 -0700 |
| committer | Boringssl LUCI CQ <boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com> | Tue Oct 21 11:06:25 2025 -0700 |
| tree | dbd6059a17c8db2a845aeb605f2e4dbdc36f4b21 | |
| parent | cb744f04f1a8a357a482fc95a74cf852ea183ae8 [diff] |
Add an assert for a correct buffer size.
It is not immediately clear that the memcpy below the added assert is
valid and does not access out of bounds. The added assert would hit if
the memcpy ever were out of bounds.
The access is actually safe and the assert will never hit because
of the "if (frag_off > msg_len || frag_len > msg_len - frag_off) {"
check and the fact that dtls1_parse_fragment ensures body's length
is exactly frag_len; however this seems rather fragile so I'd still
like to have this assert just in case this breaks. Also, this depends
on dtls1_get_incoming_message and dtls_new_incoming_message as well...
just the fact that a later code change could break this invariant
seems reason enough to add this assert, and be it just to document the
invariant.
Found while auditing use of subspan.
Tested: IDA/Diaphora and ghidriff find no differences in generated code
other than type identifiers with the extra template argument.
Change-Id: I33ceeb559ade726ac9d62495bfe1748c298f5ac1
Bug: 390229582
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/82927
Commit-Queue: David Benjamin <davidben@google.com>
Reviewed-by: David Benjamin <davidben@google.com>
Auto-Submit: Rudolf Polzer <rpolzer@google.com>
BoringSSL is a fork of OpenSSL that is designed to meet Google's needs.
Although BoringSSL is an open source project, it is not intended for general use, as OpenSSL is. We don't recommend that third parties depend upon it. Doing so is likely to be frustrating because there are no guarantees of API or ABI stability.
Programs ship their own copies of BoringSSL when they use it and we update everything as needed when deciding to make API changes. This allows us to mostly avoid compromises in the name of compatibility. It works for us, but it may not work for you.
BoringSSL arose because Google used OpenSSL for many years in various ways and, over time, built up a large number of patches that were maintained while tracking upstream OpenSSL. As Google's product portfolio became more complex, more copies of OpenSSL sprung up and the effort involved in maintaining all these patches in multiple places was growing steadily.
Currently BoringSSL is the SSL library in Chrome/Chromium, Android (but it's not part of the NDK) and a number of other apps/programs.
Project links:
To file a security issue, use the Chromium process and mention in the report this is for BoringSSL. You can ignore the parts of the process that are specific to Chromium/Chrome.
There are other files in this directory which might be helpful: