CCF
Loading...
Searching...
No Matches
node_frontend_utils.h
Go to the documentation of this file.
1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the Apache 2.0 License.
3#pragma once
4
5#include "ccf/http_status.h"
6#include "ccf/node/quote.h"
7
8#include <stdexcept>
9
10namespace ccf
11{
12 static std::pair<http_status, std::string> quote_verification_error(
14 {
15 switch (result)
16 {
18 throw std::invalid_argument(
19 "quote_verification_error should not be called with Verified result");
21 return std::make_pair(
22 HTTP_STATUS_UNAUTHORIZED, "Quote could not be verified");
24 return std::make_pair(
25 HTTP_STATUS_UNAUTHORIZED,
26 "Quote does not contain known enclave measurement");
28 return std::make_pair(
29 HTTP_STATUS_UNAUTHORIZED,
30 "Quote report data does not match the hash of the public key for "
31 "this node");
33 return std::make_pair(
34 HTTP_STATUS_UNAUTHORIZED, "Quote does not contain trusted host data");
36 return std::make_pair(
37 HTTP_STATUS_UNAUTHORIZED, "Quote host data is not authorised");
39 return std::make_pair(
40 HTTP_STATUS_UNAUTHORIZED, "UVM endorsements are not authorised");
42 return std::make_pair(
43 HTTP_STATUS_UNAUTHORIZED, "Quote CPUID is unknown");
45 return std::make_pair(
46 HTTP_STATUS_UNAUTHORIZED, "Quote TCB version is too low");
47 default:
48 throw std::logic_error(fmt::format(
49 "Unknown QuoteVerificationResult: {}",
50 static_cast<uint32_t>(result)));
51 }
52 }
53}
Definition app_interface.h:13
QuoteVerificationResult
Definition quote.h:19