Documentation: Change |...| to ... for code references in comments 14/N

This CL includes the result of running util/update_comment_style.py over
*.cc files in all remaining directories besides third_party/, and fixing
omissions manually if necessary.

Bug: 42290410
Change-Id: I52b1bb1aaff338b5ff1e9c6df8a722b86a6a6964
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/96153
Reviewed-by: Rudolf Polzer <rpolzer@google.com>
Commit-Queue: Lily Chen <chlily@google.com>
This commit is contained in:
Lily Chen
2026-05-29 21:30:00 +00:00
committed by boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com
parent 86ba1395ac
commit 5940a37814
19 changed files with 56 additions and 56 deletions
+2 -2
View File
@@ -480,10 +480,10 @@ const uint8_t kDERRSAPrivate4096[] = {
constexpr size_t kMaxSignature = 512;
// |RSA| objects cache some state on them, so we benchmark both repeat
// `RSA` objects cache some state on them, so we benchmark both repeat
// operations on long-lived RSA keys, and newly-imported RSA keys.
//
// In typical applications, RSA signing is done on a long-lived |RSA| object
// In typical applications, RSA signing is done on a long-lived `RSA` object
// (e.g. one's TLS key) that takes advantage of the cache, while RSA
// verification is done on a newly-imported RSA keys (e.g. parsing a TLS server
// key out of a newly-received end-entity certificate). However, other
+2 -2
View File
@@ -69,7 +69,7 @@ TEST(DESTest, CFB) {
for (const auto &t : kTests) {
SCOPED_TRACE(t.numbits);
// |DES_ede3_cfb_encrypt| only supports streaming at segment boundaries.
// `DES_ede3_cfb_encrypt` only supports streaming at segment boundaries.
// Segments, however, are measured in bits, not bytes. When the segment is
// not a whole number of bytes, OpenSSL's low-level functions do not
// implement CFB correctly. CFB-n ultimately computes a sequence of E(I_i)
@@ -80,7 +80,7 @@ TEST(DESTest, CFB) {
// It essentially interprets CFB-1 as a funny CFB-8, with the wrong amount
// of cipher feedback. To get the real CFB-1 out of OpenSSL's CFB-1, you put
// each plaintext bit as into its byte, with bit at the MSB, then mask off
// all but the MSB of each ciphertext byte. OpenSSL's |EVP_des_ede3_cfb1|
// all but the MSB of each ciphertext byte. OpenSSL's `EVP_des_ede3_cfb1`
// does this transformation internally, to work around this bug.
//
// In case anyone is relying on the remaining bits, we test all the output
+1 -1
View File
@@ -22,7 +22,7 @@ struct wrapped_callback {
};
// callback_wrapper converts an “old” style generation callback to the newer
// |BN_GENCB| form.
// `BN_GENCB` form.
static int callback_wrapper(int event, int n, BN_GENCB *gencb) {
struct wrapped_callback *wrapped = (struct wrapped_callback *) gencb->arg;
wrapped->callback(event, n, wrapped->arg);
+1 -1
View File
@@ -22,7 +22,7 @@ struct wrapped_callback {
};
// callback_wrapper converts an “old” style generation callback to the newer
// |BN_GENCB| form.
// `BN_GENCB` form.
static int callback_wrapper(int event, int n, BN_GENCB *gencb) {
struct wrapped_callback *wrapped = (struct wrapped_callback *) gencb->arg;
wrapped->callback(event, n, wrapped->arg);
+4 -4
View File
@@ -19,8 +19,8 @@
#include <openssl/evp.h>
// Node.js assumes every cipher in |EVP_CIPHER_do_all_sorted| is accessible via
// |EVP_get_cipherby*|.
// Node.js assumes every cipher in `EVP_CIPHER_do_all_sorted` is accessible via
// `EVP_get_cipherby*`.
TEST(EVPTest, CipherDoAll) {
EVP_CIPHER_do_all_sorted(
[](const EVP_CIPHER *cipher, const char *name, const char *unused,
@@ -32,8 +32,8 @@ TEST(EVPTest, CipherDoAll) {
nullptr);
}
// Node.js assumes every digest in |EVP_MD_do_all_sorted| is accessible via
// |EVP_get_digestby*|.
// Node.js assumes every digest in `EVP_MD_do_all_sorted` is accessible via
// `EVP_get_digestby*`.
TEST(EVPTest, MDDoAll) {
EVP_MD_do_all_sorted(
[](const EVP_MD *md, const char *name, const char *unused, void *arg) {
+1 -1
View File
@@ -36,7 +36,7 @@ int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack,
int ret = 0;
for (;;) {
// |readdir| may fail with or without setting |errno|.
// `readdir` may fail with or without setting `errno`.
errno = 0;
struct dirent *dirent = readdir(dir);
if (dirent == nullptr) {
+2 -2
View File
@@ -72,7 +72,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len) {
}
// Don't fuzz inputs larger than 512 bytes (4096 bits). This isn't ideal, but
// the naive |mod_exp| above is somewhat slow, so this otherwise causes the
// the naive `mod_exp` above is somewhat slow, so this otherwise causes the
// fuzzers to spend a lot of time exploring timeouts.
if (CBS_len(&child0) > 512 ||
CBS_len(&child1) > 512 ||
@@ -109,7 +109,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len) {
bssl::UniquePtr<BN_MONT_CTX> mont(
BN_MONT_CTX_new_for_modulus(modulus.get(), ctx.get()));
CHECK(mont);
// |BN_mod_exp_mont| and |BN_mod_exp_mont_consttime| require reduced inputs.
// `BN_mod_exp_mont` and `BN_mod_exp_mont_consttime` require reduced inputs.
CHECK(BN_nnmod(base.get(), base.get(), modulus.get(), ctx.get()));
CHECK(BN_mod_exp_mont(result.get(), base.get(), power.get(), modulus.get(),
ctx.get(), mont.get()));
+5 -5
View File
@@ -40,18 +40,18 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len) {
// Reserialize the extension. This should succeed if we were able to
// parse it.
// TODO(crbug.com/boringssl/352): Ideally we would also assert that
// |new_ext| is identical to |ext|, but our parser is not strict enough.
// `new_ext` is identical to `ext`, but our parser is not strict enough.
UniquePtr<X509_EXTENSION> new_ext(
X509V3_EXT_i2d(nid, X509_EXTENSION_get_critical(ext), parsed));
BSSL_CHECK(new_ext != nullptr);
// This can only fail if |ext| was not a supported type, but then
// |X509V3_EXT_d2i| should have failed.
// This can only fail if `ext` was not a supported type, but then
// `X509V3_EXT_d2i` should have failed.
BSSL_CHECK(X509V3_EXT_free(nid, parsed));
}
}
// Reserialize |x509|. This should succeed if we were able to parse it.
// Reserialize `x509`. This should succeed if we were able to parse it.
// TODO(crbug.com/boringssl/352): Ideally we would also assert the output
// matches the input, but our parser is not strict enough.
uint8_t *der = nullptr;
@@ -59,7 +59,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len) {
BSSL_CHECK(der_len > 0);
OPENSSL_free(der);
// Reserialize |x509|'s TBSCertificate without reusing the cached encoding.
// Reserialize `x509`'s TBSCertificate without reusing the cached encoding.
// TODO(crbug.com/boringssl/352): Ideally we would also assert the output
// matches the input TBSCertificate, but our parser is not strict enough.
der = nullptr;
+1 -1
View File
@@ -27,7 +27,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len) {
bssl::UniquePtr<BIO> bio(BIO_new_mem_buf(buf, len));
bssl::UniquePtr<CONF> conf(NCONF_new(nullptr));
if (NCONF_load_bio(conf.get(), bio.get(), nullptr)) {
// Run with and without |X509V3_CTX| information.
// Run with and without `X509V3_CTX` information.
bssl::UniquePtr<X509> cert(X509_new());
X509V3_CTX ctx;
X509V3_set_ctx(&ctx, /*subject=*/cert.get(), /*issuer=*/cert.get(), nullptr,
+1 -1
View File
@@ -35,7 +35,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len) {
return 0;
}
// Use the remaining bytes in |reader| as the ClientHelloOuter.
// Use the remaining bytes in `reader` as the ClientHelloOuter.
SSL_CLIENT_HELLO client_hello_outer;
if (!SSL_parse_client_hello(ssl.get(), &client_hello_outer, CBS_data(&reader),
CBS_len(&reader))) {
+1 -1
View File
@@ -28,7 +28,7 @@
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
FuzzedDataProvider fuzzed_data(data, size);
// Intentionally using uint16_t here to avoid empty |second_part|.
// Intentionally using uint16_t here to avoid empty `second_part`.
size_t first_part_size = fuzzed_data.ConsumeIntegral<uint16_t>();
std::vector<uint8_t> first_part =
fuzzed_data.ConsumeBytes<uint8_t>(first_part_size);
@@ -27,7 +27,7 @@
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
FuzzedDataProvider fuzzed_data(data, size);
// Intentionally using uint16_t here to avoid empty |second_part|.
// Intentionally using uint16_t here to avoid empty `second_part`.
size_t first_part_size = fuzzed_data.ConsumeIntegral<uint16_t>();
std::vector<uint8_t> first_part =
fuzzed_data.ConsumeBytes<uint8_t>(first_part_size);
+1 -1
View File
@@ -516,7 +516,7 @@ bool Client(const std::vector<std::string> &args) {
fprintf(stderr, "Bad NPN protocol: '%s'\n", proto.c_str());
return false;
}
// |SSL_CTX_set_next_proto_select_cb| is not const-correct.
// `SSL_CTX_set_next_proto_select_cb` is not const-correct.
SSL_CTX_set_next_proto_select_cb(ctx.get(), NextProtoSelectCallback,
const_cast<char *>(proto.c_str()));
}
+5 -5
View File
@@ -68,7 +68,7 @@ struct Source {
static const char kStdinName[] = "standard input";
// OpenFile opens the regular file named |filename| and returns a file
// OpenFile opens the regular file named `filename` and returns a file
// descriptor to it.
static ScopedFD OpenFile(const std::string &filename) {
ScopedFD fd = OpenFD(filename.c_str(), O_RDONLY | O_BINARY);
@@ -95,7 +95,7 @@ static ScopedFD OpenFile(const std::string &filename) {
return fd;
}
// SumFile hashes the contents of |source| with |md| and sets |*out_hex| to the
// SumFile hashes the contents of `source` with `md` and sets `*out_hex` to the
// hex-encoded result.
//
// It returns true on success or prints an error to stderr and returns false on
@@ -162,7 +162,7 @@ static bool SumFile(std::string *out_hex, const EVP_MD *md,
return true;
}
// PrintFileSum hashes |source| with |md| and prints a line to stdout in the
// PrintFileSum hashes `source` with `md` and prints a line to stdout in the
// format of the coreutils *sum utilities. It returns true on success or prints
// an error to stderr and returns false on error.
static bool PrintFileSum(const EVP_MD *md, const Source &source) {
@@ -193,11 +193,11 @@ struct CheckModeArguments {
bool strict = false;
};
// Check reads lines from |source| where each line is in the format of the
// Check reads lines from `source` where each line is in the format of the
// coreutils *sum utilities. It attempts to verify each hash by reading the
// file named in the line.
//
// It returns true if all files were verified and, if |args.strict|, no input
// It returns true if all files were verified and, if `args.strict`, no input
// lines had formatting errors. Otherwise it prints errors to stderr and
// returns false.
static bool Check(const CheckModeArguments &args, const EVP_MD *md,
+4 -4
View File
@@ -54,7 +54,7 @@ void CloseFD(int fd) {
bool ReadFromFD(int fd, size_t *out_bytes_read, void *out, size_t num) {
#if defined(OPENSSL_WINDOWS)
// On Windows, the buffer must be at most |INT_MAX|. See
// On Windows, the buffer must be at most `INT_MAX`. See
// https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/read?view=vs-2019
int ret = _read(fd, out, std::min(size_t{INT_MAX}, num));
#else
@@ -74,8 +74,8 @@ bool ReadFromFD(int fd, size_t *out_bytes_read, void *out, size_t num) {
bool WriteToFD(int fd, size_t *out_bytes_written, const void *in, size_t num) {
#if defined(OPENSSL_WINDOWS)
// The documentation for |_write| does not say the buffer must be at most
// |INT_MAX|, but clamp it to |INT_MAX| instead of |UINT_MAX| in case.
// The documentation for `_write` does not say the buffer must be at most
// `INT_MAX`, but clamp it to `INT_MAX` instead of `UINT_MAX` in case.
int ret = _write(fd, in, std::min(size_t{INT_MAX}, num));
#else
ssize_t ret;
@@ -99,7 +99,7 @@ ScopedFILE FDToFILE(ScopedFD fd, const char *mode) {
#else
ret.reset(fdopen(fd.get(), mode));
#endif
// |fdopen| takes ownership of |fd| on success.
// `fdopen` takes ownership of `fd` on success.
if (ret) {
fd.release();
}
+21 -21
View File
@@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
// Suppress MSVC's STL warnings. It flags |std::copy| calls with a raw output
// Suppress MSVC's STL warnings. It flags `std::copy` calls with a raw output
// pointer, on grounds that MSVC cannot check them. Unfortunately, there is no
// way to suppress the warning just on one line. The warning is flagged inside
// the STL itself, so suppressing at the |std::copy| call does not work.
// the STL itself, so suppressing at the `std::copy` call does not work.
#if !defined(_SCL_SECURE_NO_WARNINGS)
#define _SCL_SECURE_NO_WARNINGS
#endif
@@ -133,14 +133,14 @@ static std::string GetLastSocketErrorString() {
}
static void PrintSocketError(const char *function) {
// On Windows, |perror| and |errno| are part of the C runtime, while sockets
// On Windows, `perror` and `errno` are part of the C runtime, while sockets
// are separate, so we must print errors manually.
std::string error = GetLastSocketErrorString();
fprintf(stderr, "%s: %s\n", function, error.c_str());
}
// Connect sets |*out_sock| to be a socket connected to the destination given
// in |hostname_and_port|, which should be of the form "www.example.com:123".
// Connect sets `*out_sock` to be a socket connected to the destination given
// in `hostname_and_port`, which should be of the form "www.example.com:123".
// It returns true on success and false otherwise.
bool Connect(int *out_sock, const std::string &hostname_and_port) {
std::string hostname, port;
@@ -452,10 +452,10 @@ class SocketWaiter {
bool Init() { return true; }
// Wait waits for at least on of the socket or stdin or be ready. On success,
// it sets |*socket_ready| and |*stdin_ready| to whether the respective
// it sets `*socket_ready` and `*stdin_ready` to whether the respective
// objects are readable and returns true. On error, it returns false. stdin's
// readiness may either be the socket being writable or stdin being readable,
// depending on |stdin_wait|.
// depending on `stdin_wait`.
bool Wait(StdinWait stdin_wait, bool *socket_ready, bool *stdin_ready) {
*socket_ready = true;
*stdin_ready = false;
@@ -484,9 +484,9 @@ class SocketWaiter {
return true;
}
// ReadStdin reads at most |max_out| bytes from stdin. On success, it writes
// them to |out| and sets |*out_len| to the number of bytes written. On error,
// it returns false. This method may only be called after |Wait| returned
// ReadStdin reads at most `max_out` bytes from stdin. On success, it writes
// them to `out` and sets `*out_len` to the number of bytes written. On error,
// it returns false. This method may only be called after `Wait` returned
// stdin was ready.
bool ReadStdin(void *out, size_t *out_len, size_t max_out) {
ssize_t n;
@@ -546,13 +546,13 @@ class ScopedWSAEVENT {
WSAEVENT event_ = WSA_INVALID_EVENT;
};
// SocketWaiter, on Windows, is more complicated. While |WaitForMultipleObjects|
// SocketWaiter, on Windows, is more complicated. While `WaitForMultipleObjects`
// works for both sockets and stdin, the latter is often a line-buffered
// console. The |HANDLE| is considered readable if there are any console events
// console. The `HANDLE` is considered readable if there are any console events
// available, but reading blocks until a full line is available.
//
// So that |Wait| reflects final stdin read, we spawn a stdin reader thread that
// writes to an in-memory buffer and signals a |WSAEVENT| to coordinate with the
// So that `Wait` reflects final stdin read, we spawn a stdin reader thread that
// writes to an in-memory buffer and signals a `WSAEVENT` to coordinate with the
// socket.
class SocketWaiter {
public:
@@ -654,7 +654,7 @@ class SocketWaiter {
std::lock_guard<std::mutex> locked(stdin_->lock);
if (stdin_->buffer.empty()) {
// |ReadStdin| may only be called when |Wait| signals it is ready, so
// `ReadStdin` may only be called when `Wait` signals it is ready, so
// stdin must have reached EOF or error.
assert(!stdin_->open);
listen_stdin_ = false;
@@ -697,7 +697,7 @@ class SocketWaiter {
ScopedWSAEVENT event;
// lock protects the following fields.
std::mutex lock;
// cond notifies the stdin thread that |buffer| is no longer full.
// cond notifies the stdin thread that `buffer` is no longer full.
std::condition_variable cond;
std::deque<uint8_t> buffer;
bool open = true;
@@ -707,7 +707,7 @@ class SocketWaiter {
int sock_;
std::shared_ptr<StdinState> stdin_;
// listen_stdin_ is set to false when we have consumed an EOF or error from
// |stdin_|. This is separate from |stdin_->open| because the signal may not
// `stdin_`. This is separate from `stdin_->open` because the signal may not
// have been consumed yet.
bool listen_stdin_ = true;
};
@@ -829,7 +829,7 @@ class SocketLineReader {
explicit SocketLineReader(int sock) : sock_(sock) {}
// Next reads a '\n'- or '\r\n'-terminated line from the socket and, on
// success, sets |*out_line| to it and returns true. Otherwise it returns
// success, sets `*out_line` to it and returns true. Otherwise it returns
// false.
bool Next(std::string *out_line) {
for (;;) {
@@ -870,8 +870,8 @@ class SocketLineReader {
}
// ReadSMTPReply reads one or more lines that make up an SMTP reply. On
// success, it sets |*out_code| to the reply's code (e.g. 250) and
// |*out_content| to the body of the reply (e.g. "OK") and returns true.
// success, it sets `*out_code` to the reply's code (e.g. 250) and
// `*out_content` to the body of the reply (e.g. "OK") and returns true.
// Otherwise it returns false.
//
// See https://tools.ietf.org/html/rfc821#page-48
@@ -934,7 +934,7 @@ class SocketLineReader {
size_t buf_len_ = 0;
};
// SendAll writes |data_len| bytes from |data| to |sock|. It returns true on
// SendAll writes `data_len` bytes from `data` to `sock`. It returns true on
// success and false otherwise.
static bool SendAll(int sock, const char *data, size_t data_len) {
size_t done = 0;
+1 -1
View File
@@ -50,7 +50,7 @@ int main(int argc, char **argv) {
module_version);
#if !defined(BORINGSSL_FIPS)
// |module_version| will be zero, so the non-FIPS build will never get
// `module_version` will be zero, so the non-FIPS build will never get
// this far.
printf("Non zero module version in non-FIPS build - should not happen!\n");
#elif defined(OPENSSL_ASAN)
@@ -1990,7 +1990,7 @@ static bool ECDH(const Span<const uint8_t> args[], ReplyCallback write_reply) {
return false;
}
// The output buffer is one larger than |EC_MAX_BYTES| so that truncation
// The output buffer is one larger than `EC_MAX_BYTES` so that truncation
// can be detected.
std::vector<uint8_t> output(EC_MAX_BYTES + 1);
const int out_len =
+1 -1
View File
@@ -78,7 +78,7 @@ static int run_test() {
module_version);
#if !defined(BORINGSSL_FIPS)
// |module_version| will be zero, so the non-FIPS build will never get
// `module_version` will be zero, so the non-FIPS build will never get
// this far.
printf("Non zero module version in non-FIPS build - should not happen!\n");
return 0;