CCF
Loading...
Searching...
No Matches
verify.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#if defined(INSIDE_ENCLAVE) && !defined(VIRTUAL_ENCLAVE)
6# include <openenclave/attestation/verifier.h>
7# include <openenclave/enclave.h>
8#elif defined(SGX_ATTESTATION_VERIFICATION)
9# include <openenclave/host_verify.h>
10#endif
12
13namespace ccf
14{
16 {
17#ifdef SGX_ATTESTATION_VERIFICATION
18 auto rc = oe_verifier_initialize();
19 if (rc != OE_OK)
20 {
21 throw ccf::ccf_oe_verifier_init_error(fmt::format(
22 "Failed to initialise evidence verifier: {}", oe_result_str(rc)));
23 }
24#endif
25 }
26
28 {
29#ifdef SGX_ATTESTATION_VERIFICATION
30 oe_verifier_shutdown();
31#endif
32 }
33}
Definition ccf_exception.h:44
Definition app_interface.h:15
void initialize_verifiers()
Definition verify.h:15
void shutdown_verifiers()
Definition verify.h:27
#define oe_result_str(x)
Definition virtual_enclave.h:52
constexpr oe_result_t OE_OK
Definition virtual_enclave.h:41