mirror of
https://boringssl.googlesource.com/boringssl
synced 2026-07-21 14:43:51 +00:00
Running spelling and grammar checks over comments.
... and then run clang-format on the changed files to reflow any comment blocks that exceeded line lengths. (Which generated a bunch of noise formatting changes, but probably that reduces noise in future CLs.) No semantic change to the code. Change-Id: I455da9faaaedda3e751ac91b5eb43cbc662d68a6 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/97367 Reviewed-by: David Benjamin <davidben@google.com> Commit-Queue: Adam Langley <agl@google.com> Auto-Submit: Adam Langley <agl@google.com>
This commit is contained in:
committed by
boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com
parent
3adc3d1aba
commit
bd6f41c308
+1
-1
@@ -16,7 +16,7 @@ IncludeCategories:
|
||||
Priority: 5
|
||||
# Headers from our dependencies
|
||||
#
|
||||
# TODO(davidben): A strict reading of the the style guide would suggest these
|
||||
# TODO(davidben): A strict reading of the style guide would suggest these
|
||||
# should be grouped with C system headers. Previously we grouped them as if
|
||||
# they were "Other libraries' .h files.". Should we switch?
|
||||
- Regex: '^<(gtest|gmock|benchmark)/.*\.h>'
|
||||
|
||||
+1
-1
@@ -153,7 +153,7 @@ Some types, such as `RSA`, are heap-allocated. All instances will be allocated
|
||||
and returned from BoringSSL's APIs. It is an error to instantiate a heap-
|
||||
allocated type on the stack or embedded within another object.
|
||||
|
||||
Heap-allocated types may have functioned named like `RSA_new` which allocates a
|
||||
Heap-allocated types may have functions named like `RSA_new` which allocates a
|
||||
fresh blank `RSA`. Other functions may also return newly-allocated instances.
|
||||
For example, `RSA_parse_public_key` is documented to return a newly-allocated
|
||||
`RSA` object.
|
||||
|
||||
@@ -111,7 +111,7 @@ int ASN1_get_object(const unsigned char **inp, long *out_len, int *out_tag,
|
||||
return constructed;
|
||||
}
|
||||
|
||||
// class 0 is constructed constructed == 2 for indefinite length constructed
|
||||
// class 0 is constructed, constructed == 2 for indefinite length constructed
|
||||
void ASN1_put_object(unsigned char **pp, int constructed, int length, int tag,
|
||||
int xclass) {
|
||||
unsigned char *p = *pp;
|
||||
|
||||
@@ -976,8 +976,7 @@ TEST(ASN1Test, SetBitString) {
|
||||
UniquePtr<ASN1_BIT_STRING> val(ASN1_BIT_STRING_new());
|
||||
ASSERT_TRUE(val);
|
||||
const uint8_t kBytesf000[] = {0xf0, 0x00};
|
||||
ASSERT_TRUE(
|
||||
ASN1_STRING_set(val.get(), kBytesf000, sizeof(kBytesf000)));
|
||||
ASSERT_TRUE(ASN1_STRING_set(val.get(), kBytesf000, sizeof(kBytesf000)));
|
||||
static const uint8_t kBitStringf000[] = {0x03, 0x03, 0x00, 0xf0, 0x00};
|
||||
TestSerialize(val.get(), i2d_ASN1_BIT_STRING, kBitStringf000);
|
||||
|
||||
@@ -1052,7 +1051,7 @@ TEST(ASN1Test, StringToUTF8) {
|
||||
{{0, 0, 0, 88, 0, 0, 0xfe, 0xff},
|
||||
V_ASN1_UNIVERSALSTRING,
|
||||
"X\xef\xbb\xbf"},
|
||||
// The maximum code-point should pass though.
|
||||
// The maximum code-point should pass through.
|
||||
{{0, 16, 0xff, 0xfd}, V_ASN1_UNIVERSALSTRING, "\xf4\x8f\xbf\xbd"},
|
||||
// Values outside the Unicode space should not.
|
||||
{{0, 17, 0, 0}, V_ASN1_UNIVERSALSTRING, nullptr},
|
||||
@@ -3087,7 +3086,7 @@ TEST(ASN1Test, OptionalAndDefaultBooleans) {
|
||||
EXPECT_EQ(obj->default_true, ASN1_BOOLEAN_TRUE);
|
||||
EXPECT_EQ(obj->default_false, ASN1_BOOLEAN_FALSE);
|
||||
|
||||
// Include the optinonal fields instead.
|
||||
// Include the optional fields instead.
|
||||
static const uint8_t kFieldsIncluded[] = {0x30, 0x0c, 0x01, 0x01, 0xff,
|
||||
0x81, 0x01, 0x00, 0x82, 0x01,
|
||||
0x00, 0x83, 0x01, 0xff};
|
||||
|
||||
@@ -192,11 +192,11 @@ int asn1_parse_any(CBS *cbs, ASN1_TYPE *out);
|
||||
int asn1_parse_any_as_string(CBS *cbs, ASN1_STRING *out);
|
||||
|
||||
// asn1_marshal_any marshals `in` as a DER-encoded ASN.1 value and writes the
|
||||
// result to `out`. It returns one on success and zeron on error.
|
||||
// result to `out`. It returns one on success and zero on error.
|
||||
int asn1_marshal_any(CBB *out, const ASN1_TYPE *in);
|
||||
|
||||
// asn1_marshal_any_string marshals `in` as a DER-encoded ASN.1 value and writes
|
||||
// the result to `out`. It returns one on success and zeron on error.
|
||||
// the result to `out`. It returns one on success and zero on error.
|
||||
int asn1_marshal_any_string(CBB *out, const ASN1_STRING *in);
|
||||
|
||||
|
||||
|
||||
@@ -499,7 +499,7 @@ TEST(BIOTest, SocketNonBlocking) {
|
||||
bytes_read += ret;
|
||||
}
|
||||
|
||||
// `connect_bio` should become writeable again.
|
||||
// `connect_bio` should become writable again.
|
||||
ASSERT_TRUE(WaitForSocket(accept_sock.get(), WaitType::kWrite))
|
||||
<< LastSocketError();
|
||||
ret = BIO_write(connect_bio.get(), kTestMessage, sizeof(kTestMessage));
|
||||
|
||||
@@ -28,8 +28,8 @@
|
||||
// newlib uses u_short in socket.h without defining it.
|
||||
typedef unsigned short u_short;
|
||||
#endif
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/types.h>
|
||||
#else
|
||||
#include <winsock2.h>
|
||||
typedef int socklen_t;
|
||||
@@ -109,7 +109,7 @@ void bio_clear_socket_error();
|
||||
|
||||
// bio_socket_finish_connect attempts to complete an in-progress, non-blocking
|
||||
// connect operation on `sock`. It returns one if the connect operation
|
||||
// suceeded. Otherwise, it returns zero and sets the last socket error to the
|
||||
// succeeded. Otherwise, it returns zero and sets the last socket error to the
|
||||
// reason it failed.
|
||||
int bio_socket_finish_connect(int sock);
|
||||
|
||||
|
||||
@@ -942,7 +942,7 @@ static int CBS_parse_rfc5280_time_internal(const CBS *cbs, int is_gentime,
|
||||
// If allow_timezone_offset is non-zero, allow for a four digit timezone
|
||||
// offset to be specified even though this is not allowed by RFC 5280. We are
|
||||
// permissive of this for UTCTimes due to the unfortunate existence of
|
||||
// artisinally rolled long lived certificates that were baked into places that
|
||||
// artisanally rolled long lived certificates that were baked into places that
|
||||
// are now difficult to change. These certificates were generated with the
|
||||
// 'openssl' command that permissively allowed the creation of certificates
|
||||
// with notBefore and notAfter times specified as strings for direct
|
||||
|
||||
@@ -273,7 +273,7 @@ aesgcmsiv_htable_polyval:
|
||||
jnz .Lhtable_polyval_prefix_loop
|
||||
jmp .Lhtable_polyval_prefix_complete
|
||||
|
||||
# hash remaining prefix bocks (up to 7 total prefix blocks)
|
||||
# hash remaining prefix blocks (up to 7 total prefix blocks)
|
||||
.align 64
|
||||
.Lhtable_polyval_prefix_loop:
|
||||
sub \$16, $hlp0
|
||||
|
||||
@@ -271,11 +271,11 @@ void gcm_siv_asm_polyval(uint8_t out_tag[16], Span<const CRYPTO_IOVEC> iovecs,
|
||||
return true;
|
||||
};
|
||||
|
||||
bssl::iovec::ForEachBlockRange<AES_BLOCK_SIZE, /*WriteOut=*/false>(aadvecs, f_whole,
|
||||
f_final);
|
||||
bssl::iovec::ForEachBlockRange<AES_BLOCK_SIZE, /*WriteOut=*/false>(
|
||||
aadvecs, f_whole, f_final);
|
||||
|
||||
bssl::iovec::ForEachBlockRange<AES_BLOCK_SIZE, /*WriteOut=*/false>(iovecs, f_whole,
|
||||
f_final);
|
||||
bssl::iovec::ForEachBlockRange<AES_BLOCK_SIZE, /*WriteOut=*/false>(
|
||||
iovecs, f_whole, f_final);
|
||||
|
||||
uint8_t length_block[16];
|
||||
CRYPTO_store_u64_le(length_block, ad_len * 8);
|
||||
@@ -847,8 +847,8 @@ void gcm_siv_polyval(uint8_t out_tag[16], Span<const CRYPTO_IOVEC> iovecs,
|
||||
return true;
|
||||
};
|
||||
|
||||
bssl::iovec::ForEachBlockRange<AES_BLOCK_SIZE, /*WriteOut=*/false>(aadvecs, f_whole,
|
||||
f_final);
|
||||
bssl::iovec::ForEachBlockRange<AES_BLOCK_SIZE, /*WriteOut=*/false>(
|
||||
aadvecs, f_whole, f_final);
|
||||
|
||||
if (encrypt) {
|
||||
bssl::iovec::ForEachBlockRange<AES_BLOCK_SIZE, /*WriteOut=*/false>(
|
||||
@@ -904,7 +904,7 @@ void gcm_siv_keys(const struct aead_aes_gcm_siv_ctx *gcm_siv_ctx,
|
||||
}
|
||||
|
||||
OPENSSL_memcpy(out_keys->auth_key, key_material, 16);
|
||||
// Note the `ctr128_f` function uses a big-endian couner, while AES-GCM-SIV
|
||||
// Note the `ctr128_f` function uses a big-endian counter, while AES-GCM-SIV
|
||||
// uses a little-endian counter. We ignore the return value and only use
|
||||
// `block128_f`. This has a significant performance cost for the fallback
|
||||
// bitsliced AES implementations (bsaes and aes_nohw).
|
||||
|
||||
@@ -232,7 +232,7 @@ static uintptr_t aba(uintptr_t *a, void **b) {
|
||||
TEST(CompilerTest, NoStrictAliasing) {
|
||||
// Sequential memory access must be sequentially consistent across types.
|
||||
// Compilers such as clang and gcc need to be passed -fno-strict-aliasing
|
||||
// for this to remain true at at higher optimization levels. Use with the
|
||||
// for this to remain true at higher optimization levels. Use with the
|
||||
// opposite configuration, -fstrict-aliasing, is not supported.
|
||||
// Even though some subset of type punning through memory is considered
|
||||
// undefined behavior, the subtlety of exactly which subset that is and the
|
||||
|
||||
@@ -13,9 +13,9 @@
|
||||
// limitations under the License.
|
||||
|
||||
#include <algorithm>
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
#include <openssl/bio.h>
|
||||
#include <openssl/conf.h>
|
||||
@@ -153,7 +153,7 @@ key5 = value5
|
||||
},
|
||||
},
|
||||
|
||||
// Trailing backslashes are line continations.
|
||||
// Trailing backslashes are line continuations.
|
||||
{
|
||||
"key=\\\nvalue\nkey2=foo\\\nbar=baz",
|
||||
{
|
||||
@@ -473,7 +473,7 @@ TEST(ConfTest, ParseList) {
|
||||
/*remove_whitespace=*/1,
|
||||
{"ab cd", "", "ef gh"}},
|
||||
};
|
||||
for (const auto& t : kTests) {
|
||||
for (const auto &t : kTests) {
|
||||
SCOPED_TRACE(t.list);
|
||||
SCOPED_TRACE(t.sep);
|
||||
SCOPED_TRACE(t.remove_whitespace);
|
||||
|
||||
+1
-1
@@ -296,7 +296,7 @@ int DH_generate_parameters_ex(DH *dh, int prime_bits, int generator,
|
||||
//
|
||||
// I've implemented the second simple method :-).
|
||||
// Since DH should be using a safe prime (both p and q are prime),
|
||||
// this generator function can take a very very long time to run.
|
||||
// this generator function can take a very, very long time to run.
|
||||
|
||||
// Actually there is no reason to insist that 'generator' be a generator.
|
||||
// It's just as OK (and in some sense better) to use a generator of the
|
||||
|
||||
@@ -849,7 +849,7 @@ bool TestKem(FileTest *t, EVP_PKEY *pkey, bool copy_ctx, bool encapsulate,
|
||||
return;
|
||||
}
|
||||
EXPECT_EQ(result, 1);
|
||||
// The correct output size was writen out.
|
||||
// The correct output size was written out.
|
||||
EXPECT_EQ(secret_size, expected_secret_len);
|
||||
decapsulated_secret.resize(secret_size);
|
||||
EXPECT_EQ(secret, decapsulated_secret);
|
||||
|
||||
+1
-1
@@ -76,7 +76,7 @@ int CRYPTO_get_ex_new_index_ex(ExDataClass *ex_data_class, long argl,
|
||||
int CRYPTO_set_ex_data(CRYPTO_EX_DATA *ad, int index, void *val) {
|
||||
if (index < 0) {
|
||||
// A caller that can accidentally pass in an invalid index into this
|
||||
// function will hit an memory error if `index` happened to be valid, and
|
||||
// function will hit a memory error if `index` happened to be valid, and
|
||||
// expected `val` to be of a different type.
|
||||
abort();
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
# 1.91 and 2.16. As already mentioned, this implementation processes
|
||||
# one byte out of 8KB buffer in 2.10 cycles, while x86_64 counterpart
|
||||
# - in 2.02. x86_64 performance is better, because larger register
|
||||
# bank allows to interleave reduction and multiplication better.
|
||||
# bank allows interleaving reduction and multiplication better.
|
||||
#
|
||||
# Does it make sense to increase Naggr? To start with it's virtually
|
||||
# impossible in 32-bit mode, because of limited register bank
|
||||
|
||||
@@ -53,7 +53,7 @@ struct evp_aead_st {
|
||||
|
||||
// AEADs need to provide one of the following sets of methods:
|
||||
//
|
||||
// - openv + sealv: variable tag lenght AEAD.
|
||||
// - openv + sealv: variable tag length AEAD.
|
||||
// - openv_detached + sealv: fixed tag length AEAD.
|
||||
|
||||
int (*openv)(const EVP_AEAD_CTX *ctx, bssl::Span<const CRYPTO_IOVEC> iovecs,
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
|
||||
|
||||
#if defined(BORINGSSL_FIPS) && defined(BORINGSSL_SHARED_LIBRARY)
|
||||
// BORINGSSL_bcm_text_hash is is default hash value for the FIPS integrity check
|
||||
// that must be replaced with the real value during the build process. This
|
||||
// value need only be distinct, i.e. so that we can safely search-and-replace it
|
||||
// in an object file.
|
||||
// BORINGSSL_bcm_text_hash is the default hash value for the FIPS integrity
|
||||
// check that must be replaced with the real value during the build process.
|
||||
// This value need only be distinct, i.e. so that we can safely
|
||||
// search-and-replace it in an object file.
|
||||
extern const uint8_t BORINGSSL_bcm_text_hash[32] = {
|
||||
0xae, 0x2c, 0xea, 0x2a, 0xbd, 0xa6, 0xf3, 0xec, 0x97, 0x7f, 0x9b,
|
||||
0xf6, 0x94, 0x9a, 0xfc, 0x83, 0x68, 0x27, 0xcb, 0xa0, 0xa0, 0x9f,
|
||||
|
||||
@@ -113,7 +113,7 @@ static void keccak_f(U64 state[25]) {
|
||||
//
|
||||
// From https://keccak.team/files/Keccak-reference-3.0.pdf, section
|
||||
// 1.2, the round constants are based on the output of a LFSR. Thus, as
|
||||
// suggested in the appendix of of
|
||||
// suggested in the appendix of
|
||||
// https://keccak.team/keccak_specs_summary.html, the values are
|
||||
// simply encoded here.
|
||||
static const uint64_t kRoundConstants[24] = {
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
# August 2009.
|
||||
#
|
||||
# George Spelvin has tipped that F_40_59(b,c,d) can be rewritten as
|
||||
# '(c&d) + (b&(c^d))', which allows to accumulate partial results
|
||||
# '(c&d) + (b&(c^d))', which allows accumulating partial results
|
||||
# and lighten "pressure" on scratch registers. This resulted in
|
||||
# >12% performance improvement on contemporary AMD cores (with no
|
||||
# degradation on other CPUs:-). Also, the code was revised to maximize
|
||||
|
||||
@@ -93,7 +93,7 @@ $Hsse2=&QWP(56,"esp");
|
||||
|
||||
$A="mm0"; # B-D and
|
||||
$E="mm4"; # F-H are commonly loaded to respectively mm1-mm3 and
|
||||
# mm5-mm7, but it's done on on-demand basis...
|
||||
# mm5-mm7, but it's done on an on-demand basis...
|
||||
$BxC="mm2"; # ... except for B^C
|
||||
|
||||
sub BODY_00_15_sse2 {
|
||||
|
||||
@@ -45,9 +45,9 @@ BSSL_NAMESPACE_BEGIN
|
||||
// allocation and not new T[n].
|
||||
//
|
||||
// When called with no arguments, it performs value-initialization, not
|
||||
// default-initialization. This means that, if selects a non-user-provided
|
||||
// default-initialization. This means that, if it selects a non-user-provided
|
||||
// constructor, the object will be zero-initialized. (As in any C++ type, once
|
||||
// `T` gains a user-provided constructors, it is responsible for initializing
|
||||
// `T` gains a user-provided constructor, it is responsible for initializing
|
||||
// all fields explicitly.)
|
||||
//
|
||||
// Note: unlike `new`, this does not support non-public constructors.
|
||||
@@ -131,7 +131,7 @@ class RefCounted {
|
||||
// should call these. `DecRefInternal` returns true if the object was freed
|
||||
// and false if there are still references.
|
||||
void UpRefInternal() const {
|
||||
// Safety: the folowing call does not mutate anything other than the atomic
|
||||
// Safety: the following call does not mutate anything other than the atomic
|
||||
// ref-count variable.
|
||||
CRYPTO_refcount_inc(&references_);
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ static int pkcs7_bundle_raw_certificates_cb(CBB *out, void *arg) {
|
||||
}
|
||||
}
|
||||
|
||||
// `certificates` is a implicitly-tagged SET OF.
|
||||
// `certificates` is an implicitly-tagged SET OF.
|
||||
return CBB_flush_asn1_set_of(&certificates) && CBB_flush(out);
|
||||
}
|
||||
|
||||
|
||||
@@ -199,7 +199,7 @@ static int pkcs7_bundle_certificates_cb(CBB *out, void *arg) {
|
||||
}
|
||||
}
|
||||
|
||||
// `certificates` is a implicitly-tagged SET OF.
|
||||
// `certificates` is an implicitly-tagged SET OF.
|
||||
return CBB_flush_asn1_set_of(&certificates) && CBB_flush(out);
|
||||
}
|
||||
|
||||
@@ -232,7 +232,7 @@ static int pkcs7_bundle_crls_cb(CBB *out, void *arg) {
|
||||
}
|
||||
}
|
||||
|
||||
// `crl_data` is a implicitly-tagged SET OF.
|
||||
// `crl_data` is an implicitly-tagged SET OF.
|
||||
return CBB_flush_asn1_set_of(&crl_data) && CBB_flush(out);
|
||||
}
|
||||
|
||||
|
||||
@@ -1103,7 +1103,7 @@ PKCS12 *PKCS12_create(const char *password, const char *name,
|
||||
// recursive data format. Section 5.1 of RFC 7292 describes the encoding
|
||||
// algorithm, but there is no clear overview. A quick summary:
|
||||
//
|
||||
// PKCS#7 defines a ContentInfo structure, which is a overgeneralized typed
|
||||
// PKCS#7 defines a ContentInfo structure, which is an overgeneralized typed
|
||||
// combinator structure for applying cryptography. We care about two types. A
|
||||
// data ContentInfo contains an OCTET STRING and is a leaf node of the
|
||||
// combinator tree. An encrypted-data ContentInfo contains encryption
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include <stdlib.h>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include <optional>
|
||||
|
||||
@@ -694,8 +694,7 @@ static std::vector<Event> TestFunctionPRNGModel(unsigned flags) {
|
||||
if (!sysrand(kAdditionalDataLength)) {
|
||||
return ret;
|
||||
}
|
||||
if (kUsesDaemon && !AppendDaemonEvents(&ret, flags) &&
|
||||
!sysrand(48)) {
|
||||
if (kUsesDaemon && !AppendDaemonEvents(&ret, flags) && !sysrand(48)) {
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
@@ -725,7 +724,7 @@ static std::vector<Event> TestFunctionPRNGModel(unsigned flags) {
|
||||
}
|
||||
|
||||
// Tests that `TestFunctionPRNGModel` is a correct model for the code in
|
||||
// urandom.c, at least to the limits of the the `Event` type.
|
||||
// urandom.c, at least to the limits of the `Event` type.
|
||||
TEST(URandomTest, Test) {
|
||||
char buf[256];
|
||||
|
||||
|
||||
@@ -738,7 +738,7 @@ TEST(RSATest, BadExponent) {
|
||||
ERR_clear_error();
|
||||
}
|
||||
|
||||
// Attempting to generate an funny RSA key length should round down.
|
||||
// Attempting to generate a funny RSA key length should round down.
|
||||
TEST(RSATest, RoundKeyLengths) {
|
||||
UniquePtr<BIGNUM> e(BN_new());
|
||||
ASSERT_TRUE(e);
|
||||
@@ -1392,8 +1392,9 @@ TEST(RSATest, LargeE) {
|
||||
static const uint8_t kDigest[32] = {0};
|
||||
std::vector<uint8_t> sig(RSA_size(priv.get()));
|
||||
size_t len;
|
||||
EXPECT_FALSE(RSA_sign_pss_mgf1(priv.get(), &len, sig.data(), sig.size(), kDigest,
|
||||
sizeof(kDigest), EVP_sha256(), EVP_sha256(),
|
||||
EXPECT_FALSE(RSA_sign_pss_mgf1(priv.get(), &len, sig.data(), sig.size(),
|
||||
kDigest, sizeof(kDigest), EVP_sha256(),
|
||||
EVP_sha256(),
|
||||
/*salt_len=*/32));
|
||||
|
||||
// But the "large e" APIs tolerate it.
|
||||
|
||||
@@ -153,8 +153,8 @@ struct alignas(16) Reg128 {
|
||||
// In aarch64, r18 (accessed as w18 or x18 in a 64-bit context) is the platform
|
||||
// register. iOS says user code may not touch it. We found no clear reference
|
||||
// for Linux. The iOS behavior implies portable assembly cannot use it, and
|
||||
// aarch64 has many registers. Thus this framework ignores register's existence.
|
||||
// We test r18 violations in arm-xlate.pl.
|
||||
// aarch64 has many registers. Thus this framework ignores the register's
|
||||
// existence. We test r18 violations in arm-xlate.pl.
|
||||
#define LOOP_CALLER_STATE_REGISTERS() \
|
||||
/* Per AAPCS64, section 5.1.2, only the bottom 64 bits of v8-v15 */ \
|
||||
/* are preserved. These are accessed as dN. */ \
|
||||
@@ -233,7 +233,7 @@ inline crypto_word_t ToWord(T t) {
|
||||
static_assert(sizeof(T) == 4, "parameter types must be word-sized");
|
||||
return (crypto_word_t)t;
|
||||
#elif defined(OPENSSL_X86_64) || defined(OPENSSL_AARCH64)
|
||||
// AAPCS64, section 5.4.2, clauses C.7 and C.14 says any remaining bits in
|
||||
// AAPCS64, section 5.4.2, clauses C.7 and C.14 say any remaining bits in
|
||||
// aarch are unspecified. iOS64 contradicts this and says the callee extends
|
||||
// arguments up to 32 bits, and only the upper 32 bits are unspecified.
|
||||
//
|
||||
|
||||
@@ -275,7 +275,7 @@ struct trust_token_method_st {
|
||||
int (*client_key_from_bytes)(bssl::TRUST_TOKEN_CLIENT_KEY *key,
|
||||
const uint8_t *in, size_t len);
|
||||
|
||||
// issuer_key_from_bytes decodes a issuer key from `in` and sets `key`
|
||||
// issuer_key_from_bytes decodes an issuer key from `in` and sets `key`
|
||||
// to the resulting key. It returns one on success and zero
|
||||
// on failure.
|
||||
int (*issuer_key_from_bytes)(bssl::TRUST_TOKEN_ISSUER_KEY *key,
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
#include <openssl/x509.h>
|
||||
|
||||
#include "../asn1/internal.h"
|
||||
#include "../mem_internal.h"
|
||||
#include "../internal.h"
|
||||
#include "../mem_internal.h"
|
||||
|
||||
// Internal structures.
|
||||
|
||||
@@ -356,12 +356,12 @@ BSSL_NAMESPACE_END
|
||||
// This is the functions plus an instance of the local variables.
|
||||
struct x509_lookup_st {
|
||||
const X509_LOOKUP_METHOD *method; // the functions
|
||||
void *method_data; // method data
|
||||
void *method_data; // method data
|
||||
|
||||
X509_STORE *store_ctx; // who owns us
|
||||
} /* X509_LOOKUP */;
|
||||
|
||||
// This is a used when verifying cert chains. Since the
|
||||
// This is used when verifying cert chains. Since the
|
||||
// gathering of the cert chain can take some time (and have to be
|
||||
// 'retried', this needs to be kept and passed around.
|
||||
struct x509_store_ctx_st {
|
||||
@@ -379,7 +379,7 @@ struct x509_store_ctx_st {
|
||||
STACK_OF(X509) *trusted_stack;
|
||||
|
||||
// Callbacks for various operations
|
||||
X509_STORE_CTX_verify_cb verify_cb; // error callback
|
||||
X509_STORE_CTX_verify_cb verify_cb; // error callback
|
||||
|
||||
// The following is built up
|
||||
int last_untrusted; // index of last untrusted cert
|
||||
|
||||
@@ -127,7 +127,7 @@ static int do_name_ex(BIO *out, const X509_NAME *n, int indent,
|
||||
const ASN1_OBJECT *fn = X509_NAME_ENTRY_get_object(ent);
|
||||
const ASN1_STRING *val = X509_NAME_ENTRY_get_data(ent);
|
||||
assert((flags & XN_FLAG_FN_MASK) == XN_FLAG_FN_SN);
|
||||
// Print the short name if available, othewise serialize the OID.
|
||||
// Print the short name if available, otherwise serialize the OID.
|
||||
char objtmp[80];
|
||||
const char *objbuf = nullptr;
|
||||
int fn_nid = OBJ_obj2nid(fn);
|
||||
|
||||
@@ -337,7 +337,7 @@ int nc_dns(const ASN1_IA5STRING *dns, const ASN1_IA5STRING *base,
|
||||
}
|
||||
|
||||
// Wildcard partial-match handling ("*.bar.com" matching name constraint
|
||||
// "foo.bar.com"). This only handles the case where the the dnsname and the
|
||||
// "foo.bar.com"). This only handles the case where the dnsname and the
|
||||
// constraint match after removing the leftmost label, otherwise it is handled
|
||||
// by falling through to the check of whether the dnsname is fully within or
|
||||
// fully outside of the constraint.
|
||||
|
||||
@@ -103,7 +103,7 @@ int X509_cmp(const X509 *a, const X509 *b) {
|
||||
const auto *b_impl = FromOpaque(b);
|
||||
// Fill in the `cert_hash` fields.
|
||||
//
|
||||
// TODO(davidben): This may fail, in which case the the hash will be all
|
||||
// TODO(davidben): This may fail, in which case the hash will be all
|
||||
// zeros. This produces a consistent comparison (failures are sticky), but
|
||||
// not a good one. OpenSSL now returns -2, but this is not a consistent
|
||||
// comparison and may cause misbehaving sorts by transitivity. For now, we
|
||||
|
||||
@@ -114,7 +114,7 @@ TEST(X509ExtensionTest, ParseCertificatePolicies) {
|
||||
"1.2.840.113554.4.1.72585.2.1");
|
||||
EXPECT_EQ(policy->qualifiers, nullptr);
|
||||
|
||||
// The second policy has a wide range of qualfiers, to exercise the encoding.
|
||||
// The second policy has a wide range of qualifiers, to exercise the encoding.
|
||||
policy = sk_POLICYINFO_value(policies.get(), 1);
|
||||
EXPECT_EQ(ASN1ObjectToString(policy->policyid),
|
||||
"1.2.840.113554.4.1.72585.2.2");
|
||||
|
||||
@@ -2037,8 +2037,8 @@ static bssl::UniquePtr<X509_NAME> MakeTestName(std::string_view common_name) {
|
||||
}
|
||||
|
||||
static bssl::UniquePtr<X509> MakeTestCert(std::string_view issuer,
|
||||
std::string_view subject, EVP_PKEY *key,
|
||||
bool is_ca) {
|
||||
std::string_view subject,
|
||||
EVP_PKEY *key, bool is_ca) {
|
||||
UniquePtr<X509_NAME> issuer_name = MakeTestName(issuer);
|
||||
UniquePtr<X509_NAME> subject_name = MakeTestName(subject);
|
||||
UniquePtr<X509> cert(X509_new());
|
||||
@@ -6421,7 +6421,7 @@ TEST(X509Test, AddExt) {
|
||||
/*crit=*/1, X509V3_ADD_REPLACE_EXISTING));
|
||||
expect_extensions({{NID_subject_key_identifier, true, skid2_der}});
|
||||
|
||||
// `X509V3_ADD_REPLACE` adds a new extension if not preseent.
|
||||
// `X509V3_ADD_REPLACE` adds a new extension if not present.
|
||||
EXPECT_EQ(
|
||||
1, X509_add1_ext_i2d(x509.get(), NID_basic_constraints, basic1_obj.get(),
|
||||
/*crit=*/1, X509V3_ADD_REPLACE));
|
||||
@@ -6433,7 +6433,7 @@ TEST(X509Test, AddExt) {
|
||||
X509V3_ADD_DELETE));
|
||||
expect_extensions({{NID_subject_key_identifier, true, skid2_der}});
|
||||
|
||||
// `X509V3_ADD_KEEP_EXISTING` adds a new extension if not preseent.
|
||||
// `X509V3_ADD_KEEP_EXISTING` adds a new extension if not present.
|
||||
EXPECT_EQ(
|
||||
1, X509_add1_ext_i2d(x509.get(), NID_basic_constraints, basic1_obj.get(),
|
||||
/*crit=*/1, X509V3_ADD_KEEP_EXISTING));
|
||||
|
||||
@@ -25,10 +25,10 @@ using namespace bssl;
|
||||
// The input and output encrypted as though 64bit cfb mode is being used. The
|
||||
// extra state information to record how much of the 64bit block we have used
|
||||
// is contained in *num;
|
||||
void DES_ede3_cfb64_encrypt(const uint8_t *in, uint8_t *out,
|
||||
long length, DES_key_schedule *ks1,
|
||||
DES_key_schedule *ks2, DES_key_schedule *ks3,
|
||||
DES_cblock *ivec, int *num, int enc) {
|
||||
void DES_ede3_cfb64_encrypt(const uint8_t *in, uint8_t *out, long length,
|
||||
DES_key_schedule *ks1, DES_key_schedule *ks2,
|
||||
DES_key_schedule *ks3, DES_cblock *ivec, int *num,
|
||||
int enc) {
|
||||
uint32_t v0, v1;
|
||||
long l = length;
|
||||
int n = *num;
|
||||
@@ -86,7 +86,7 @@ void DES_ede3_cfb64_encrypt(const uint8_t *in, uint8_t *out,
|
||||
*num = n;
|
||||
}
|
||||
|
||||
// This is compatible with the single key CFB-r for DES, even thought that's
|
||||
// This is compatible with the single key CFB-r for DES, even though that's
|
||||
// not what EVP needs.
|
||||
|
||||
void DES_ede3_cfb_encrypt(const uint8_t *in, uint8_t *out, int numbits,
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ release, do the following:
|
||||
|
||||
2. Update `MODULE.bazel` with the new version and upload to Gerrit.
|
||||
|
||||
3. Once that CL lands, make a annotated git tag at the revision. This can be
|
||||
3. Once that CL lands, make an annotated git tag at the revision. This can be
|
||||
[done from Gerrit](https://boringssl-review.googlesource.com/admin/repos/boringssl,tags).
|
||||
The "Annotation" field must be non-empty. (Just using the name of the tag
|
||||
again is fine.)
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#ifndef OPENSSL_HEADER_AEAD_H
|
||||
#define OPENSSL_HEADER_AEAD_H
|
||||
|
||||
#include <openssl/base.h> // IWYU pragma: export
|
||||
#include <openssl/base.h> // IWYU pragma: export
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
@@ -326,7 +326,7 @@ OPENSSL_EXPORT int EVP_AEAD_CTX_seal(const EVP_AEAD_CTX *ctx, uint8_t *out,
|
||||
//
|
||||
// At most `in_len` bytes are written to `out`. In order to ensure success,
|
||||
// `max_out_len` should be at least `in_len`. On successful return, `*out_len`
|
||||
// is set to the the actual number of bytes written.
|
||||
// is set to the actual number of bytes written.
|
||||
//
|
||||
// The length of `nonce`, `nonce_len`, must be equal to the result of
|
||||
// `EVP_AEAD_nonce_length` for this AEAD.
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
// when included in assembly, adds that metadata. It also makes defines like
|
||||
// `OPENSSL_X86_64` available and includes the prefixing macros.
|
||||
//
|
||||
// Including this header in an assembly file imples:
|
||||
// Including this header in an assembly file implies:
|
||||
//
|
||||
// - The file does not require an executable stack.
|
||||
//
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#ifndef OPENSSL_HEADER_ASN1_H
|
||||
#define OPENSSL_HEADER_ASN1_H
|
||||
|
||||
#include <openssl/base.h> // IWYU pragma: export
|
||||
#include <openssl/base.h> // IWYU pragma: export
|
||||
|
||||
#include <time.h>
|
||||
|
||||
@@ -916,7 +916,8 @@ DECLARE_ASN1_ITEM(ASN1_BIT_STRING)
|
||||
OPENSSL_EXPORT uint8_t ASN1_BIT_STRING_unused_bits(const ASN1_BIT_STRING *str);
|
||||
|
||||
// ASN1_BIT_STRING_set calls `ASN1_STRING_set`.
|
||||
OPENSSL_EXPORT int ASN1_BIT_STRING_set(ASN1_BIT_STRING *str, const uint8_t *data,
|
||||
OPENSSL_EXPORT int ASN1_BIT_STRING_set(ASN1_BIT_STRING *str,
|
||||
const uint8_t *data,
|
||||
ossl_ssize_t length);
|
||||
|
||||
// ASN1_BIT_STRING_set1 sets `str` to a BIT STRING containing `length` bytes
|
||||
@@ -1324,8 +1325,8 @@ OPENSSL_EXPORT int ASN1_TIME_to_posix(const ASN1_TIME *t, int64_t *out);
|
||||
// non-standard four-digit timezone offsets on UTC times. On success, one is
|
||||
// returned. On failure, zero is returned. `ASN1_TIME_to_posix` should normally
|
||||
// be used instead of this function.
|
||||
OPENSSL_EXPORT int ASN1_TIME_to_posix_nonstandard(
|
||||
const ASN1_TIME *t, int64_t *out);
|
||||
OPENSSL_EXPORT int ASN1_TIME_to_posix_nonstandard(const ASN1_TIME *t,
|
||||
int64_t *out);
|
||||
|
||||
// TODO(davidben): Expand and document function prototypes generated in macros.
|
||||
|
||||
@@ -1359,7 +1360,7 @@ DECLARE_ASN1_ITEM(ASN1_NULL)
|
||||
|
||||
// Object identifiers.
|
||||
//
|
||||
// An `ASN1_OBJECT` represents a ASN.1 OBJECT IDENTIFIER. See also obj.h for
|
||||
// An `ASN1_OBJECT` represents an ASN.1 OBJECT IDENTIFIER. See also obj.h for
|
||||
// additional functions relating to `ASN1_OBJECT`.
|
||||
//
|
||||
// TODO(davidben): What's the relationship between asn1.h and obj.h? Most of
|
||||
|
||||
@@ -334,7 +334,7 @@ OPENSSL_EXPORT int BIO_read_asn1(BIO *bio, uint8_t **out, size_t *out_len,
|
||||
#define BIO_NOCLOSE 0
|
||||
#define BIO_CLOSE 1
|
||||
|
||||
// BIO_s_mem returns a `BIO_METHOD` that uses a in-memory buffer.
|
||||
// BIO_s_mem returns a `BIO_METHOD` that uses an in-memory buffer.
|
||||
OPENSSL_EXPORT const BIO_METHOD *BIO_s_mem(void);
|
||||
|
||||
// BIO_new_mem_buf creates read-only BIO that reads from `len` bytes at `buf`.
|
||||
@@ -386,7 +386,7 @@ OPENSSL_EXPORT int BIO_set_mem_eof_return(BIO *bio, int eof_value);
|
||||
// File descriptor BIOs.
|
||||
//
|
||||
// File descriptor BIOs are wrappers around the system's `read` and `write`
|
||||
// functions. If the close flag is set then then `close` is called on the
|
||||
// functions. If the close flag is set then `close` is called on the
|
||||
// underlying file descriptor when the BIO is freed.
|
||||
//
|
||||
// `BIO_reset` attempts to seek the file pointer to the start of file using
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#ifndef OPENSSL_HEADER_CIPHER_H
|
||||
#define OPENSSL_HEADER_CIPHER_H
|
||||
|
||||
#include <openssl/base.h> // IWYU pragma: export
|
||||
#include <openssl/base.h> // IWYU pragma: export
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
@@ -459,7 +459,7 @@ OPENSSL_EXPORT int EVP_BytesToKey(const EVP_CIPHER *type, const EVP_MD *md,
|
||||
|
||||
// EVP_CIPH_FLAG_NON_FIPS_ALLOW is meaningless. In OpenSSL it permits non-FIPS
|
||||
// algorithms in FIPS mode. But BoringSSL FIPS mode doesn't prohibit algorithms
|
||||
// (it's up the the caller to use the FIPS module in a fashion compliant with
|
||||
// (it's up to the caller to use the FIPS module in a fashion compliant with
|
||||
// their needs). Thus this exists only to allow code to compile.
|
||||
#define EVP_CIPH_FLAG_NON_FIPS_ALLOW 0
|
||||
|
||||
@@ -718,7 +718,7 @@ struct evp_cipher_ctx_st {
|
||||
const EVP_CIPHER *cipher;
|
||||
|
||||
// app_data is a pointer to opaque, user data.
|
||||
void *app_data; // application stuff
|
||||
void *app_data; // application stuff
|
||||
|
||||
// cipher_data points to the `cipher` specific state.
|
||||
void *cipher_data;
|
||||
|
||||
@@ -314,7 +314,7 @@ OPENSSL_EXPORT void EVP_MD_CTX_set_flags(EVP_MD_CTX *ctx, int flags);
|
||||
|
||||
// EVP_MD_CTX_FLAG_NON_FIPS_ALLOW is meaningless. In OpenSSL it permits non-FIPS
|
||||
// algorithms in FIPS mode. But BoringSSL FIPS mode doesn't prohibit algorithms
|
||||
// (it's up the the caller to use the FIPS module in a fashion compliant with
|
||||
// (it's up to the caller to use the FIPS module in a fashion compliant with
|
||||
// their needs). Thus this exists only to allow code to compile.
|
||||
#define EVP_MD_CTX_FLAG_NON_FIPS_ALLOW 0
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ extern "C" {
|
||||
|
||||
|
||||
// point_conversion_form_t enumerates forms, as defined in X9.62 (ECDSA), for
|
||||
// the encoding of a elliptic curve point (x,y)
|
||||
// the encoding of an elliptic curve point (x,y)
|
||||
typedef enum {
|
||||
// POINT_CONVERSION_COMPRESSED indicates that the point is encoded as z||x,
|
||||
// where the octet z specifies which solution of the quadratic equation y
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#ifndef OPENSSL_HEADER_EC_KEY_H
|
||||
#define OPENSSL_HEADER_EC_KEY_H
|
||||
|
||||
#include <openssl/base.h> // IWYU pragma: export
|
||||
#include <openssl/base.h> // IWYU pragma: export
|
||||
|
||||
#include <openssl/ec.h>
|
||||
#include <openssl/engine.h>
|
||||
@@ -101,7 +101,7 @@ OPENSSL_EXPORT unsigned EC_KEY_get_enc_flags(const EC_KEY *key);
|
||||
// bitwise-OR of `EC_PKEY_*` values.
|
||||
OPENSSL_EXPORT void EC_KEY_set_enc_flags(EC_KEY *key, unsigned flags);
|
||||
|
||||
// EC_KEY_get_conv_form returns the conversation form that will be used by
|
||||
// EC_KEY_get_conv_form returns the conversion form that will be used by
|
||||
// `key`.
|
||||
OPENSSL_EXPORT point_conversion_form_t EC_KEY_get_conv_form(const EC_KEY *key);
|
||||
|
||||
|
||||
@@ -1136,7 +1136,7 @@ OPENSSL_EXPORT int EVP_PKEY_CTX_set_ec_paramgen_curve_nid(EVP_PKEY_CTX *ctx,
|
||||
|
||||
// Diffie-Hellman-specific control functions.
|
||||
|
||||
// EVP_PKEY_CTX_set_dh_pad configures configures whether `ctx`, which must be an
|
||||
// EVP_PKEY_CTX_set_dh_pad configures whether `ctx`, which must be an
|
||||
// `EVP_PKEY_derive` operation, configures the handling of leading zeros in the
|
||||
// Diffie-Hellman shared secret. If `pad` is zero, leading zeros are removed
|
||||
// from the secret. If `pad` is non-zero, the fixed-width shared secret is used
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
#ifndef OPENSSL_HEADER_MEM_H
|
||||
#define OPENSSL_HEADER_MEM_H
|
||||
|
||||
#include <openssl/base.h> // IWYU pragma: export
|
||||
#include <openssl/base.h> // IWYU pragma: export
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
@@ -54,11 +54,11 @@ OPENSSL_EXPORT void *OPENSSL_calloc(size_t num, size_t size);
|
||||
// allocated and the data at `ptr` is always wiped and freed. Memory is
|
||||
// allocated with `OPENSSL_malloc` and must be freed with `OPENSSL_free`.
|
||||
OPENSSL_EXPORT void *OPENSSL_realloc(void *ptr, size_t new_size);
|
||||
#endif // !_BORINGSSL_PROHIBIT_OPENSSL_MALLOC
|
||||
#endif // !_BORINGSSL_PROHIBIT_OPENSSL_MALLOC
|
||||
|
||||
// OPENSSL_free does nothing if `ptr` is NULL. Otherwise it zeros out the
|
||||
// memory allocated at `ptr` and frees it along with the private data.
|
||||
// It must only be used on on `ptr` values obtained from `OPENSSL_malloc`
|
||||
// It must only be used on `ptr` values obtained from `OPENSSL_malloc`
|
||||
OPENSSL_EXPORT void OPENSSL_free(void *ptr);
|
||||
|
||||
// OPENSSL_cleanse zeros out `len` bytes of memory at `ptr`. This is similar to
|
||||
@@ -124,7 +124,7 @@ OPENSSL_EXPORT int OPENSSL_strncasecmp(const char *a, const char *b, size_t n);
|
||||
|
||||
// DECIMAL_SIZE returns an upper bound for the length of the decimal
|
||||
// representation of the given type.
|
||||
#define DECIMAL_SIZE(type) ((sizeof(type)*8+2)/3+1)
|
||||
#define DECIMAL_SIZE(type) ((sizeof(type) * 8 + 2) / 3 + 1)
|
||||
|
||||
// BIO_snprintf has the same behavior as snprintf(3).
|
||||
OPENSSL_EXPORT int BIO_snprintf(char *buf, size_t n, const char *format, ...)
|
||||
|
||||
@@ -35,7 +35,7 @@ class OPENSSL_EXPORT Certificate {
|
||||
~Certificate();
|
||||
Certificate& operator=(const Certificate& other) = delete;
|
||||
|
||||
// FromDER returns a certificate from an DER-encoded X.509 object in `der`.
|
||||
// FromDER returns a certificate from a DER-encoded X.509 object in `der`.
|
||||
// In the event of a failure, it will return no value, and `out_diagnostic`
|
||||
// may be set to a string of human readable debugging information if
|
||||
// information about the failure is available.
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#ifndef OPENSSL_HEADER_POSIX_TIME_H
|
||||
#define OPENSSL_HEADER_POSIX_TIME_H
|
||||
|
||||
#include <openssl/base.h> // IWYU pragma: export
|
||||
#include <openssl/base.h> // IWYU pragma: export
|
||||
|
||||
#include <time.h>
|
||||
|
||||
@@ -27,9 +27,9 @@ extern "C" {
|
||||
// Time functions.
|
||||
|
||||
|
||||
// OPENSSL_posix_to_tm converts a int64_t POSIX time value in `time`, which must
|
||||
// be in the range of year 0000 to 9999, to a broken out time value in `tm`. It
|
||||
// returns one on success and zero on error.
|
||||
// OPENSSL_posix_to_tm converts an int64_t POSIX time value in `time`, which
|
||||
// must be in the range of year 0000 to 9999, to a broken out time value in
|
||||
// `tm`. It returns one on success and zero on error.
|
||||
OPENSSL_EXPORT int OPENSSL_posix_to_tm(int64_t time, struct tm *out_tm);
|
||||
|
||||
// OPENSSL_tm_to_posix converts a time value between the years 0 and 9999 in
|
||||
|
||||
@@ -368,7 +368,7 @@ OPENSSL_EXPORT int RSA_sign_pss_mgf1(RSA *rsa, size_t *out_len, uint8_t *out,
|
||||
// a DigestInfo structure.
|
||||
//
|
||||
// If `padding` is `RSA_NO_PADDING`, this function only performs the raw private
|
||||
// key operation, interpreting `in` as a integer modulo n. The caller is
|
||||
// key operation, interpreting `in` as an integer modulo n. The caller is
|
||||
// responsible for hashing the input and encoding it for the signature scheme
|
||||
// being implemented.
|
||||
//
|
||||
|
||||
@@ -2636,7 +2636,7 @@ OPENSSL_EXPORT int SSL_CTX_set1_group_ids_with_flags(SSL_CTX *ctx,
|
||||
|
||||
// SSL_set1_group_ids_with_flags sets the preferred groups for `ssl` to
|
||||
// `group_ids`, using the corresponding `flags` for each element, which is a set
|
||||
// of SSL_GROUP_FLAG_* values ORed toegether. Each element of `group_ids` should
|
||||
// of SSL_GROUP_FLAG_* values ORed together. Each element of `group_ids` should
|
||||
// be a unique one of the `SSL_GROUP_*` constants. If `group_ids` is empty, a
|
||||
// default list of groups and flags defaulting to zero will be set instead.
|
||||
// `group_ids` and `flags` should both have `num_group_ids` elements. It
|
||||
@@ -4294,7 +4294,7 @@ struct ssl_quic_method_st {
|
||||
int (*send_alert)(SSL *ssl, enum ssl_encryption_level_t level, uint8_t alert);
|
||||
};
|
||||
|
||||
// SSL_quic_max_handshake_flight_len returns returns the maximum number of bytes
|
||||
// SSL_quic_max_handshake_flight_len returns the maximum number of bytes
|
||||
// that may be received at the given encryption level. This function should be
|
||||
// used to limit buffering in the QUIC implementation.
|
||||
//
|
||||
@@ -4889,7 +4889,7 @@ OPENSSL_EXPORT int SSL_CTX_set_record_protocol_version(SSL_CTX *ctx,
|
||||
// retains its final flight for retransmission in case of loss. There is no
|
||||
// explicit protocol signal for when this completes, though after receiving
|
||||
// application data and/or a timeout it is likely that this is no longer needed.
|
||||
// BoringSSL does not currently evaluate either condition and leaves it it to
|
||||
// BoringSSL does not currently evaluate either condition and leaves it to
|
||||
// the caller to determine whether this is now unnecessary. This applies when
|
||||
// `ssl` is a server for full handshakes and when `ssl` is a client for full
|
||||
// handshakes.
|
||||
|
||||
@@ -81,7 +81,7 @@ OPENSSL_EXPORT int X509_up_ref(X509 *x509);
|
||||
// The caller must call `X509_free` on the result to release the reference.
|
||||
//
|
||||
// WARNING: Although the result is non-const for use with `X509_free`, it is
|
||||
// still shared with other parts of the appplication for the same object. Avoid
|
||||
// still shared with other parts of the application for the same object. Avoid
|
||||
// mutating shared `X509`s.
|
||||
OPENSSL_EXPORT X509 *X509_dup_ref(const X509 *x509);
|
||||
|
||||
@@ -107,7 +107,7 @@ OPENSSL_EXPORT X509 *d2i_X509(X509 **out, const uint8_t **inp, long len);
|
||||
|
||||
// X509_parse_with_algorithms parses an X.509 structure from `buf` and returns a
|
||||
// fresh X509 or NULL on error. There must not be any trailing data in `buf`.
|
||||
// The returned structure (if any) increment's `buf`'s reference count and
|
||||
// The returned structure (if any) increments `buf`'s reference count and
|
||||
// retains a reference to it.
|
||||
//
|
||||
// Only the `num_algs` algorithms from `algs` will be considered when parsing
|
||||
@@ -310,7 +310,7 @@ typedef STACK_OF(GENERAL_NAME) GENERAL_NAMES;
|
||||
// X509_get0_authority_issuer returns the authorityCertIssuer of `x509`'s
|
||||
// authority key identifier, if the extension and field are present. (See
|
||||
// RFC 5280, section 4.2.1.1.) It returns NULL if the extension is not present,
|
||||
// if it is present but lacks a authorityCertIssuer field, or if some extension
|
||||
// if it is present but lacks an authorityCertIssuer field, or if some extension
|
||||
// in `x509` was invalid.
|
||||
//
|
||||
// TODO(crbug.com/boringssl/381): Decoding an `X509` object will not check for
|
||||
@@ -321,7 +321,7 @@ OPENSSL_EXPORT const GENERAL_NAMES *X509_get0_authority_issuer(X509 *x509);
|
||||
// X509_get0_authority_serial returns the authorityCertSerialNumber of `x509`'s
|
||||
// authority key identifier, if the extension and field are present. (See
|
||||
// RFC 5280, section 4.2.1.1.) It returns NULL if the extension is not present,
|
||||
// if it is present but lacks a authorityCertSerialNumber field, or if some
|
||||
// if it is present but lacks an authorityCertSerialNumber field, or if some
|
||||
// extension in `x509` was invalid.
|
||||
//
|
||||
// TODO(crbug.com/boringssl/381): Decoding an `X509` object will not check for
|
||||
@@ -1689,7 +1689,7 @@ OPENSSL_EXPORT int X509_EXTENSION_set_object(X509_EXTENSION *ex,
|
||||
// to non-critical if `crit` is zero.
|
||||
OPENSSL_EXPORT int X509_EXTENSION_set_critical(X509_EXTENSION *ex, int crit);
|
||||
|
||||
// X509_EXTENSION_set_data set's `ex`'s extension value to a copy of `data`. It
|
||||
// X509_EXTENSION_set_data sets `ex`'s extension value to a copy of `data`. It
|
||||
// returns one on success and zero on error.
|
||||
OPENSSL_EXPORT int X509_EXTENSION_set_data(X509_EXTENSION *ex,
|
||||
const ASN1_OCTET_STRING *data);
|
||||
@@ -1888,7 +1888,7 @@ OPENSSL_EXPORT X509_EXTENSION *X509V3_EXT_i2d(int ext_nid, int crit,
|
||||
#define X509V3_ADD_DEFAULT 0L
|
||||
|
||||
// X509V3_ADD_APPEND causes the function to unconditionally appended the new
|
||||
// extension to to the extensions list, even if there is a duplicate.
|
||||
// extension to the extensions list, even if there is a duplicate.
|
||||
#define X509V3_ADD_APPEND 1L
|
||||
|
||||
// X509V3_ADD_REPLACE causes the function to replace the existing extension, or
|
||||
@@ -3330,7 +3330,7 @@ OPENSSL_EXPORT void X509_VERIFY_PARAM_set_time_posix(X509_VERIFY_PARAM *param,
|
||||
// X509_VERIFY_PARAM_add0_policy adds `policy` to the user-initial-policy-set
|
||||
// (see Section 6.1.1 of RFC 5280). On success, it takes ownership of
|
||||
// `policy` and returns one. Otherwise, it returns zero and the caller retains
|
||||
// owneship of `policy`.
|
||||
// ownership of `policy`.
|
||||
OPENSSL_EXPORT int X509_VERIFY_PARAM_add0_policy(X509_VERIFY_PARAM *param,
|
||||
ASN1_OBJECT *policy);
|
||||
|
||||
@@ -5031,7 +5031,7 @@ OPENSSL_EXPORT ASN1_OCTET_STRING *a2i_IPADDRESS(const char *ipasc);
|
||||
// decoded mask. IPv4 ranges are represented as 8-byte strings and IPv6 ranges
|
||||
// as 32-byte strings. On failure, it returns NULL.
|
||||
//
|
||||
// The text format decoded by this function is not the standard CIDR notiation.
|
||||
// The text format decoded by this function is not the standard CIDR notation.
|
||||
// Instead, the mask after the "/" is represented as another IP address. For
|
||||
// example, "192.168.0.0/16" would be written "192.168.0.0/255.255.0.0".
|
||||
OPENSSL_EXPORT ASN1_OCTET_STRING *a2i_IPADDRESS_NC(const char *ipasc);
|
||||
@@ -5333,7 +5333,7 @@ BORINGSSL_MAKE_DELETER(X509_VERIFY_PARAM, X509_VERIFY_PARAM_free)
|
||||
|
||||
BSSL_NAMESPACE_END
|
||||
|
||||
} // extern C++
|
||||
} // extern C++
|
||||
#endif // !BORINGSSL_NO_CXX
|
||||
|
||||
#define X509_R_AKID_MISMATCH 100
|
||||
|
||||
@@ -80,7 +80,7 @@ bool DNSNameMatches(std::string_view name, std::string_view dns_constraint,
|
||||
}
|
||||
|
||||
// Wildcard partial-match handling ("*.bar.com" matching name constraint
|
||||
// "foo.bar.com"). This only handles the case where the the dnsname and the
|
||||
// "foo.bar.com"). This only handles the case where the dnsname and the
|
||||
// constraint match after removing the leftmost label, otherwise it is handled
|
||||
// by falling through to the check of whether the dnsname is fully within or
|
||||
// fully outside of the constraint.
|
||||
|
||||
@@ -38,7 +38,7 @@ class OPENSSL_EXPORT NameConstraints {
|
||||
// Parses a DER-encoded NameConstraints extension and initializes this object.
|
||||
// `extension_value` should be the extnValue from the extension (not including
|
||||
// the OCTET STRING tag). `is_critical` should be true if the extension was
|
||||
// marked critical. Returns nullptr if parsing the the extension failed.
|
||||
// marked critical. Returns nullptr if parsing the extension failed.
|
||||
// The object may reference data from `extension_value`, so is only valid as
|
||||
// long as `extension_value` is.
|
||||
static std::unique_ptr<NameConstraints> Create(der::Input extension_value,
|
||||
|
||||
@@ -276,7 +276,7 @@ TEST(ParseTbsCertificateTest, Version2IssuerUniqueId) {
|
||||
CertificateVersion::V2);
|
||||
}
|
||||
|
||||
// A version 2 certificate with both a issuer and subject unique ID field.
|
||||
// A version 2 certificate with both an issuer and subject unique ID field.
|
||||
TEST(ParseTbsCertificateTest, Version2IssuerAndSubjectUniqueId) {
|
||||
RunTbsCertificateTestGivenVersion("tbs_v2_issuer_and_subject_unique_id.pem",
|
||||
CertificateVersion::V2);
|
||||
|
||||
+3
-2
@@ -752,7 +752,8 @@ VerifyError CertPathBuilderResultPath::GetVerifyError() const {
|
||||
// Diagnostic string is always "everything" about the path.
|
||||
std::string diagnostic = errors.ToDebugString(certs);
|
||||
if (!errors.ContainsHighSeverityErrors()) {
|
||||
// TODO(bbe3): Having to check this after seems awkward: crbug.com/boringssl/713
|
||||
// TODO(bbe3): Having to check this after seems awkward:
|
||||
// crbug.com/boringssl/713
|
||||
if (GetTrustedCert()) {
|
||||
return VerifyError(VerifyError::StatusCode::PATH_VERIFIED, 0,
|
||||
std::move(diagnostic));
|
||||
@@ -888,7 +889,7 @@ const VerifyError CertPathBuilder::Result::GetBestPathVerifyError() const {
|
||||
return GetBestValidPath()->GetVerifyError();
|
||||
}
|
||||
// We can only return one error. Returning the errors corresponding to the
|
||||
// limits if they they appear on any path will make this error prominent even
|
||||
// limits if they appear on any path will make this error prominent even
|
||||
// if there are other paths with different or multiple errors.
|
||||
if (exceeded_iteration_limit) {
|
||||
return VerifyError(
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
|
||||
#include <openssl/base.h>
|
||||
#include <openssl/bytestring.h>
|
||||
#include <openssl/pool.h>
|
||||
#include <openssl/pki/verify.h>
|
||||
#include <openssl/pool.h>
|
||||
|
||||
#include "cert_error_params.h"
|
||||
#include "cert_issuer_source.h"
|
||||
@@ -78,11 +78,9 @@ class TestPathBuilderDelegate : public SimplePathBuilderDelegate {
|
||||
|
||||
void DisallowPrecert() { allow_precertificate_ = false; }
|
||||
|
||||
bool AcceptPreCertificates() override {
|
||||
return allow_precertificate_;
|
||||
}
|
||||
bool AcceptPreCertificates() override { return allow_precertificate_; }
|
||||
|
||||
private:
|
||||
private:
|
||||
bool deadline_is_expired_ = false;
|
||||
bool use_signature_cache_ = false;
|
||||
bool allow_precertificate_ = false;
|
||||
@@ -1010,9 +1008,7 @@ TEST_F(PathBuilderMultiRootTest, TestDepthLimitMultiplePaths) {
|
||||
}
|
||||
|
||||
TEST_F(PathBuilderMultiRootTest, TestPreCertificate) {
|
||||
|
||||
std::string test_dir =
|
||||
"testdata/path_builder_unittest/precertificate/";
|
||||
std::string test_dir = "testdata/path_builder_unittest/precertificate/";
|
||||
std::shared_ptr<const ParsedCertificate> root1 =
|
||||
ReadCertFromFile(test_dir + "root.pem");
|
||||
ASSERT_TRUE(root1);
|
||||
@@ -1472,7 +1468,8 @@ TEST_F(PathBuilderKeyRolloverTest, ExploreAllPathsWithIterationLimit) {
|
||||
ASSERT_EQ(error.Code(), VerifyError::StatusCode::PATH_VERIFIED)
|
||||
<< error.DiagnosticString();
|
||||
} else {
|
||||
ASSERT_EQ(error.Code(), VerifyError::StatusCode::PATH_ITERATION_COUNT_EXCEEDED)
|
||||
ASSERT_EQ(error.Code(),
|
||||
VerifyError::StatusCode::PATH_ITERATION_COUNT_EXCEEDED)
|
||||
<< error.DiagnosticString();
|
||||
}
|
||||
|
||||
@@ -2136,7 +2133,7 @@ TEST_F(PathBuilderDistrustTest, TargetIntermediateRoot) {
|
||||
CertPathBuilder::Result result = RunPathBuilderWithDistrustedCert(nullptr);
|
||||
{
|
||||
ASSERT_TRUE(result.HasValidPath());
|
||||
// The built path should be identical the the one read from disk.
|
||||
// The built path should be identical to the one read from disk.
|
||||
const auto &path = *result.GetBestValidPath();
|
||||
ASSERT_EQ(test_.chain.size(), path.certs.size());
|
||||
for (size_t i = 0; i < test_.chain.size(); ++i) {
|
||||
@@ -2330,8 +2327,7 @@ TEST_F(PathBuilderCheckPathAfterVerificationTest, TestVerifyErrorMapping) {
|
||||
errors->AddError(mapping.internal_error, nullptr);
|
||||
|
||||
VerifyError error = result.GetBestPathVerifyError();
|
||||
ASSERT_EQ(error.Code(), mapping.code)
|
||||
<< error.DiagnosticString();
|
||||
ASSERT_EQ(error.Code(), mapping.code) << error.DiagnosticString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2635,44 +2631,42 @@ TEST_F(PathBuilderMTCPlants04Test, Verification) {
|
||||
EXPECT_FALSE(result.HasValidPath());
|
||||
|
||||
// Cert with multiple cosigners (including valid CA cosigner) should validate
|
||||
// succesfully, ignoring the unknown cosigners.
|
||||
// successfully, ignoring the unknown cosigners.
|
||||
std::shared_ptr<const ParsedCertificate> standalone_leaf_3_cosigners;
|
||||
ASSERT_TRUE(
|
||||
ReadTestCert("mtc_plants04/mtc-leaf-standalone-3cosigners.pem",
|
||||
&standalone_leaf_3_cosigners));
|
||||
result = RunPathBuilder(standalone_leaf_3_cosigners,
|
||||
&trust_store_no_subtrees, nullptr, nullptr);
|
||||
ASSERT_TRUE(ReadTestCert("mtc_plants04/mtc-leaf-standalone-3cosigners.pem",
|
||||
&standalone_leaf_3_cosigners));
|
||||
result = RunPathBuilder(standalone_leaf_3_cosigners, &trust_store_no_subtrees,
|
||||
nullptr, nullptr);
|
||||
EXPECT_TRUE(result.HasValidPath());
|
||||
// but it should fail if the CA key is wrong:
|
||||
result = RunPathBuilder(standalone_leaf_3_cosigners,
|
||||
&trust_store_no_subtrees_wrong_key, nullptr, nullptr);
|
||||
&trust_store_no_subtrees_wrong_key, nullptr, nullptr);
|
||||
EXPECT_FALSE(result.HasValidPath());
|
||||
|
||||
// Cert with a cosigner but no CA cosigner should fail:
|
||||
std::shared_ptr<const ParsedCertificate> standalone_leaf_no_ca_signer;
|
||||
ASSERT_TRUE(
|
||||
ReadTestCert("mtc_plants04/mtc-leaf-standalone-no_ca_signer.pem",
|
||||
&standalone_leaf_no_ca_signer));
|
||||
ASSERT_TRUE(ReadTestCert("mtc_plants04/mtc-leaf-standalone-no_ca_signer.pem",
|
||||
&standalone_leaf_no_ca_signer));
|
||||
result = RunPathBuilder(standalone_leaf_no_ca_signer,
|
||||
&trust_store_no_subtrees, nullptr, nullptr);
|
||||
&trust_store_no_subtrees, nullptr, nullptr);
|
||||
EXPECT_FALSE(result.HasValidPath());
|
||||
|
||||
// Cert with a duplicate CA cosigner should fail:
|
||||
std::shared_ptr<const ParsedCertificate> standalone_leaf_duplicate_ca_signer;
|
||||
ASSERT_TRUE(
|
||||
ReadTestCert("mtc_plants04/mtc-leaf-standalone-duplicate_ca_signer.pem",
|
||||
&standalone_leaf_duplicate_ca_signer));
|
||||
&standalone_leaf_duplicate_ca_signer));
|
||||
result = RunPathBuilder(standalone_leaf_duplicate_ca_signer,
|
||||
&trust_store_no_subtrees, nullptr, nullptr);
|
||||
&trust_store_no_subtrees, nullptr, nullptr);
|
||||
EXPECT_FALSE(result.HasValidPath());
|
||||
|
||||
// Cert with a cosigners in non-sorted order should fail:
|
||||
std::shared_ptr<const ParsedCertificate> standalone_leaf_cosigner_wrong_order;
|
||||
ASSERT_TRUE(
|
||||
ReadTestCert("mtc_plants04/mtc-leaf-standalone-cosigner_wrong_order.pem",
|
||||
&standalone_leaf_cosigner_wrong_order));
|
||||
&standalone_leaf_cosigner_wrong_order));
|
||||
result = RunPathBuilder(standalone_leaf_cosigner_wrong_order,
|
||||
&trust_store_no_subtrees, nullptr, nullptr);
|
||||
&trust_store_no_subtrees, nullptr, nullptr);
|
||||
EXPECT_FALSE(result.HasValidPath());
|
||||
}
|
||||
|
||||
|
||||
@@ -328,7 +328,7 @@ TEST(SignatureAlgorithmTest, ParseDerSha224WithRSAEncryptionNullParams) {
|
||||
EXPECT_FALSE(ParseSignatureAlgorithm(der::Input(kData)));
|
||||
}
|
||||
|
||||
// Parses a ecdsa-with-SHA1 which contains no parameters field.
|
||||
// Parses an ecdsa-with-SHA1 which contains no parameters field.
|
||||
//
|
||||
// SEQUENCE (1 elem)
|
||||
// OBJECT IDENTIFIER 1.2.840.10045.4.1
|
||||
@@ -344,7 +344,7 @@ TEST(SignatureAlgorithmTest, ParseDerEcdsaWithSHA1NoParams) {
|
||||
SignatureAlgorithm::kEcdsaSha1);
|
||||
}
|
||||
|
||||
// Parses a ecdsa-with-SHA1 which contains a NULL parameters field.
|
||||
// Parses an ecdsa-with-SHA1 which contains a NULL parameters field.
|
||||
//
|
||||
// SEQUENCE (2 elem)
|
||||
// OBJECT IDENTIFIER 1.2.840.10045.4.1
|
||||
@@ -361,7 +361,7 @@ TEST(SignatureAlgorithmTest, ParseDerEcdsaWithSHA1NullParams) {
|
||||
EXPECT_FALSE(ParseSignatureAlgorithm(der::Input(kData)));
|
||||
}
|
||||
|
||||
// Parses a ecdsa-with-SHA256 which contains no parameters field.
|
||||
// Parses an ecdsa-with-SHA256 which contains no parameters field.
|
||||
//
|
||||
// SEQUENCE (1 elem)
|
||||
// OBJECT IDENTIFIER 1.2.840.10045.4.3.2
|
||||
@@ -377,7 +377,7 @@ TEST(SignatureAlgorithmTest, ParseDerEcdsaWithSHA256NoParams) {
|
||||
SignatureAlgorithm::kEcdsaSha256);
|
||||
}
|
||||
|
||||
// Parses a ecdsa-with-SHA256 which contains a NULL parameters field.
|
||||
// Parses an ecdsa-with-SHA256 which contains a NULL parameters field.
|
||||
//
|
||||
// SEQUENCE (2 elem)
|
||||
// OBJECT IDENTIFIER 1.2.840.10045.4.3.2
|
||||
@@ -394,7 +394,7 @@ TEST(SignatureAlgorithmTest, ParseDerEcdsaWithSHA256NullParams) {
|
||||
EXPECT_FALSE(ParseSignatureAlgorithm(der::Input(kData)));
|
||||
}
|
||||
|
||||
// Parses a ecdsa-with-SHA384 which contains no parameters field.
|
||||
// Parses an ecdsa-with-SHA384 which contains no parameters field.
|
||||
//
|
||||
// SEQUENCE (1 elem)
|
||||
// OBJECT IDENTIFIER 1.2.840.10045.4.3.3
|
||||
@@ -410,7 +410,7 @@ TEST(SignatureAlgorithmTest, ParseDerEcdsaWithSHA384NoParams) {
|
||||
SignatureAlgorithm::kEcdsaSha384);
|
||||
}
|
||||
|
||||
// Parses a ecdsa-with-SHA384 which contains a NULL parameters field.
|
||||
// Parses an ecdsa-with-SHA384 which contains a NULL parameters field.
|
||||
//
|
||||
// SEQUENCE (2 elem)
|
||||
// OBJECT IDENTIFIER 1.2.840.10045.4.3.3
|
||||
@@ -427,7 +427,7 @@ TEST(SignatureAlgorithmTest, ParseDerEcdsaWithSHA384NullParams) {
|
||||
EXPECT_FALSE(ParseSignatureAlgorithm(der::Input(kData)));
|
||||
}
|
||||
|
||||
// Parses a ecdsa-with-SHA512 which contains no parameters field.
|
||||
// Parses an ecdsa-with-SHA512 which contains no parameters field.
|
||||
//
|
||||
// SEQUENCE (1 elem)
|
||||
// OBJECT IDENTIFIER 1.2.840.10045.4.3.4
|
||||
@@ -443,7 +443,7 @@ TEST(SignatureAlgorithmTest, ParseDerEcdsaWithSHA512NoParams) {
|
||||
SignatureAlgorithm::kEcdsaSha512);
|
||||
}
|
||||
|
||||
// Parses a ecdsa-with-SHA512 which contains a NULL parameters field.
|
||||
// Parses an ecdsa-with-SHA512 which contains a NULL parameters field.
|
||||
//
|
||||
// SEQUENCE (2 elem)
|
||||
// OBJECT IDENTIFIER 1.2.840.10045.4.3.4
|
||||
|
||||
@@ -394,7 +394,7 @@ void VerifyExtendedKeyUsage(const ParsedCertificate &cert,
|
||||
// intermediates, there are a number of exceptions regarding CA ownership
|
||||
// and cross signing which are impossible for us to know or enforce here.
|
||||
// Therefore, we can only enforce at the level of the intermediate that
|
||||
// issued our target certificate. This means we we differ in the following
|
||||
// issued our target certificate. This means we differ in the following
|
||||
// ways:
|
||||
// - We only enforce at the issuer of the TLS certificate.
|
||||
// - We allow email protection to exist in the issuer, since without
|
||||
@@ -2152,21 +2152,21 @@ void PathVerifier::Run(
|
||||
|
||||
valid_policy_graph_.Init();
|
||||
|
||||
// RFC 5280 section section 6.1.2:
|
||||
// RFC 5280 section 6.1.2:
|
||||
//
|
||||
// If initial-explicit-policy is set, then the initial value
|
||||
// [of explicit_policy] is 0, otherwise the initial value is n+1.
|
||||
explicit_policy_ =
|
||||
initial_explicit_policy == InitialExplicitPolicy::kTrue ? 0 : n + 1;
|
||||
|
||||
// RFC 5280 section section 6.1.2:
|
||||
// RFC 5280 section 6.1.2:
|
||||
//
|
||||
// If initial-any-policy-inhibit is set, then the initial value
|
||||
// [of inhibit_anyPolicy] is 0, otherwise the initial value is n+1.
|
||||
inhibit_any_policy_ =
|
||||
initial_any_policy_inhibit == InitialAnyPolicyInhibit::kTrue ? 0 : n + 1;
|
||||
|
||||
// RFC 5280 section section 6.1.2:
|
||||
// RFC 5280 section 6.1.2:
|
||||
//
|
||||
// If initial-policy-mapping-inhibit is set, then the initial value
|
||||
// [of policy_mapping] is 0, otherwise the initial value is n+1.
|
||||
@@ -2175,7 +2175,7 @@ void PathVerifier::Run(
|
||||
? 0
|
||||
: n + 1;
|
||||
|
||||
// RFC 5280 section section 6.1.2:
|
||||
// RFC 5280 section 6.1.2:
|
||||
//
|
||||
// max_path_length: this integer is initialized to n, ...
|
||||
max_path_length_ = n;
|
||||
|
||||
@@ -148,7 +148,7 @@ TEST_P(VerifyNameMatchSimpleTest, ExtraRdnDoesNotMatch) {
|
||||
SequenceValueFromString(der)));
|
||||
}
|
||||
|
||||
// Runs VerifyNameMatchSimpleTest for all combinations of value_type and and
|
||||
// Runs VerifyNameMatchSimpleTest for all combinations of value_type and
|
||||
// suffix.
|
||||
INSTANTIATE_TEST_SUITE_P(InstantiationName, VerifyNameMatchSimpleTest,
|
||||
::testing::Combine(::testing::ValuesIn(kValueTypes),
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Configuration file used for `cargo deny check`, which checks for licensing
|
||||
# issues and security adviories.
|
||||
# issues and security advisories.
|
||||
#
|
||||
# For a list of possible sections and their default values, see
|
||||
# https://github.com/EmbarkStudios/cargo-deny/blob/main/deny.template.toml
|
||||
|
||||
@@ -210,7 +210,7 @@ impl Point {
|
||||
}
|
||||
|
||||
pub fn to_x962_uncompressed(&self) -> Buffer {
|
||||
// Safety: arguments are valid, `EC_KEY` ensures that the the group is
|
||||
// Safety: arguments are valid, `EC_KEY` ensures that the group is
|
||||
// correct for the point, and a `Point` is always finite.
|
||||
unsafe {
|
||||
to_x962(
|
||||
@@ -235,7 +235,7 @@ impl Point {
|
||||
/// WARNING: compressed form is rarely used and is not as well supported as
|
||||
/// the uncompressed form.
|
||||
pub fn to_x962_compressed(&self) -> Buffer {
|
||||
// Safety: arguments are valid, `EC_KEY` ensures that the the group is
|
||||
// Safety: arguments are valid, `EC_KEY` ensures that the group is
|
||||
// correct for the point, and a `Point` is always finite.
|
||||
unsafe {
|
||||
to_x962(
|
||||
@@ -503,7 +503,7 @@ impl Key {
|
||||
// Safety: `self.0` is valid by construction.
|
||||
let group = unsafe { bssl_sys::EC_KEY_get0_group(self.0) };
|
||||
let point = unsafe { bssl_sys::EC_KEY_get0_public_key(self.0) };
|
||||
// Safety: arguments are valid, `EC_KEY` ensures that the the group is
|
||||
// Safety: arguments are valid, `EC_KEY` ensures that the group is
|
||||
// correct for the point, and a `Key` always holds a finite public point.
|
||||
unsafe {
|
||||
to_x962(
|
||||
@@ -520,7 +520,7 @@ impl Key {
|
||||
// Safety: `self.0` is valid by construction.
|
||||
let group = unsafe { bssl_sys::EC_KEY_get0_group(self.0) };
|
||||
let point = unsafe { bssl_sys::EC_KEY_get0_public_key(self.0) };
|
||||
// Safety: arguments are valid, `EC_KEY` ensures that the the group is
|
||||
// Safety: arguments are valid, `EC_KEY` ensures that the group is
|
||||
// correct for the point, and a `Key` always holds a finite public point.
|
||||
unsafe {
|
||||
to_x962(
|
||||
|
||||
@@ -75,7 +75,7 @@ pub enum ParsedPrivateKey {
|
||||
}
|
||||
|
||||
impl ParsedPrivateKey {
|
||||
/// Parses an ECPrivateKey structure froma DER encoded structure per [RFC 5915],
|
||||
/// Parses an ECPrivateKey structure from a DER encoded structure per [RFC 5915],
|
||||
/// whose curve is specified by the `ECParameters`.
|
||||
///
|
||||
/// Unless the curve group is one of the variants of [`Group`], this method returns [`None`].
|
||||
|
||||
@@ -170,7 +170,7 @@ pub enum ParsedPrivateKey {
|
||||
}
|
||||
|
||||
impl ParsedPrivateKey {
|
||||
/// Parses an ECPrivateKey structure froma DER encoded structure per [RFC 5915],
|
||||
/// Parses an ECPrivateKey structure from a DER encoded structure per [RFC 5915],
|
||||
/// whose curve is specified by the `ECParameters`.
|
||||
///
|
||||
/// Unless the curve group is one of the variants of [`Group`], this method returns [`None`].
|
||||
|
||||
@@ -360,7 +360,7 @@ impl PrivateKey {
|
||||
/// Return the public key corresponding to this private key.
|
||||
pub fn as_public(&self) -> PublicKey {
|
||||
// Safety: `self.0` is valid by construction and `RSA_up_ref` means
|
||||
// we we can pass an ownership reference to `PublicKey`.
|
||||
// we can pass an ownership reference to `PublicKey`.
|
||||
unsafe { bssl_sys::RSA_up_ref(self.0) };
|
||||
PublicKey(self.0)
|
||||
}
|
||||
|
||||
+1
-1
@@ -119,7 +119,7 @@ bool SSL_decline_handoff(SSL *ssl) {
|
||||
|
||||
// apply_remote_features reads a list of supported features from `in` and
|
||||
// (possibly) reconfigures `ssl` to disallow the negotiation of features whose
|
||||
// support has not been indicated. (This prevents the the handshake from
|
||||
// support has not been indicated. (This prevents the handshake from
|
||||
// committing to features that are not supported on the handoff/handback side.)
|
||||
static bool apply_remote_features(SSL *ssl, CBS *in) {
|
||||
CBS ciphers;
|
||||
|
||||
@@ -733,7 +733,7 @@ static enum ssl_hs_wait_t do_read_server_hello(SSL_HANDSHAKE *hs) {
|
||||
// the session was only offered in ECH ClientHelloInner), this was the
|
||||
// TLS 1.3 compatibility mode session ID. As we know this is not a session
|
||||
// the server knows about, any server resuming it is in error. Reject the
|
||||
// first connection deterministicly, rather than installing an invalid
|
||||
// first connection deterministically, rather than installing an invalid
|
||||
// session into the session cache. https://crbug.com/796910
|
||||
if (ssl->session == nullptr || ssl->s3->ech_status == ssl_ech_rejected) {
|
||||
OPENSSL_PUT_ERROR(SSL, SSL_R_SERVER_ECHOED_INVALID_SESSION_ID);
|
||||
|
||||
+1
-1
@@ -4281,7 +4281,7 @@ struct ssl_st {
|
||||
// renegotiate_mode controls how peer renegotiation attempts are handled.
|
||||
ssl_renegotiate_mode_t renegotiate_mode = ssl_renegotiate_never;
|
||||
|
||||
// server is true iff the this SSL* is the server half. Note: before the SSL*
|
||||
// server is true iff this SSL* is the server half. Note: before the SSL*
|
||||
// is initialized by either SSL_set_accept_state or SSL_set_connect_state,
|
||||
// the side is not determined. In this state, server is always false.
|
||||
bool server : 1;
|
||||
|
||||
+6
-7
@@ -4851,7 +4851,7 @@ TEST_P(SSLVersionTest, Version) {
|
||||
EXPECT_EQ(SSL_version(server_.get()), placeholder);
|
||||
}
|
||||
|
||||
// Tests that that `SSL_get_pending_cipher` is available during the ALPN
|
||||
// Tests that `SSL_get_pending_cipher` is available during the ALPN
|
||||
// selection callback.
|
||||
TEST_P(SSLVersionTest, ALPNCipherAvailable) {
|
||||
ASSERT_TRUE(UseCertAndKey(client_ctx_.get()));
|
||||
@@ -5685,7 +5685,7 @@ TEST(SSLTest, OverrideChainAndKey) {
|
||||
bssl::UniquePtr<SSL_CTX> ctx(SSL_CTX_new(TLS_method()));
|
||||
ASSERT_TRUE(ctx);
|
||||
|
||||
// Configure one cert and key pair, then replace it with noather.
|
||||
// Configure one cert and key pair, then replace it with another.
|
||||
std::vector<CRYPTO_BUFFER *> certs = {leaf1.get(), ca1.get()};
|
||||
ASSERT_TRUE(SSL_CTX_set_chain_and_key(ctx.get(), certs.data(), certs.size(),
|
||||
key1.get(), nullptr));
|
||||
@@ -11791,10 +11791,10 @@ TEST(SSLTest, SignatureAlgorithmUsed) {
|
||||
// algorithm used.
|
||||
const uint16_t kPref = SSL_SIGN_RSA_PSS_RSAE_SHA384;
|
||||
static const uint16_t kPrefs[] = {kPref};
|
||||
ASSERT_TRUE(SSL_CTX_set_signing_algorithm_prefs(
|
||||
server_ctx.get(), kPrefs, std::size(kPrefs)));
|
||||
ASSERT_TRUE(SSL_CTX_set_signing_algorithm_prefs(
|
||||
client_ctx.get(), kPrefs, std::size(kPrefs)));
|
||||
ASSERT_TRUE(SSL_CTX_set_signing_algorithm_prefs(server_ctx.get(), kPrefs,
|
||||
std::size(kPrefs)));
|
||||
ASSERT_TRUE(SSL_CTX_set_signing_algorithm_prefs(client_ctx.get(), kPrefs,
|
||||
std::size(kPrefs)));
|
||||
|
||||
SSL_CTX_set_info_callback(client_ctx.get(),
|
||||
SignatureAlgorithmUsedInfoCallback);
|
||||
@@ -11817,4 +11817,3 @@ TEST(SSLTest, SignatureAlgorithmUsed) {
|
||||
|
||||
} // namespace
|
||||
BSSL_NAMESPACE_END
|
||||
|
||||
|
||||
@@ -1276,7 +1276,7 @@ type ProtocolBugs struct {
|
||||
EmptyTicketSessionID bool
|
||||
|
||||
// NewSessionIDLength, if non-zero is the length of the session ID to use
|
||||
// when issung new sessions.
|
||||
// when issuing new sessions.
|
||||
NewSessionIDLength int
|
||||
|
||||
// SendClientHelloSessionID, if not nil, is the session ID sent in the
|
||||
@@ -2042,7 +2042,7 @@ type ProtocolBugs struct {
|
||||
// extension to indicate a match.
|
||||
SendNonEmptyTrustAnchorMatch bool
|
||||
|
||||
// AlwaysSendAvailableTrustAnchors, if true, causese the server to always
|
||||
// AlwaysSendAvailableTrustAnchors, if true, causes the server to always
|
||||
// send available trust anchors in EncryptedExtensions, even if unsolicited.
|
||||
AlwaysSendAvailableTrustAnchors bool
|
||||
|
||||
|
||||
@@ -707,7 +707,7 @@ func (ka *signedKeyAgreement) verifyParameters(config *Config, clientHello *clie
|
||||
}
|
||||
|
||||
// ecdheKeyAgreement implements a TLS key agreement where the server
|
||||
// generates a ephemeral EC public/private key pair and signs it. The
|
||||
// generates an ephemeral EC public/private key pair and signs it. The
|
||||
// pre-master secret is then calculated using ECDH. The signature may
|
||||
// either be ECDSA or RSA.
|
||||
type ecdheKeyAgreement struct {
|
||||
|
||||
@@ -172,7 +172,7 @@ func (p *packetAdaptor) ExpectNoNextTimeout() error {
|
||||
return err
|
||||
}
|
||||
|
||||
// UpdatePeerTimeout instructs the peer to set the timeoput to the specified value.
|
||||
// UpdatePeerTimeout instructs the peer to set the timeout to the specified value.
|
||||
func (p *packetAdaptor) SetPeerTimeout(d time.Duration) error {
|
||||
p.log(fmt.Sprintf("Setting timeout to to %d ms", d.Milliseconds()), nil)
|
||||
|
||||
|
||||
@@ -803,7 +803,7 @@ func addPSKTests() {
|
||||
&rsaCertificate,
|
||||
&pskSHA256Credential,
|
||||
},
|
||||
// The ClientHello is not good for the certficate, so the
|
||||
// The ClientHello is not good for the certificate, so the
|
||||
// shim should pick the PSK.
|
||||
flags: []string{"-expect-selected-credential", "1"},
|
||||
expectations: connectionExpectations{
|
||||
|
||||
@@ -1365,7 +1365,7 @@ type shimProcess struct {
|
||||
}
|
||||
|
||||
// newShimProcess starts a new shim with the specified executable, flags, and
|
||||
// environment. It internally creates a TCP listener and adds the the -port
|
||||
// environment. It internally creates a TCP listener and adds the -port
|
||||
// flag.
|
||||
func newShimProcess(dispatcher *shimDispatcher, shimPath string, flags []string, env []string) (*shimProcess, error) {
|
||||
listener, err := dispatcher.NewShim()
|
||||
|
||||
+1
-1
@@ -539,7 +539,7 @@ static enum ssl_hs_wait_t do_read_server_hello(SSL_HANDSHAKE *hs) {
|
||||
ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_MISSING_EXTENSION);
|
||||
return ssl_hs_error;
|
||||
}
|
||||
// The above imples only one of three handshake forms will be allowed. The
|
||||
// The above implies only one of three handshake forms will be allowed. The
|
||||
// checks for unsolicited extensions ensure the server did not select
|
||||
// something we cannot respond to.
|
||||
assert(
|
||||
|
||||
@@ -275,7 +275,7 @@ func (x extractor) visit(n *node) (err error) {
|
||||
len(n.Inner))
|
||||
}
|
||||
|
||||
// Allow to ignore errors.
|
||||
// Allow errors to be ignored.
|
||||
defer func() {
|
||||
if x.options.KeepGoing && err != nil {
|
||||
log.Printf("ERROR: %v", err)
|
||||
|
||||
@@ -29,11 +29,11 @@ type Options struct {
|
||||
DumpFullTree bool
|
||||
// KeepGoing does not bail out on parse errors.
|
||||
KeepGoing bool
|
||||
// Language is the langauge to parse the AST as.
|
||||
// Language is the language to parse the AST as.
|
||||
Language string
|
||||
}
|
||||
|
||||
// New creates a new identiifer extractor.
|
||||
// New creates a new identifier extractor.
|
||||
func New(reporter func(IdentifierInfo) error, options Options) *extractor {
|
||||
x := &extractor{
|
||||
extractorStatic: &extractorStatic{
|
||||
|
||||
Reference in New Issue
Block a user