Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update BoringSSL #80

Merged
merged 203 commits into from
Feb 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
203 commits
Select commit Hold shift + click to select a range
6191cc9
Document that SSL_PRIVATE_KEY_METHOD should configure signing prefs.
davidben Jul 16, 2021
897a2ca
Add convenience functions to malloc EVP_HPKE_CTX and EVP_HPKE_KEY.
davidben Jul 16, 2021
17be387
Check strtoul return for overflow error in GetUnsigned()
dmcardle Jul 20, 2021
e38cf79
Don't enable atomics in NO_THREADS configurations.
davidben Jul 20, 2021
7a817f4
Add 'generate-ech' command to bssl tool
dmcardle Jul 14, 2021
c1571fe
acvp: add HKDF support.
Jul 22, 2021
d422d2c
Revert "Revert "Revert "Disable check that X.509 extensions implies v…
davidben Jul 28, 2021
5799ebf
acvp: recognise another style of JSON.
Jul 27, 2021
f1d153d
Don't overread in poly_Rq_mul
Jul 30, 2021
0768d42
generate_ech.cc: include needed headers
Aug 2, 2021
e9fae77
Clarify BIO_new_mum_buf's lifetime rules.
davidben Aug 2, 2021
116d925
Document another batch of functions.
davidben Aug 1, 2021
046fc13
Remove ASN1_STRING_FLAG_MSTRING.
davidben Aug 1, 2021
46e0523
Add some tests for time_t to ASN1_TIME conversions.
davidben Aug 2, 2021
ead57c3
Reject years outside 0000-9999 in ASN1_GENERALIZEDTIME_adj.
davidben Aug 2, 2021
7e26597
Avoid double-expanding variables in CMake.
davidben Aug 4, 2021
549e4e7
Align with upstream on 'close STDOUT' lines.
davidben Aug 5, 2021
47c5f9d
Update ghashv8-armx.pl from upstream.
davidben Aug 5, 2021
6d84569
Document ASN1_mbstring_copy.
davidben Aug 8, 2021
f8b3961
Always use an ASN1_STRING_TABLE global mask of UTF8String.
davidben Aug 8, 2021
11a24ae
Unexport ub_* constants.
davidben Aug 8, 2021
8627e97
Unexport BIT_STRING_BITNAME.
davidben Aug 8, 2021
28d7252
Move X509_ALGOR to x509.h.
davidben Aug 8, 2021
b9ec9de
Remove OPENSSL_NO_FP_API ifdefs.
davidben Aug 8, 2021
7a6066c
Implement ASN1_STRING_print_ex_fp, etc., with file BIOs.
davidben Aug 8, 2021
1201c9a
Unwind io_ch abstraction in print functions.
davidben Aug 8, 2021
0dcbc6e
Move a_strex.c back to asn1, split X509_NAME bits out.
davidben Aug 8, 2021
07a6628
Move some ASN1 printing functions to crypto/asn1.
davidben Aug 8, 2021
4c993da
Document ASN.1 printing functions.
davidben Aug 9, 2021
e3a3655
Check i2d_ASN1_TYPE's return value in ASN1_STRING_print_ex.
davidben Aug 9, 2021
b319e3b
Fix ASN1_STRING_print_ex with negative integers.
davidben Aug 9, 2021
eb17de4
Remove ASN1_TFLG_SET_ORDER.
davidben Aug 10, 2021
1b2db8c
Add a test for ASN1_mbstring_copy and clean up.
davidben Aug 10, 2021
b9ee7b1
Fix negative ENUMERATED values in multi-strings.
davidben Aug 10, 2021
69ec7c8
Fix some error returns from SSL_read and SSL_write.
davidben Aug 11, 2021
2e68a05
Simplify built-in BIOs slightly.
davidben Aug 11, 2021
006f20a
Add Span::first() and Span::last().
davidben Jun 23, 2021
a603c82
Bump minimum GCC version and note impending VS2015 deprecation.
davidben Aug 16, 2021
80df739
Guard use of sdallocx with BORINGSSL_SDALLOCX
Aug 13, 2021
05ce773
Process the TLS 1.3 cipher suite in one place.
davidben Jun 23, 2021
16c3e3a
runner: Test session IDs over 32 bytes.
davidben Jun 23, 2021
8648c53
Refer to RFCs consistently.
davidben Aug 19, 2021
047ff64
Linkify RFCs in documentation.
davidben Aug 19, 2021
9545062
Add a CBB_add_zeros helper.
davidben Jul 16, 2021
4f9a7ba
Do not rely on ASN1_STRING being NUL-terminated.
davidben Aug 24, 2021
2d10c18
Fix i2v_GENERAL_NAME to not assume NUL terminated strings
davidben Aug 24, 2021
04601b0
Add some tests for name constraints.
davidben Aug 24, 2021
b27438e
Rewrite name constraints matching with CBS.
davidben Aug 24, 2021
5984cfe
OPENSSL_strndup should not return NULL given {NULL, 0}.
davidben Aug 24, 2021
4bf0a19
Fix typo.
davidben Aug 25, 2021
cdfc259
Fix some error-handling in i2v functions.
davidben Aug 25, 2021
6038ac5
Run X509_print in the certificate fuzzer.
davidben Aug 25, 2021
61f3208
Merge in OpenSSL's X.509 corpus.
davidben Aug 25, 2021
e2cb423
Deduplicate our three ServerHello parsers.
davidben Jun 23, 2021
a75027b
Make ssl_parse_extensions a little easier to use.
davidben Jul 20, 2021
d55f450
Avoid re-hashing the transcript multiple times.
davidben Aug 11, 2021
c6d3fd1
Work around yet another MSVC 2015 SFINAE bug.
davidben Aug 16, 2021
417010f
Benchmark RSA private key parsing.
davidben Jun 30, 2021
c65543b
Make RSA_check_key more than 2x as fast.
davidben Aug 27, 2021
9618128
NUL is not printable.
davidben Aug 26, 2021
31f462a
Include SHA512-256 in EVP_get_digestbyname and EVP_MD_do_all.
davidben Aug 30, 2021
6b7525a
Rewrite ASN1_PRINTABLE_type and add tests.
davidben Aug 26, 2021
59aff62
Remove V_ASN1_APP_CHOOSE.
davidben Aug 26, 2021
dddb60e
Make most of crypto/x509 opaque.
davidben Aug 11, 2021
07b365f
Remove SSL_set_verify_result.
davidben Aug 31, 2021
37a3c70
Reword SSL_get0_ech_name_override documentation.
davidben Sep 1, 2021
18b6836
Update to draft-ietf-tls-esni-13.
davidben Jun 19, 2021
19fe794
Fix calculation of draft-13 ECH confirmation signal.
davidben Sep 2, 2021
b49b78e
Revert "Guard use of sdallocx with BORINGSSL_SDALLOCX"
agl Sep 2, 2021
1a668b3
Switch to the new, simpler WHATWG URL formulation.
davidben Sep 3, 2021
c0fcb4e
Silence a GCC false positive warning.
davidben Sep 3, 2021
0fa3030
Update comment for ECH draft-13.
davidben Sep 3, 2021
a03c34c
Check for __TRUSTY__ instead of TRUSTY.
davidben Sep 3, 2021
2577343
acvptool: add hmacDRBG support
Sep 3, 2021
27b31cf
Correctly propagate errors in i2d functions.
davidben Aug 10, 2021
3b6cebb
Fix x509_name_ex_i2d error-handling.
davidben Aug 22, 2021
248ab81
Check for invalid CHOICE selectors in i2d functions.
davidben Aug 10, 2021
6e70be0
Correctly handle invalid ASN1_OBJECTs when encoding.
davidben Aug 10, 2021
c9b75af
Reject -1 types in ASN1_TYPE and MSTRINGs when encoding.
davidben Sep 6, 2021
866cccc
Reject missing required fields in i2d functions.
davidben Aug 10, 2021
afed9f7
Don't read it->funcs without checking it->itype.
davidben Aug 22, 2021
ed5f4e8
Remove ASN1_OP_I2D_* callbacks.
davidben Aug 22, 2021
0446b59
Add maskHash to RSA_PSS_PARAMS for compat
codebytere Sep 9, 2021
019cc62
Fix BN_prime_checks_for_validation to align with false-positive rate.
jakemas Sep 13, 2021
62c4f15
Clarify that TLS sessions are not application sessions.
davidben Sep 10, 2021
27a3328
Fix the TLS fuzzers for ECH draft-13.
davidben Sep 13, 2021
cd32fd3
Refresh fuzzer corpus for ECH draft-13.
davidben Sep 13, 2021
1c2473e
Add FIPS counters for AES-GCM in EVP_AEAD.
Sep 15, 2021
41adb34
Ignore SIGPIPE in the bssl tool.
davidben Sep 15, 2021
f3e5941
acvptool: add CS3 support.
Sep 16, 2021
4937f05
Unwind remnants of ASN1_TFLG_NDEF.
davidben Sep 8, 2021
f958727
Speed up constant-time base64 decoding.
davidben Sep 21, 2021
66e61c5
Allow PKCS7_sign to work for signing kernel modules.
Sep 21, 2021
dedd23e
aarch64: Add missing LR validation in 'vpaes_cbc_encrypt'
tamaspetz Sep 17, 2021
03cae7a
Keep EVP_CIPHER/EVP_MD lookup and do_all functions in sync
davidben Sep 24, 2021
551ccd7
Fix CRYPTO_malloc, etc., definitions.
davidben Sep 28, 2021
cc509bd
Add log tag for Trusty.
prbprbprb Sep 28, 2021
87f316d
Add note to HMAC test vectors from NIST
kruton Sep 28, 2021
2bde936
Switch x509_test.cc to modify the existing X509_VERIFY_PARAM.
davidben Oct 1, 2021
8f5eb80
Enable X509_V_FLAG_TRUSTED_FIRST by default.
davidben Oct 1, 2021
523d6c7
Remove X509_STORE_set0_additional_untrusted.
davidben Oct 1, 2021
fa6ced9
Extract common rotl/rotr functions.
davidben Oct 3, 2021
a50f24c
Test that built-in ASN1_STRING_TABLEs are sorted.
davidben Oct 2, 2021
db93c25
Test ASN1_STRING_set_by_NID with built-in NIDs.
davidben Oct 2, 2021
38890fd
Test ASN1_STRING_set_by_NID with custom NIDs.
davidben Oct 2, 2021
f61997b
Make ASN1_STRING_TABLE_add thread-safe and document.
davidben Oct 2, 2021
c31a8a6
Fold x509_vfy.h into x509.h.
davidben Oct 4, 2021
f5e6012
Remove remnants of ASN.1 print function generators.
davidben Oct 4, 2021
a406ad7
Make ASN1_NULL an opaque pointer.
davidben Oct 4, 2021
0524538
Fix BN_CTX usage in BN_mod_sqrt malloc error paths.
davidben Oct 6, 2021
45c8be9
Forward-declare SSL_CLIENT_HELLO.
davidben Oct 7, 2021
2f8bf10
Use typedefs in i2d and d2i_ASN1_BOOLEAN.
davidben Oct 9, 2021
f6ef1c5
Check tag class and constructed bit in d2i_ASN1_BOOLEAN.
davidben Oct 9, 2021
cfafcd4
Deduplicate d2i and i2d documentation.
davidben Oct 14, 2021
7a4df8e
Tidy up SSLTest.SetVersion.
davidben Oct 14, 2021
b415602
Start documenting ASN1_ITEM.
davidben Oct 14, 2021
c11fcb0
Const-correct the low-level ASN1 i2d functions.
davidben Oct 15, 2021
a78e324
Document ASN1_NULL.
davidben Oct 15, 2021
370a3c2
Document new/free/d2i/i2d for singly-typed ASN1_STRINGs.
davidben Oct 15, 2021
8a5ec72
Fix up some doc.go nits in asn1.h.
davidben Oct 15, 2021
bb88f52
Move M_ASN1_* to the deprecated section.
davidben Oct 15, 2021
7c1f40f
Reword ASN1_BOOLEAN exception.
davidben Oct 16, 2021
141472c
Document some more ASN1_ITEM-associated functions.
davidben Oct 16, 2021
4298fce
Rewrite ASN1_item_pack and ASN1_item_unpack.
davidben Oct 16, 2021
a7e8074
Fix BIT STRING comparison in ASN1_STRING_cmp.
davidben Oct 16, 2021
2dc2f10
Fold i2a_ASN1_ENUMERATED into i2a_ASN1_INTEGER.
davidben Oct 17, 2021
ae274a2
Document i2a_ASN1_* functions.
davidben Oct 17, 2021
686d05a
Fix error-handling for i2a_ASN1_OBJECT.
davidben Oct 17, 2021
45608a1
Document and const-correct ASN1_TYPE functions.
davidben Oct 18, 2021
08dee19
Use C preprocessor comments in assembly headers.
davidben Oct 19, 2021
471e631
Document low-level encoding functions in asn1.h.
davidben Oct 19, 2021
efab69b
Return 0x80 in all ASN1_get_object error paths.
davidben Oct 19, 2021
a259a54
Unexport ASN1_OBJECT_new.
davidben Oct 20, 2021
d2d1d3c
Document ASN1_OBJECT, i2c, and c2i functions.
davidben Oct 20, 2021
e1049fd
Fully unexport X509_VAL.
davidben Oct 21, 2021
1dcdbda
Document and const-correct multi-string types.
davidben Oct 18, 2021
89386ac
Add magic tag to BoringSSL binaries.
Oct 12, 2021
2cbc39a
Trim some undocumented symbols from asn1.h.
davidben Oct 21, 2021
28c48e3
Finish documenting asn1.h.
davidben Oct 21, 2021
7cac8fa
Add CRYPTO_BUFFER_new_from_static_data_unsafe.
davidben Oct 20, 2021
c2827d3
Add a function to express the desired record version protocol.
Oct 12, 2021
69030a0
Match OPENSSL_EXPORT in ssl/internal.h friend declarations.
davidben Oct 26, 2021
17c38b3
Switch DEPS actions on bots to Python 3.
davidben Oct 26, 2021
91b8924
Switch kModuleDigestSize to a macro.
davidben Oct 27, 2021
9fd1637
Fold x509v3/pcy_int.h into x509v3/internal.h.
davidben Oct 28, 2021
16b3af7
Update tools.
davidben Oct 26, 2021
491af10
Check for trailing data in extensions.
davidben Oct 29, 2021
a70edd4
Remove support for constructed strings in crypto/asn1.
davidben Oct 29, 2021
ee510f5
Remove support for indefinite lengths in crypto/asn1.
davidben Oct 29, 2021
13c67c9
Enforce DER rules for BIT STRING values.
davidben Oct 29, 2021
414a0f8
Don't parse constructed BIT STRINGs in crypto/bytestring
davidben Oct 29, 2021
cf8d3ad
Check tag class and constructed bit in d2i_ASN1_OBJECT.
davidben Oct 29, 2021
703cb72
Add missing assert.h include.
davidben Oct 28, 2021
ba20a75
Remove outdated comment in ECDSA implementation.
davidben Nov 4, 2021
a9670a8
No-op change to test the bots.
davidben Nov 4, 2021
27a6755
Add PKCS7_bundle_raw_certificates function which takes CRYPTO_BUFFERs
matt-mueller Nov 12, 2021
16a9493
Add various OpenSSL compatibility functions.
davidben Nov 17, 2021
ea57bcb
Update HPKE test vectors.
davidben Nov 17, 2021
b3ed071
Add SSL_has_pending.
davidben Nov 12, 2021
e7fc7a7
Export PKCS12_DEFAULT_ITER.
davidben Nov 19, 2021
3a667d1
Binary tag bump: 1 -> 2
Nov 20, 2021
d703d95
Remove X509_REVOKED.sequence.
davidben Nov 22, 2021
cd0b767
Add BN_GENCB_new, BN_GENCB_free, and RSA_test_flags.
davidben Nov 29, 2021
731d6cb
Add ERR_set_error_data for compatibility.
davidben Nov 30, 2021
7e7e6b6
Add |SSL_set1_host| and |SSL_set_hostflags|.
Dec 6, 2021
7e2a957
Document |SSL_set1_host| return values.
Dec 7, 2021
2042972
Make X509_REVOKED opaque.
davidben Nov 22, 2021
c3c540b
Remove non-standard X.509 DNS wildcard matching.
davidben Dec 8, 2021
405c788
Rewrite X.509 name-matching tests.
davidben Dec 11, 2021
9631bc1
Remove non-standard wildcard input DNS names.
davidben Dec 11, 2021
e21f272
Add BIO_tell and BIO_seek wrappers.
davidben Dec 13, 2021
4f1fae3
Fix the easy -Wformat-signedness errors.
davidben Dec 15, 2021
866b88d
Don't print small, negative serial numbers in decimal.
davidben Dec 15, 2021
94089a8
Silence -Wformat-signedness when printing X.509 versions.
davidben Dec 15, 2021
0664690
Fix X509_CRL_print error-handling.
davidben Dec 15, 2021
8ed06e0
Rewrite bssl_shim command-line parser.
davidben Dec 15, 2021
203b92b
Reorder flags to match TestConfig struct.
davidben Dec 15, 2021
d7936c2
Use uint16_t in TestConfig and enable -Wformat-signedness.
davidben Dec 15, 2021
9bcc12d
Import a few test vectors from OpenSSL.
davidben Dec 21, 2021
e90cf82
Import sha512-armv8.pl transforms from upstream NEON code.
davidben Dec 27, 2021
af561c2
Sync sha512-armv8.pl up to 753316232243ccbf86b96c1c51ffcb41651d9ad5.
davidben Dec 20, 2021
1e15682
Enable SHA-512 ARM acceleration when available.
davidben Dec 27, 2021
295b313
Rename CPU feature files with underscores.
davidben Dec 21, 2021
37faa93
Move public APIs from cpu.h to crypto.h.
davidben Dec 21, 2021
661266e
Move CPU detection symbols to crypto/internal.h.
davidben Dec 23, 2021
846a227
Switch __ARM_FEATURE_CRYPTO to __ARM_FEATURE_{AES,SHA2}.
davidben Jan 6, 2022
a94c267
Don't use __ARMEL__/__ARMEB__ in aarch64 assembly
davidben Dec 29, 2021
d80f17d
Simplify __ARM_ARCH__ definition.
davidben Dec 29, 2021
24e97fb
Version bump: 2 -> 3.
Jan 10, 2022
0354b79
Don't #include "internal.h" twice.
Jan 10, 2022
f797570
Ignore duplicates in |X509_STORE_add_*|
Jan 13, 2022
ec476ef
Zero out the values from the integrity check.
Jan 14, 2022
d1593f5
Make EVP_AEAD_CTX_free accept NULL.
davidben Jan 17, 2022
36a41bf
Add note about Gerrit account creation
jamuir Jan 16, 2022
8d8d8f3
Generates "low-level" bindings for Rust using bindgen
benbrittain Sep 28, 2021
be04c56
Add ARMV8_SHA512 detection for Fuchsia.
davidben Jan 13, 2022
ea46caf
Put Rust binding generation behind an explicit flag and only build bi…
benbrittain Jan 20, 2022
960ddfe
Fix mac_arm64 builder.
davidben Jan 21, 2022
50e7ea5
LSC: Apply clang-tidy's modernize-use-bool-literals to boringssl
Jan 23, 2022
345c86b
Switch CRYPTO_BUFFER_POOL to SipHash-2-4.
davidben Jan 23, 2022
c03e99a
Fix Unicode strings for C++20
smikims Jan 22, 2022
387f820
Limit _XOPEN_SOURCE to Linux.
davidben Jan 25, 2022
32772ad
Merge BoringSSL commit '387f82054c8ffa7d2b9e31d908586fbd47f34039'
xvzcf Jan 27, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 1 addition & 2 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ PointerAlignment: Right
IncludeBlocks: Preserve
TypenameMacros: ['LHASH_OF', 'STACK_OF']
StatementMacros:
- "ASN1_SEQUENCE_END"
- "DECLARE_ASN1_ALLOC_FUNCTIONS"
- "DECLARE_ASN1_ALLOC_FUNCTIONS_name"
- "DECLARE_ASN1_ENCODE_FUNCTIONS"
Expand All @@ -18,8 +19,6 @@ StatementMacros:
- "DECLARE_ASN1_FUNCTIONS_const"
- "DECLARE_ASN1_FUNCTIONS_fname"
- "DECLARE_ASN1_FUNCTIONS_name"
- "DECLARE_ASN1_PRINT_FUNCTION"
- "DECLARE_ASN1_PRINT_FUNCTION_fname"
- "DECLARE_PEM_read"
- "DECLARE_PEM_read_bio"
- "DECLARE_PEM_read_fp"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ ssl/test/runner/runner
*.swo
doc/*.html
doc/doc.css
rust/target

util/bot/android_ndk
util/bot/android_sdk/public
Expand Down
43 changes: 25 additions & 18 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ most recent stable version of each tool.
`CMAKE_ASM_NASM_COMPILER`.

* C and C++ compilers with C++11 support are required. On Windows, MSVC 14
(Visual Studio 2015) or later with Platform SDK 8.1 or later are supported.
Recent versions of GCC (4.8+) and Clang should work on non-Windows
(Visual Studio 2015) or later with Platform SDK 8.1 or later are supported,
but newer versions are recommended. We will drop support for Visual Studio
2015 in March 2022, five years after the release of Visual Studio 2017.
Recent versions of GCC (6.1+) and Clang should work on non-Windows
platforms, and maybe on Windows too.

* The most recent stable version of [Go](https://golang.org/dl/) is required.
Expand Down Expand Up @@ -161,31 +163,36 @@ BoringSSL maintainers if making use of it.
don't have steps for assembling the assembly language source files, so they
currently cannot be used to build BoringSSL.

## Embedded ARM
## ARM CPU Capabilities

ARM, unlike Intel, does not have an instruction that allows applications to
discover the capabilities of the processor. Instead, the capability information
has to be provided by the operating system somehow.
ARM, unlike Intel, does not have a userspace instruction that allows
applications to discover the capabilities of the processor. Instead, the
capability information has to be provided by a combination of compile-time
information and the operating system.

By default, on Linux-based systems, BoringSSL will try to use `getauxval` and
`/proc` to discover the capabilities. But some environments don't support that
sort of thing and, for them, it's possible to configure the CPU capabilities at
compile time.

On iOS or builds which define `OPENSSL_STATIC_ARMCAP`, features will be
determined based on the `__ARM_NEON__` and `__ARM_FEATURE_CRYPTO` preprocessor
symbols reported by the compiler. These values are usually controlled by the
`-march` flag. You can also define any of the following to enable the
corresponding ARM feature.
BoringSSL determines capabilities at compile-time based on `__ARM_NEON`,
`__ARM_FEATURE_AES`, and other preprocessor symbols defined in
[Arm C Language Extensions (ACLE)](https://developer.arm.com/architectures/system-architectures/software-standards/acle).
These values are usually controlled by the `-march` flag. You can also define
any of the following to enable the corresponding ARM feature, but using the ACLE
symbols via `-march` is recommended.

* `OPENSSL_STATIC_ARMCAP_NEON`
* `OPENSSL_STATIC_ARMCAP_AES`
* `OPENSSL_STATIC_ARMCAP_SHA1`
* `OPENSSL_STATIC_ARMCAP_SHA256`
* `OPENSSL_STATIC_ARMCAP_PMULL`

Note that if a feature is enabled in this way, but not actually supported at
run-time, BoringSSL will likely crash.
The resulting binary will assume all such features are always present. This can
reduce code size, by allowing the compiler to omit fallbacks. However, if the
feature is not actually supported at runtime, BoringSSL will likely crash.

BoringSSL will additionally query the operating system at runtime for additional
features, e.g. with `getauxval` on Linux. This allows a single binary to use
newer instructions when present, but still function on CPUs without them. But
some environments don't support runtime queries. If building for those, define
`OPENSSL_STATIC_ARMCAP` to limit BoringSSL to compile-time capabilities. If not
defined, the target operating system must be known to BoringSSL.

## Binary Size

Expand Down
69 changes: 38 additions & 31 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CLANG)
# Note clang-cl is odd and sets both CLANG and MSVC. We base our configuration
# primarily on our normal Clang one.
set(C_CXX_FLAGS "-Werror -Wformat=2 -Wsign-compare -Wmissing-field-initializers -Wwrite-strings -Wvla")
set(C_CXX_FLAGS "-Werror -Wformat=2 -Wsign-compare -Wmissing-field-initializers -Wwrite-strings -Wvla -Wshadow")
if(MSVC)
# clang-cl sets different default warnings than clang. It also treats -Wall
# as -Weverything, to match MSVC. Instead -W3 is the alias for -Wall.
Expand Down Expand Up @@ -149,6 +149,10 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CLANG)
set(C_CXX_FLAGS "${C_CXX_FLAGS} -Wimplicit-fallthrough")
endif()

if(CMAKE_COMPILER_IS_GNUCXX)
set(C_CXX_FLAGS "${C_CXX_FLAGS} -Wformat-signedness")
endif()

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${C_CXX_FLAGS} -Wmissing-prototypes -Wold-style-definition -Wstrict-prototypes")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${C_CXX_FLAGS} -Wmissing-declarations")

Expand All @@ -172,11 +176,6 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CLANG)
if(CLANG)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wmissing-prototypes")
endif()

if(CMAKE_COMPILER_IS_GNUCXX AND "4.8" VERSION_GREATER CMAKE_C_COMPILER_VERSION)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-array-bounds")
endif()

elseif(MSVC)
set(MSVC_DISABLED_WARNINGS_LIST
"C4061" # enumerator 'identifier' in switch of enum 'enumeration' is not
Expand Down Expand Up @@ -254,18 +253,15 @@ if(WIN32)
add_definitions("-D_STL_EXTRA_DISABLED_WARNINGS=4774 4987")
endif()

if((CMAKE_COMPILER_IS_GNUCXX AND CMAKE_C_COMPILER_VERSION VERSION_GREATER "4.7.99") OR
CLANG)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wshadow")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wshadow")
endif()

if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11")
endif()

# pthread_rwlock_t requires a feature flag.
if(NOT WIN32)
# pthread_rwlock_t on Linux requires a feature flag. We limit this to Linux
# because, on Apple platforms, it instead disables APIs we use. See compat(5)
# and sys/cdefs.h. Reportedly, FreeBSD also breaks when this is set. See
# https://crbug.com/boringssl/471.
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_XOPEN_SOURCE=700")
endif()

Expand Down Expand Up @@ -405,8 +401,7 @@ endif()

function(go_executable dest package)
set(godeps "${CMAKE_SOURCE_DIR}/util/godeps.go")
if(${CMAKE_VERSION} VERSION_LESS "3.7" OR
NOT ${CMAKE_GENERATOR} STREQUAL "Ninja")
if(CMAKE_VERSION VERSION_LESS "3.7" OR NOT CMAKE_GENERATOR STREQUAL "Ninja")
# The DEPFILE parameter to add_custom_command is new as of CMake 3.7 and
# only works with Ninja. Query the sources at configure time. Additionally,
# everything depends on go.mod. That affects what external packages to use.
Expand Down Expand Up @@ -448,7 +443,7 @@ endfunction()
# builds.
if(NOT OPENSSL_NO_ASM AND CMAKE_OSX_ARCHITECTURES)
list(LENGTH CMAKE_OSX_ARCHITECTURES NUM_ARCHES)
if(NOT ${NUM_ARCHES} EQUAL 1)
if(NOT NUM_ARCHES EQUAL 1)
message(FATAL_ERROR "Universal binaries not supported.")
endif()
list(GET CMAKE_OSX_ARCHITECTURES 0 CMAKE_SYSTEM_PROCESSOR)
Expand All @@ -461,44 +456,44 @@ endif()
if(OPENSSL_NO_ASM)
add_definitions(-DOPENSSL_NO_ASM)
set(ARCH "generic")
elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
set(ARCH "x86_64")
elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "amd64")
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "amd64")
set(ARCH "x86_64")
elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64")
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "AMD64")
# cmake reports AMD64 on Windows, but we might be building for 32-bit.
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(ARCH "x86_64")
else()
set(ARCH "x86")
endif()
elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86")
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86")
set(ARCH "x86")
elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "i386")
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "i386")
set(ARCH "x86")
elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "i686")
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "i686")
set(ARCH "x86")
elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64")
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
set(ARCH "aarch64")
elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "ARM64")
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64")
set(ARCH "aarch64")
elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "arm64")
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64")
set(ARCH "aarch64")
# Apple A12 Bionic chipset which is added in iPhone XS/XS Max/XR uses arm64e architecture.
elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "arm64e")
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64e")
set(ARCH "aarch64")
elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^arm*")
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm*")
set(ARCH "arm")
elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "mips")
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "mips")
# Just to avoid the “unknown processor” error.
set(ARCH "generic")
elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "ppc64le")
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "ppc64le")
set(ARCH "ppc64le")
else()
message(FATAL_ERROR "Unknown processor:" ${CMAKE_SYSTEM_PROCESSOR})
endif()

if(ANDROID AND NOT ANDROID_NDK_REVISION AND ${ARCH} STREQUAL "arm")
if(ANDROID AND NOT ANDROID_NDK_REVISION AND ARCH STREQUAL "arm")
# The third-party Android-NDK CMake files somehow fail to set the -march flag
# for assembly files. Without this flag, the compiler believes that it's
# building for ARMv5.
Expand All @@ -517,6 +512,7 @@ if(USE_CUSTOM_LIBCXX)
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -nostdlib++")
include_directories(
SYSTEM
util/bot/libcxx-config
util/bot/libcxx/include
util/bot/libcxxabi/include
)
Expand All @@ -543,6 +539,8 @@ if(USE_CUSTOM_LIBCXX)
-D_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS
)
set_target_properties(libcxxabi PROPERTIES COMPILE_FLAGS "-Wno-missing-prototypes -Wno-implicit-fallthrough")
# libc++abi depends on libc++ internal headers.
set_property(TARGET libcxxabi APPEND PROPERTY INCLUDE_DIRECTORIES "${CMAKE_SOURCE_DIR}/util/bot/libcxx/src")

add_library(libcxx ${LIBCXX_SOURCES})
if(ASAN OR MSAN OR TSAN)
Expand Down Expand Up @@ -637,6 +635,15 @@ if(FUZZ)
add_subdirectory(fuzz)
endif()

if(RUST_BINDINGS)
find_program(BINDGEN_EXECUTABLE bindgen)
if(NOT BINDGEN_EXECUTABLE)
message(FATAL_ERROR "Could not find bindgen but was asked to generate Rust bindings.")
else()
add_subdirectory(rust)
endif()
endif()

if(UNIX AND NOT APPLE AND NOT ANDROID)
set(HANDSHAKER_ARGS "-handshaker-path" $<TARGET_FILE:handshaker>)
endif()
Expand Down
5 changes: 4 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ use [Gerrit](https://boringssl-review.googlesource.com) for this purpose.
If you have not done so on this machine, you will need to set up a password for
Gerrit. Sign in with a Google account, visit
[this link](https://boringssl.googlesource.com/), and click the "Generate
Password" link in the top right. You will also need to prepare your checkout to
Password" link in the top right. You must also have a Gerrit account associated with
your Google account. To do this visit the [Gerrit review server](https://boringssl-review.googlesource.com)
and click "Sign in" (top right).
You will also need to prepare your checkout to
[add Change-Ids](https://gerrit-review.googlesource.com/Documentation/cmd-hook-commit-msg.html)
on commit. Run:

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Both liboqs and this fork are part of the **Open Quantum Safe (OQS) project**, w

## Status

This fork is built on top of [commit 519c2986c73c23461b130ad19b93fd7d081353d5](https://github.com/open-quantum-safe/boringssl/commit/519c2986c73c23461b130ad19b93fd7d081353d5), and adds:
This fork is built on top of [commit 387f82054c8ffa7d2b9e31d908586fbd47f34039](https://github.com/open-quantum-safe/boringssl/commit/387f82054c8ffa7d2b9e31d908586fbd47f34039), and adds:

- quantum-safe key exchange to TLS 1.3
- hybrid (quantum-safe + elliptic curve) key exchange to TLS 1.3
Expand All @@ -52,7 +52,7 @@ Some of the KEMs provided in liboqs do provide IND-CCA security; others do not (

Furthermore, the BoringSSL project does not guarantee API or ABI stability; this fork is maintained primarily to enable the use of quantum-safe cryptography in the [Chromium](https://www.chromium.org/) web browser, which relies on BoringSSL's TLS implementation.

The fork is currently based on commit hash `519c2986c73c23461b130ad19b93fd7d081353d5` which has been verified to work with Chromium tag `94.0.4602.0`. If we do decide to update BoringSSL, we will do so to the most recent commit that is supported by the desired tag at which we would like Chromium to be. **We consequently also cannot guarantee API or ABI stability for this fork.**
The fork is currently based on commit hash `387f82054c8ffa7d2b9e31d908586fbd47f34039` which has been verified to work with Chromium tag `100.0.4856.2`. If we do decide to update BoringSSL, we will do so to the most recent commit that is supported by the desired tag at which we would like Chromium to be. **We consequently also cannot guarantee API or ABI stability for this fork.**

### Supported Algorithms

Expand Down
Loading