Граф коммитов

2171 Коммитов

Автор SHA1 Сообщение Дата
Amaury Chamayou 1932a2d23e
Clean up doc structure (#3359) 2022-01-11 10:28:53 +00:00
dependabot[bot] b28e7cf56c
Bump node-forge from 0.10.0 to 1.2.0 in /js/ccf-app (#3379)
Bumps [node-forge](https://github.com/digitalbazaar/forge) from 0.10.0 to 1.2.0.
- [Release notes](https://github.com/digitalbazaar/forge/releases)
- [Changelog](https://github.com/digitalbazaar/forge/blob/main/CHANGELOG.md)
- [Commits](https://github.com/digitalbazaar/forge/compare/0.10.0...v1.2.0)

---
updated-dependencies:
- dependency-name: node-forge
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-11 07:52:26 +00:00
dependabot[bot] ef48c72889
Bump @types/node from 17.0.7 to 17.0.8 in /js/ccf-app (#3382) 2022-01-10 18:49:07 +00:00
Renato Golin a8e90d2693
Add more ciphers and restrict elliptic curves in OpenSSL (#3376)
* Add more ciphers and restrict elliptic curves in OpenSSL

These are the approved ciphers and curves that we can support. The TLS
1.2 cipher remains the same for compatibility, but the TLS 1.3 cipher
suites is updated to include stronger ciphers.

Comparing the TLS Report, now that I know what to look for, this is now
on par with the previous report (same bit-rate, server-order, restricted
curves), but strictly better with TLS 1.3 and more, stronger approved
ciphers in 1.3.

* force daily run
2022-01-10 17:38:25 +00:00
Julien Maffre 2eb2ca375d
Fix Doyxgen warnings (#3374) 2022-01-10 17:06:10 +00:00
Christoph M. Wintersteiger 23da829b1e
JS RAII refactoring (#3335) 2022-01-10 16:14:48 +00:00
Julien Maffre ea2c74a8c5
Pin colors deps to 1.4.0 (#3378) 2022-01-10 14:15:03 +00:00
Amaury Chamayou 3477607699
Explicitly run CG Detection on release jobs only (#3373) 2022-01-10 12:09:16 +00:00
Amaury Chamayou b9bc2d64ae
Use the same build image everywhere (#3371) 2022-01-10 10:23:39 +00:00
Renato Golin 4a364317cb
Implement TLS in OpenSSL, support TLS 1.3 (#3361)
* Implement TLS in OpenSSL, support TLS 1.3

This is a large commit, implementing the TLS layer in OpenSSL,
together with mbedTLS, and is part of a transition to eliminate
mbedTLS from the codebase.

The src/crypto part is done already and this is a similar effort
on src/tls. The last part is src/clients (used for testing) and
will be done as a future patch, with extensive testing separate
than this work.

This commit has a temporary structure, to allow a compiler flag
to switch between OpenSSL and mbedTLS. Unlike src/crypto, we want
the transition to be as short lived as possible, so we didn't try
to create common classes, just an include trick to use the right
library.

The main changes, in order from most generic to most specific, are:

1.  The CMake flag `TLS_PROVIDER_IS_MBEDTLS` was introduced, turned
    OFF by default, to build CCF with mbedTLS instead of OpenSSL. This
    is for testing, in case we find issues with the new implementation.
    This is in addition to `CRYPTO_PROVIDER_IS_MBEDTLS` so we can set
    each flag independently.
2.  The OpenSSL library (`libssl`) that we use is from the same place
    we pick the Crypto library (`libcrypto`). Either the system or
    OpenEnclave, decided elsewhere. No new libraries are needed.
3.  Some of the existing mbedTLS headers were moved to src/clients to
    isolate that migration from the server side. So far, it only
    needed `ca.h` and `cert.h`, which are self-conatined. Those
    will be removed with the mbedTLS cleanup.
4.  A number of `#ifdef TLS_PROVIDER_IS_MBEDTLS` were added where
    there was no other way to common up implementation. Most notably
    in the previous TLS headers (`src/tls/*.h`) that are now just
    wrappers to the actual headers (`src/tls/{mbedtls,openssl}/*.h`).
5.  All TLS errors on both mbedTLS and OpenSSL have been #defined
    to a common set of `TLS_ERR_` errors, to allow for common error
    handlind, including `WANT_READ` and `WANT_WRITE`. To keep the
    mbedTLS way, OpenSSL has a hack to return the negative
    counterparts of the error codes, so that we can treat them as
    errors, like mbedTLS.
6.  To keep the current CCF implementation intact, we had to keep
    the callback mechanism in OpenSSL. This isn't the most natural
    way of handling BIOs but it works. Both `tls_endpoint` and
    `tls_test` have a similar implementation, handling asynchronous
    I/O. This should disappear later (probably well after removing
    mbedTLS from the codebase), once we manage to get BIOs directly
    to the users, from the OpenSSL implementation.
7.  A number of mbedTLS functionality, most notably in `context.h`,
    has been adapted to allow a common implementation between the
    two libraries, for example `peer_cert()` and `get_verify_error`.
8.  A copy of `crypto::error_string()` is present in the TLS side
    so that we can more easily control each (crypto/tls) with the
    CMake flags.
9.  A number of log messages were added or changed to convey more
    information to help diagnose TLS issues. Not all development
    log messages survived into the production patch, but those that
    did can still convey most of the information and help at least
    zero in on where you need to add more logs later.
10. Removed two unused methods in `Context`: `available_bytes` and
    `set_require_auth`. Those were never called and had no easy
    equivalent in OpenSSL. Added exceptions for some unused parameters
    in OpenSSL's `CA` and `Cert` to make sure we never use them.
    If those never hit on any further testing or benchmarking, then
    we're safe to remove them when we clean up mbedTLS.
11. Added a number of `FIXME` comments, highlighting the assumptions
    from reading the mbedTLS code and what the tests have shown it
    does/needs. Some of them may be wrong, and if so, we need to
    fix them before we start with the mbedTLS cleanup.
12. Added a very large `get_verify_error` in `OpenSSL::Context`
    with all errors the `verify_result` can throw. This wasn't
    really necessary but was added as a debugging tool. Once we're
    happy none of those weird corner cases happen on our code, we
    should really remove all unused ones and common up in a
    `case default:`, where developers can add specific ones later
    for debugging purposes again.
13. Updated the `tls_test` to handle multi-part messages (past 16K),
    supporting large messages, like `tls_endpoint`. Also truncated
    the large messages to make it easier to read the test logs.
14. Changed the e2e_logging.py large message range from 2^10
    (instead of 2^14), to help developers see some messages pass
    before the 16K threshold, which helped me realise what the
    problem was.
15. Added a long README document with all core issues with the port,
    and discussions on how to clean up in the future.

* Trying to fix the ubsan error

* Remove unnecessary FIXMEs

* Add FIXME to check-todo.sh

* We don't need MbedTLS entropy for OpenSSL

The entropy source isn't a generic implementation, but one based on
mbedTLS, which we don't need for OpenSSL. This removes the last
FIXME.

* Restrict SSL cipher to TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256

To improve security and keep the same behaviour, this commit forces
specific TLS1.2 and TLS1.3 ciphers that were used in the mbedTLS
implementation.

This fixes all problems in the tls_report but one:
Secure Client-Initiated Renegotiation
 -> VULNERABLE (NOT ok), DoS threat (6 attempts)

This will be looked at on the next patch.

* Disable renegotiation to avoid DoS attacks

This makes the tls_report identical to previous mbedTLS.

* Free temporary BIOs in CA/Cert c-tors

Detected by leak sanitizers, but I should have known better...

* Use Unique_BIO|X509 in peer_cert to avoid leaks

Following the C-style code in OpenSSL's documentation was a bad
idea. Using unique_ptr wrappers to guarantee nothing leaks.

* Simplify get_verify_error to avoid UB on memcpy

Same as previous UB, writing at the end of a string. Using std::string
to avoid any memory manipulation by hand.

* Fix typos
2022-01-09 15:16:46 +00:00
Amaury Chamayou a5476ef277
Application claims digest in ledger and receipts (#3292) 2022-01-09 12:33:35 +00:00
Julien Maffre 9b1bcb111e
Doc: reference endpoints using :http: (#3362) 2022-01-07 15:50:34 +00:00
Julien Maffre 45fbadc02c
Update node certificate renewal documentation diagram (#3358) 2022-01-05 16:51:45 +00:00
Renato Golin 3c2c917f65
Add tls test past max buffer (#3356)
Maximum buffer of both mbedTLS and OpenSSL is 16k, so the existing
"large message" test wasn't stressing that. This commit adds a large
enough buffer as well as a handler to update the buffer pointer, like
TLS's real users do.
2022-01-05 15:00:29 +00:00
Julien Maffre 55c36d002f
Update to doxygen 1.9.3 (#3355) 2022-01-05 13:20:26 +00:00
Amaury Chamayou a002191384
Adjust log level to Trace for openapi field insertion (#3353) 2022-01-05 09:20:42 +00:00
dependabot[bot] e99f04b852
Bump @types/node from 17.0.5 to 17.0.7 in /js/ccf-app (#3350) 2022-01-04 09:39:18 +00:00
Amaury Chamayou 15fa4f084f
Upgrade httpx (#3347) 2021-12-31 17:54:42 +00:00
Amaury Chamayou 4d04a40005
Try metrics groups (#3349) 2021-12-31 16:14:54 +00:00
dependabot[bot] a24eaf522b
Bump @types/node from 17.0.1 to 17.0.5 in /js/ccf-app (#3345) 2021-12-29 10:08:30 +00:00
Maik Riechert 40e11a5ba8
minor v8 changes (#3344) 2021-12-22 15:31:55 +00:00
Maik Riechert 3f67461a32
v8: assume UTC+0 (#3341) 2021-12-21 16:24:13 +00:00
Maik Riechert b6459873de
js_v8: ccf.rpc, ccf.crypto bindings & enable npm app test (#3338) 2021-12-21 14:22:10 +00:00
Julien Maffre 8a2e99a990
Infra: cleanup `e2e_logging.py` (#3333) 2021-12-20 17:29:35 +00:00
dependabot[bot] 3bdce192c9
Bump @types/node from 16.11.12 to 17.0.1 in /js/ccf-app (#3337) 2021-12-20 16:53:36 +00:00
Maik Riechert 86323d1519
CI: Explicitly specify llvm symbolizer path to get useful output in Instrumented runs (#3329) 2021-12-16 18:41:12 +00:00
Maik Riechert 918d1d4d37
Experimental V8 app (#3258) 2021-12-16 14:55:29 +00:00
Maik Riechert 52fa5a0623
print signal a node was terminated by (#3332) 2021-12-16 14:25:54 +00:00
Maik Riechert 93a960fdb2
Fix typedoc casing issue (#3321) 2021-12-15 21:38:55 +00:00
Christoph M. Wintersteiger 8339183806
Upgrade llhttp from v6.0.5 to v6.0.6 (#3328) 2021-12-15 18:26:39 +00:00
Christoph M. Wintersteiger 072f9f217f
Upgrade CLI11 from 2.0.0 to 2.1.2 (#3327)
* Upgrade CLI11 from 2.0.0. to 2.1.2
2021-12-15 17:49:29 +00:00
Christoph M. Wintersteiger ab17fe8a3f
Upgrade nlohmann/json from 3.10.2 to 3.10.4 (#3326) 2021-12-15 16:59:51 +00:00
Julien Maffre 89c551e3db
2.0.0-dev changelog (#3323) 2021-12-15 14:07:39 +00:00
Amaury Chamayou d528a7c959
Fix atom leak (#3320) 2021-12-15 12:03:41 +00:00
Julien Maffre eddf7bdb1b
Multiple RPC interfaces redirection (#3300) 2021-12-15 10:40:13 +00:00
Julien Maffre 1416978ada
Improve documentation for service cryptographic keys (#3318) 2021-12-14 19:12:04 +00:00
Maik Riechert cde51dfd9b
always run txs.verify() in e2e_logging test (#3316) 2021-12-14 14:16:18 +00:00
Maik Riechert d91777da79
add pkg-config to build images for v8 (#3317) 2021-12-14 13:44:02 +00:00
dependabot[bot] e645555b39
Bump @types/node from 16.11.11 to 16.11.12 in /js/ccf-app (#3304) 2021-12-14 13:40:03 +00:00
Amaury Chamayou 99e2d9e31d
Only scan for release tags (#3315) 2021-12-14 13:11:34 +00:00
Amaury Chamayou 021fc22dc3
Add job to build CI containers (#3308) 2021-12-14 11:39:18 +00:00
Julien Maffre 4731ec2fd1
Update endorsed node certificate on global hook (#3306) 2021-12-14 09:47:56 +00:00
Julien Maffre dcff5f6e83
Remove HTTP redirect for already-forwarded requests (#3296) 2021-12-10 09:20:30 +00:00
Julien Maffre dff1187450
JSON configuration misc renames (#3290) 2021-12-09 15:38:36 +00:00
Julien Maffre 8289123e28
Always run run.sh non-interactively 2021-12-09 10:44:02 +00:00
Julien Maffre e2017b80a3
JSON configuration: time strings (#3282) 2021-12-09 10:00:00 +00:00
Amaury Chamayou 623f403b81
Upgrade Open Enclave to 0.17.5 (#3284) 2021-12-09 08:57:59 +00:00
Julien Maffre 0432321c67
Skip LTS download if it already exists locally (#3291) 2021-12-08 16:35:19 +00:00
Eddy Ashton 330e7f7112
Simplify Raft constructor (#3288) 2021-12-08 10:52:26 +00:00
Julien Maffre 80b8103a0c
Add option to link in `nghttp2` library (#3287) 2021-12-08 09:41:14 +00:00