Documentation for verifying quotes (#1476)

This commit is contained in:
Julien Maffre 2020-08-03 09:34:14 +01:00 коммит произвёл GitHub
Родитель 829b3c443a
Коммит e2a4f55304
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 34 добавлений и 0 удалений

Просмотреть файл

@ -20,6 +20,7 @@ Before issuing business transactions to CCF, the certificates of trusted users n
deploy_app
issue_commands
verify_quote
python_tutorial
python_api
rpc_api

Просмотреть файл

@ -0,0 +1,32 @@
Verifing Quote
==============
A client can verify the SGX quote of the CCF node that it connects to.
First, the client should connect to the node to verify, specifying the ``/node/quote`` endpoint:
.. code-block:: bash
$ curl https://<ccf-node-address>/node/quote --cacert networkcert.pem
{"quotes": [{"mrenclave":"<measurement_hash>, "node_id":<node_id>, "raw":"<hex_encoded_raw_quote>"}]}
The raw quote should be decoded and output to file for verification via the Open Enclave ``host_verify`` command-line utility:
.. code-block:: bash
$ curl https://<ccf-node-address>/node/quote --cacert networkcert.pem | jq .quotes[0].raw | xxd -r -p > ccf_node_quote.bin
$ /opt/openenclave/bin/host_verify -r ccf_node_quote.bin
Verifying report ccf_node_quote.bin...
Report verification succeeded (0).
.. note:: The ``host_verify`` CLI is included in the Open Enclave ``hostverify`` package available on the `Open Enclave release page <https://github.com/openenclave/openenclave/releases>`_.
The SGX quotes of all currently trusted nodes can also be retrieved via the ``/node/quotes`` endpoint:
.. code-block:: bash
$ curl https://<ccf-node-address>/node/quotes --cacert networkcert.pem
{"quotes": [
{"mrenclave":"<measurement_hash>, "node_id":<node_id>, "raw":"<hex_encoded_raw_quote>"},
{"mrenclave":"<measurement_hash>, "node_id":<node_id>, "raw":"<hex_encoded_raw_quote>"}]}

Просмотреть файл

@ -292,6 +292,7 @@ namespace ccf
make_read_only_endpoint(
"quote", HTTP_GET, json_read_only_adapter(get_quote))
.set_auto_schema<GetQuotes>()
.set_forwarding_required(ForwardingRequired::Never)
.install();
auto get_quotes = [this](auto& args, nlohmann::json&&) {