Asylo
|
Namespaces | |
error | |
experimental | |
internal | |
primitives | |
sgx | |
Classes | |
class | AeadCryptor |
An AEAD cryptor that provides Seal() and Open() functionality. More... | |
class | CheckOpMessageBuilder |
A helper class for formatting "expr (V1 vs. V2)" in a CHECK_XX statement. More... | |
class | EnclaveAssertionAuthority |
An EnclaveAssertionAuthority is an authority for assertions of a particular identity type. More... | |
class | EnclaveAssertionGenerator |
Defines an interface for assertion authorities that create assertion offers and generate assertions. More... | |
class | EnclaveAssertionVerifier |
Defines an interface for assertion authorities that generate assertion requests and verify assertions. More... | |
class | EnclaveAuthContext |
Encapsulates the authentication properties of an EKEP-based gRPC connection. More... | |
class | EnclaveClient |
An abstract enclave client. More... | |
struct | EnclaveCredentialsOptions |
Options used to configure a ::grpc::ChannelCredentials object or a ::grpc::ServerCredentials object for use in an enclave system. More... | |
class | EnclaveLoader |
An abstract enclave loader. More... | |
class | EnclaveManager |
A manager object responsible for creating and managing enclave instances. More... | |
class | EnclaveManagerOptions |
Enclave Manager configuration. More... | |
class | IdentityExpectationMatcher |
Defines an abstract interface that describes how to match an EnclaveIdentity against an EnclaveIdentityExpectation . More... | |
class | LogMessage |
Class representing a log message created by a log macro. More... | |
class | LogMessageFatal |
A LogSeverity FATAL (or QFATAL) version of LogMessage that the compiler can interpret as noreturn. More... | |
class | LogMessageVoidify |
This class is used just to take an ostream type and make it a void type to satisify the ternary operator in LOG_IF . More... | |
class | NamedIdentityExpectationMatcher |
A NamedIdentityExpectationMatcher is capable of matching an identity to an expectation if the identity and the expectation's reference identity have the same identity descriptions, and they match the identity description returned by the Description() method of the matcher. More... | |
struct | Namer< NamedIdentityExpectationMatcher > |
class | NonceGenerator |
Defines a nonce-generator interface. More... | |
class | NullAssertionGenerator |
An implementation of the EnclaveAssertionGenerator interface for null assertions. More... | |
class | NullAssertionVerifier |
An implementation of the EnclaveAssertionVerifier interface for null assertions. More... | |
class | SecretSealer |
class | SgxAgeRemoteAssertionGenerator |
A thread-safe implementation of the EnclaveAssertionGenerator interface for SGX remote assertions generated by the Assertion Generator Enclave (AGE). More... | |
class | SgxAgeRemoteAssertionVerifier |
An implemention of the EnclaveAssertionVerifier interface for SGX remote assertions generated by the Assertion Generator Enclave. More... | |
class | SgxIdentityExpectationMatcher |
SgxIdentityExpectationMatcher is capable of matching SGX identities with SGX identity expectations. More... | |
class | SgxIntelEcdsaQeRemoteAssertionGenerator |
Implementation of EnclaveAssertionGenerator that generates assertions using the Intel ECDSA quoting enclave. More... | |
class | SgxIntelEcdsaQeRemoteAssertionVerifier |
Implementation of EnclaveAssertionVerifier that verifiers assertions generated by the Intel ECDSA quoting enclave. More... | |
class | SgxLocalAssertionGenerator |
An implementation of the EnclaveAssertionGenerator interface for SGX local assertions. More... | |
class | SgxLocalAssertionVerifier |
An implemention of the EnclaveAssertionVerifier interface for SGX local assertions. More... | |
class | SgxLocalSecretSealer |
An implementation of the SecretSealer abstract interface that binds the secrets to the enclave identity on a local machine. More... | |
class | SharedName |
A name shared between trusted and untrusted code. More... | |
class | SharedResourceManager |
A manager object for shared resources. More... | |
class | Status |
Status contains information about an error. More... | |
class | StatusOr |
A class for representing either a usable value, or an error. More... | |
class | TrustedApplication |
Abstract base class for trusted applications. More... | |
Typedefs | |
using | CleansingString = std::basic_string< char, std::char_traits< char >, CleansingAllocator< char > > |
A string that zeros its memory on free. More... | |
template<typename T > | |
using | CleansingVector = std::vector< T, CleansingAllocator< T > > |
A vector container that zeros its memory on free. More... | |
Enumerations | |
enum | SgxIdentityMatchSpecOptions { SgxIdentityMatchSpecOptions::DEFAULT, SgxIdentityMatchSpecOptions::STRICT_LOCAL, SgxIdentityMatchSpecOptions::STRICT_REMOTE } |
This enum defines a set of recommended match specs. More... | |
Functions | |
StatusOr< Sha256HashProto > | CreateSha256HashProto (absl::string_view hash_hex) |
Returns a Sha256HashProto with the hash of the given |hash_hex|, or a non-OK Status if the provided string is an invalid hex-encoded SHA-256 hash. More... | |
Status | ValidateSha256HashProto (const Sha256HashProto &hash_proto) |
Validates that |hash_proto| has a hash that is exactly 32 bytes. More... | |
bool | operator== (const Sha256HashProto &lhs, const Sha256HashProto &rhs) |
Compares two Sha256HashProto messages for equality. More... | |
bool | operator!= (const Sha256HashProto &lhs, const Sha256HashProto &rhs) |
Compares two Sha256HashProto messages for inequality. More... | |
std::shared_ptr<::grpc::ChannelCredentials > | EnclaveChannelCredentials (EnclaveCredentialsOptions options) |
Constructs a grpc::ChannelCredentials object for use in an enclave system. More... | |
std::shared_ptr<::grpc::ServerCredentials > | EnclaveServerCredentials (EnclaveCredentialsOptions options) |
Constructs a grpc::ServerCredentials object for use in an enclave system. More... | |
EnclaveCredentialsOptions | BidirectionalNullCredentialsOptions () |
Creates options suitable for configuring a credential used in establishing a bidirectionally-unauthenticated gRPC channel between two enclave entities. More... | |
EnclaveCredentialsOptions | PeerNullCredentialsOptions () |
Creates options suitable for configuring a credential used in establishing a unidirectionally-unauthenticated gRPC channel between two enclave entities. More... | |
EnclaveCredentialsOptions | SelfNullCredentialsOptions () |
Creates options suitable for configuring a credential used in establishing a unidirectionally-unauthenticated gRPC channel between two enclave entities. More... | |
EnclaveCredentialsOptions | PeerSgxAgeRemoteCredentialsOptions () |
Creates options suitable for configuring a credential used in establishing a unidirectionally-authenticated gRPC channel where it accepts identities attested by a remote SGX enclave using Asylo's Assertion Generator Enclave. More... | |
EnclaveCredentialsOptions | BidirectionalSgxAgeRemoteCredentialsOptions () |
Creates options suitable for configuring a credential used in establishing a bidirectionally-authenticated gRPC channel between two SGX enclaves which each use Asylo's Assertion Generator Enclave. More... | |
EnclaveCredentialsOptions | SelfSgxAgeRemoteCredentialsOptions () |
Creates options suitable for configuring a credential used in establishing a unidirectionally-authenticated gRPC channel. More... | |
EnclaveCredentialsOptions | BidirectionalSgxLocalCredentialsOptions () |
Creates options suitable for configuring a credential used in establishing a bidirectionally-authenticated gRPC channel between two local SGX enclaves. More... | |
EnclaveCredentialsOptions | PeerSgxLocalCredentialsOptions () |
Creates options suitable for configuring a credential used in establishing a unidirectionally-authenticated gRPC channel between two local SGX enclaves. More... | |
EnclaveCredentialsOptions | SelfSgxLocalCredentialsOptions () |
Creates options suitable for configuring a credential used in establishing a unidirectionally-authenticated gRPC channel between two local SGX enclaves. More... | |
void | SetNullAssertionDescription (AssertionDescription *assertion_description) |
Sets assertion_description to describe a null assertion. More... | |
void | SetNullIdentityDescription (EnclaveIdentityDescription *identity_description) |
Sets identity_description to describe a null identity. More... | |
void | SetSgxLocalAssertionDescription (AssertionDescription *assertion_description) |
Sets assertion_description to describe an SGX local assertion. More... | |
void | SetSgxAgeRemoteAssertionDescription (AssertionDescription *assertion_description) |
Sets assertion_description to describe an SGX remote assertion generated by the Assertion Generator Enclave (AGE). More... | |
void | SetSgxIntelEcdsaQeRemoteAssertionDescription (AssertionDescription *assertion_description) |
Sets assertion_description to describe an SGX remote assertion generated by the Intel ECDSA Quoting Enclave (QE). More... | |
void | SetSgxIdentityDescription (EnclaveIdentityDescription *identity_description) |
Sets identity_description to describe an SGX identity. More... | |
EnclaveAssertionAuthorityConfig | CreateNullAssertionAuthorityConfig () |
Creates a configuration for the null assertion authority. More... | |
StatusOr< EnclaveAssertionAuthorityConfig > | CreateSgxLocalAssertionAuthorityConfig (std::string attestation_domain) |
Creates a configuration for the SGX local assertion authority. More... | |
StatusOr< EnclaveAssertionAuthorityConfig > | CreateSgxLocalAssertionAuthorityConfig () |
Creates a configuration for the SGX local assertion authority. More... | |
StatusOr< EnclaveAssertionAuthorityConfig > | CreateSgxAgeRemoteAssertionAuthorityConfig (Certificate intel_root_cert, std::vector< Certificate > certificates, std::string server_address, IdentityAclPredicate age_identity_expectation) |
Creates a configuration for the SGX AGE remote assertion authority. More... | |
StatusOr< EnclaveAssertionAuthorityConfig > | CreateSgxAgeRemoteAssertionAuthorityConfig (std::string server_address, SgxIdentity age_identity) |
Creates a configuration for the SGX AGE remote assertion authority. More... | |
StatusOr< bool > | EvaluateIdentityAcl (const std::vector< EnclaveIdentity > &identities, const IdentityAclPredicate &acl, const IdentityExpectationMatcher &matcher, std::string *explanation=nullptr) |
Uses matcher to evaluate whether identities satisfies acl . More... | |
DEFINE_STATIC_MAP_OF_BASE_TYPE (IdentityExpectationMatcherMap, NamedIdentityExpectationMatcher) | |
EnclaveIdentityExpectation | CreateNullIdentityExpectation () |
Returns a default null identity expectation. More... | |
SgxIdentity | GetSelfSgxIdentity () |
Returns the current enclave's identity. More... | |
StatusOr< SgxIdentityMatchSpec > | CreateSgxIdentityMatchSpec (SgxIdentityMatchSpecOptions options) |
Returns an SgxIdentityMatchSpec corresponding to options on success or a non-OK Status on failure. More... | |
StatusOr< SgxIdentityExpectation > | CreateSgxIdentityExpectation (SgxIdentity identity, SgxIdentityMatchSpec match_spec) |
Returns an SgxIdentityExpectation formed from identity and match_spec , or returns a non-OK Status if either are invalid or if they are incompatible with each other. More... | |
StatusOr< SgxIdentityExpectation > | CreateSgxIdentityExpectation (SgxIdentity identity, SgxIdentityMatchSpecOptions options) |
Returns an SgxIdentityExpectation formed from identity and the match spec corresponding to options , or returns a non-OK Status if either are invalid or if they are incompatible with each other. More... | |
bool | IsValidSgxIdentity (const SgxIdentity &identity) |
Returns whether identity is valid. More... | |
bool | IsValidSgxIdentityMatchSpec (const SgxIdentityMatchSpec &match_spec) |
Returns whether match_spec is valid. More... | |
bool | IsValidSgxIdentityExpectation (const SgxIdentityExpectation &expectation) |
Returns whether expectation is valid. More... | |
StatusOr< SgxIdentity > | ParseSgxIdentity (const EnclaveIdentity &generic_identity) |
Parses and validates generic_identity , returning an SgxIdentity on success or a non-OK Status on failure. More... | |
StatusOr< SgxIdentityMatchSpec > | ParseSgxIdentityMatchSpec (const std::string &generic_match_spec) |
Parses and validates generic_match_spec , returning an SgxIdentityMatchSpec on success or a non-OK Status on failure. More... | |
StatusOr< SgxIdentityExpectation > | ParseSgxIdentityExpectation (const EnclaveIdentityExpectation &generic_expectation) |
Parses and validates generic_expectation , returning an SgxIdentityExpectation on success or a non-OK Status on failure. More... | |
StatusOr< EnclaveIdentity > | SerializeSgxIdentity (const SgxIdentity &sgx_identity) |
Serializes sgx_identity , returning an EnclaveIdentity on success or a non-OK Status on failure. More... | |
StatusOr< std::string > | SerializeSgxIdentityMatchSpec (const SgxIdentityMatchSpec &sgx_match_spec) |
Serializes sgx_match_spec , returning a string on success or a non-OK Status on failure. More... | |
StatusOr< EnclaveIdentityExpectation > | SerializeSgxIdentityExpectation (const SgxIdentityExpectation &sgx_expectation) |
Serializes sgx_expectation , returning an EnclaveIdentityExpectation on success or a non-OK Status on failure. More... | |
void | SetEnclaveConfigDefaults (const HostConfig &host_config, EnclaveConfig *config) |
void | SetEnclaveConfigDefaults (EnclaveConfig *config) |
Sets critical uninitialized fields in config to default values. More... | |
EnclaveConfig | CreateDefaultEnclaveConfig (const HostConfig &host_config) |
EnclaveConfig | CreateDefaultEnclaveConfig () |
Returns an EnclaveConfig proto with critical fields initialize to default values. More... | |
primitives::Client * | LoadEnclaveInChildProcess (absl::string_view enclave_name, void *enclave_base_address, size_t enclave_size) |
std::ostream & | operator<< (std::ostream &os, const SharedName &name) |
template<> | |
void | MakeCheckOpValueString (std::ostream *os, const std::nullptr_t &p) |
void | set_vlog_level (int level) |
Sets the verbosity threshold for VLOG. More... | |
int | get_vlog_level () |
Gets the verbosity threshold for VLOG. More... | |
bool | set_log_directory (const std::string &log_directory) |
Sets the log directory, as specified when this enclave is initialized. More... | |
const std::string | get_log_directory () |
Gets the log directory that was specified when this enclave is initialized. More... | |
bool | EnsureDirectory (const char *path) |
Checks the log directory to make sure it's accessible, and creates it if it does not exist. More... | |
bool | InitLogging (const char *directory, const char *file_name, int level) |
Initializes minimal logging library. More... | |
template<typename T > | |
T | CheckNotNull (const char *file, int line, const char *exprtext, T &&t) |
Logs a message if the given value of type T is null, and then forwards the value. More... | |
PolymorphicStatusMatcherType | PosixErrorIs (int errnum) |
Matches a Status -like object that contains the given POSIX error. More... | |
Status | PosixError (int errnum, absl::string_view message="") |
Returns a Status representing a POSIX error. More... | |
Status | LastPosixError (absl::string_view message="") |
Returns a Status representing the last POSIX error in this thread. More... | |
int | GetErrno (const Status &status) |
Returns the POSIX error number that a Status represents, or zero if the Status does not represent a POSIX error. More... | |
template<class T > | |
bool | AbslParseFlag (absl::string_view text, T *flag, std::string *error) |
template<class T > | |
std::string | AbslUnparseFlag (const T &flag) |
bool | operator== (const Status &lhs, const Status &rhs) |
bool | operator!= (const Status &lhs, const Status &rhs) |
std::ostream & | operator<< (std::ostream &os, const Status &status) |
bool | operator== (const Status &lhs, const absl::Status &rhs) |
bool | operator!= (const Status &lhs, const absl::Status &rhs) |
bool | operator== (const absl::Status &lhs, const Status &rhs) |
bool | operator!= (const absl::Status &lhs, const Status &rhs) |
Status | OkStatus () |
Returns an OK status object. More... | |
template<typename ToStatusT , typename FromStatusT > | |
ToStatusT | ConvertStatus (const FromStatusT &from_status) |
Converts a status-like object to another status type. More... | |
StatusProto | StatusToProto (const Status &status) |
Exports the contents of status into a StatusProto . More... | |
Status | StatusFromProto (const StatusProto &status_proto) |
Returns a Status based on the contents of the given status_proto . More... | |
template<typename MessageT > | |
std::string | GetTypeUrl () |
Returns the type URL associated with a given protobuf message type. More... | |
template<typename MessageT , typename StatusT = Status> | |
absl::optional< MessageT > | GetProtoPayload (const StatusT &status) |
Gets the payload of type MessageT in status . More... | |
template<typename MessageT , typename StatusT = Status> | |
void | SetProtoPayload (const MessageT &message, StatusT &status) |
Adds a payload of type MessageT to status . More... | |
Status | WithContext (const Status &status, absl::string_view context) |
Returns the Status with the provided context prepended to its error message. More... | |
template<typename T > | |
StatusOr< T > | WithContext (StatusOr< T > status_or, absl::string_view context) |
As the Status overload above, but for StatusOr<T> . More... | |
template<typename T > | |
absl::StatusOr< T > | WithContext (absl::StatusOr< T > status_or, absl::string_view context) |
As the StatusOr<T> overload above, but for absl::StatusOr<T> . More... | |
Variables | |
ABSL_CONST_INIT const char | kValueMoveConstructorMsg [] |
ABSL_CONST_INIT const char | kValueMoveAssignmentMsg [] |
ABSL_CONST_INIT const char | kValueOrDieMovedMsg [] |
ABSL_CONST_INIT const char | kStatusMoveConstructorMsg [] |
ABSL_CONST_INIT const char | kStatusMoveAssignmentMsg [] |
using asylo::CleansingString = typedef std::basic_string<char, std::char_traits<char>, CleansingAllocator<char> > |
A string that zeros its memory on free.
CleansingVector
instead. using asylo::CleansingVector = typedef std::vector<T, CleansingAllocator<T> > |
A vector container that zeros its memory on free.
|
strong |
This enum defines a set of recommended match specs.
Users are advised to pick the one that most closely matches their application's security requirements and make adjustments to these match specs as needed.
DEFAULT
sgx::MachineConfiguration
fields.STRICT_LOCAL
sgx::MachineConfiguration
fields are required to match, as they are unavailable in local attestation. STRICT_REMOTE
STRICT_LOCAL
match spec, with the added requirement of matching all sgx::MachineConfiguration
fields (not just CPUSVN). Enumerator | |
---|---|
DEFAULT | |
STRICT_LOCAL | |
STRICT_REMOTE |
bool asylo::AbslParseFlag | ( | absl::string_view | text, |
T * | flag, | ||
std::string * | error | ||
) |
std::string asylo::AbslUnparseFlag | ( | const T & | flag | ) |
EnclaveCredentialsOptions asylo::BidirectionalNullCredentialsOptions | ( | ) |
Creates options suitable for configuring a credential used in establishing a bidirectionally-unauthenticated gRPC channel between two enclave entities.
A credential configured with these options enforces bidirectional authentication using the null identity. The null identity specifies no identity in particular, which means that the resulting connection is essentially unauthenticated.
Sample usage for creating ::grpc::ChannelCredentials
:
Sample usage for creating ::grpc::ServerCredentials
:
EnclaveCredentialsOptions asylo::BidirectionalSgxAgeRemoteCredentialsOptions | ( | ) |
Creates options suitable for configuring a credential used in establishing a bidirectionally-authenticated gRPC channel between two SGX enclaves which each use Asylo's Assertion Generator Enclave.
A credential configured with these options enforces bidirectional authentication using SGX enclave code identity.
Sample usage for creating ::grpc::ChannelCredentials
:
Sample usage for creating ::grpc::ServerCredentials
:
EnclaveCredentialsOptions asylo::BidirectionalSgxLocalCredentialsOptions | ( | ) |
Creates options suitable for configuring a credential used in establishing a bidirectionally-authenticated gRPC channel between two local SGX enclaves.
A credential configured with these options enforces bidirectional authentication using SGX enclave code identity.
Sample usage for creating ::grpc::ChannelCredentials
:
Sample usage for creating ::grpc::ServerCredentials
:
T asylo::CheckNotNull | ( | const char * | file, |
int | line, | ||
const char * | exprtext, | ||
T && | t | ||
) |
Logs a message if the given value of type T
is null, and then forwards the value.
In C++11, all cases can be handled by a single function. Since the value category of the argument is preserved (also for rvalue references), member initializer lists like the one below will compile correctly:
file | The source file that produced the log. |
line | The source code line that produced the log. |
exprtext | A string representation of the code in file at line . |
t | The parameter being checked for null. |
ToStatusT asylo::ConvertStatus | ( | const FromStatusT & | from_status | ) |
Converts a status-like object to another status type.
The source and target types must:
const
error_code()
, error_message()
, and ok()
methods.This function is provided for the convenience of Asylo-SDK consumers utilizing other status types such as ::grpc::Status
.
Note that all statuses are converted to the canonical error space, so additional error space information is lost.
Payloads are preserved if both input and output status types support them.
from_status | A status-like object to copy. |
from_status
. EnclaveConfig asylo::CreateDefaultEnclaveConfig | ( | const HostConfig & | host_config | ) |
host_config | This parameter is ignored. |
EnclaveConfig asylo::CreateDefaultEnclaveConfig | ( | ) |
Returns an EnclaveConfig proto with critical fields initialize to default values.
EnclaveAssertionAuthorityConfig asylo::CreateNullAssertionAuthorityConfig | ( | ) |
Creates a configuration for the null assertion authority.
This configuration is required when using the NullAssertionGenerator or NullAssertionVerifier.
EnclaveIdentityExpectation asylo::CreateNullIdentityExpectation | ( | ) |
Returns a default null identity expectation.
StatusOr<EnclaveAssertionAuthorityConfig> asylo::CreateSgxAgeRemoteAssertionAuthorityConfig | ( | Certificate | intel_root_cert, |
std::vector< Certificate > | certificates, | ||
std::string | server_address, | ||
IdentityAclPredicate | age_identity_expectation | ||
) |
Creates a configuration for the SGX AGE remote assertion authority.
This configuration is required when using the SgxAgeRemoteAssertionGenerator or SgxAgeRemoteAssertionVerifier.
intel_cert | The Intel root certificate to use for verification. |
certificates | A vector of X.509-formatted CA certificates that can be used to verify whether an assertion is valid. |
server_address | The address of the AGE's service. |
age_identity_expectation | The identity expectation for the AGE. |
StatusOr<EnclaveAssertionAuthorityConfig> asylo::CreateSgxAgeRemoteAssertionAuthorityConfig | ( | std::string | server_address, |
SgxIdentity | age_identity | ||
) |
Creates a configuration for the SGX AGE remote assertion authority.
This configuration is required when using the SgxAgeRemoteAssertionGenerator or SgxAgeRemoteAssertionVerifier. It uses the Intel root certificate value |kIntelSgxRootCaCertificate| and no additional root certificates. It sets the AGE identity expectation to the default expectation of the given SgxIdentity, as documented by SgxIdentityMatchSpecOptions
.
server_address | The address of the AGE's service. |
age_identity | The expected identity of the AGE. |
StatusOr<SgxIdentityExpectation> asylo::CreateSgxIdentityExpectation | ( | SgxIdentity | identity, |
SgxIdentityMatchSpec | match_spec | ||
) |
Returns an SgxIdentityExpectation
formed from identity
and match_spec
, or returns a non-OK Status if either are invalid or if they are incompatible with each other.
StatusOr<SgxIdentityExpectation> asylo::CreateSgxIdentityExpectation | ( | SgxIdentity | identity, |
SgxIdentityMatchSpecOptions | options | ||
) |
Returns an SgxIdentityExpectation
formed from identity
and the match spec corresponding to options
, or returns a non-OK Status if either are invalid or if they are incompatible with each other.
StatusOr<SgxIdentityMatchSpec> asylo::CreateSgxIdentityMatchSpec | ( | SgxIdentityMatchSpecOptions | options | ) |
Returns an SgxIdentityMatchSpec
corresponding to options
on success or a non-OK Status on failure.
StatusOr<EnclaveAssertionAuthorityConfig> asylo::CreateSgxLocalAssertionAuthorityConfig | ( | std::string | attestation_domain | ) |
Creates a configuration for the SGX local assertion authority.
This configuration is required when using the SgxLocalAssertionGenerator or SgxLocalAssertionVerifier.
attestation_domain | A 16-byte unique identifier for the SGX machine. |
StatusOr<EnclaveAssertionAuthorityConfig> asylo::CreateSgxLocalAssertionAuthorityConfig | ( | ) |
Creates a configuration for the SGX local assertion authority.
The attestation domain is derived from the per-boot machine UUID in /proc/sys/kernel/random/boot_id.
This configuration is required when using the SgxLocalAssertionGenerator or SgxLocalAssertionVerifier.
/return A config for the SGX local assertion authority.
StatusOr<Sha256HashProto> asylo::CreateSha256HashProto | ( | absl::string_view | hash_hex | ) |
Returns a Sha256HashProto
with the hash of the given |hash_hex|, or a non-OK Status if the provided string is an invalid hex-encoded SHA-256 hash.
asylo::DEFINE_STATIC_MAP_OF_BASE_TYPE | ( | IdentityExpectationMatcherMap | , |
NamedIdentityExpectationMatcher | |||
) |
std::shared_ptr<::grpc::ChannelCredentials> asylo::EnclaveChannelCredentials | ( | EnclaveCredentialsOptions | options | ) |
Constructs a grpc::ChannelCredentials
object for use in an enclave system.
The configuration options
determines which assertions are presented by the entity that wields the resulting credentials object. options
must meet the following criteria:
options.self_assertions
must contain at least one assertion description.options.accepted_peer_assertions
must contain at least one assertion description.options | Options for configuring the credentials. |
std::shared_ptr<::grpc::ServerCredentials> asylo::EnclaveServerCredentials | ( | EnclaveCredentialsOptions | options | ) |
Constructs a grpc::ServerCredentials
object for use in an enclave system.
The configuration options
determines which assertions are presented by the entity that wields the resulting credentials object. options
must meet the following criteria:
options.self_assertions
must contain at least one assertion descriptionoptions.accepted_peer_assertions
must contain at least one assertion descriptionoptions | Options for configuring the credentials. |
bool asylo::EnsureDirectory | ( | const char * | path | ) |
Checks the log directory to make sure it's accessible, and creates it if it does not exist.
path | The directory to be checked. |
StatusOr<bool> asylo::EvaluateIdentityAcl | ( | const std::vector< EnclaveIdentity > & | identities, |
const IdentityAclPredicate & | acl, | ||
const IdentityExpectationMatcher & | matcher, | ||
std::string * | explanation = nullptr |
||
) |
Uses matcher
to evaluate whether identities
satisfies acl
.
The ACL is provided in the form of an IdentityAclPredicate
. An IdentityAclPredicate
is a recursive proto, each layer of which must conform to the following constraints:
predicate
must have predicate.item
set.group
must have a non-empty group.predicates
.group
.type is GroupType::NOT
, group.predicates
must contain exactly one predicate.Returns a non-OK status if acl
is malformed or if matcher.MatchAndExplain()
returns a non-OK status when invoked with any of identities
.
identities | A list of identities to match against the ACL. | |
acl | An ACL specifying expectations on an identity. | |
matcher | The matcher to use to evaluate identities against acl . | |
[out] | explanation | An explanation of why the match failed, if the result is false. |
const std::string asylo::get_log_directory | ( | ) |
Gets the log directory that was specified when this enclave is initialized.
int asylo::get_vlog_level | ( | ) |
Gets the verbosity threshold for VLOG.
A VLOG command with a level greater than this will be ignored.
int asylo::GetErrno | ( | const Status & | status | ) |
Returns the POSIX error number that a Status
represents, or zero if the Status
does not represent a POSIX error.
This function understands Status
es that were created in the POSIX error space.
status | A status object. |
status
, or zero if status
does not represent a POSIX error. absl::optional<MessageT> asylo::GetProtoPayload | ( | const StatusT & | status | ) |
Gets the payload of type MessageT
in status
.
MessageT
must be a protobuf message type.
The status
argument may be either an Asylo Status
or an absl::Status
.
status | The status to find the payload in. |
MessageT
in status
, or absl::nullopt
if status
contains no payload of the given type. Also returns absl::nullopt
if there was a parsing error. SgxIdentity asylo::GetSelfSgxIdentity | ( | ) |
Returns the current enclave's identity.
std::string asylo::GetTypeUrl | ( | ) |
Returns the type URL associated with a given protobuf message type.
This should be used when embedding a message of that type as a payload in a Status
.
MessageT
payloads. bool asylo::InitLogging | ( | const char * | directory, |
const char * | file_name, | ||
int | level | ||
) |
Initializes minimal logging library.
For untrusted logging, the program name specified by argv0 will be used as log filename; For enclave logging, the enclave name will be used as log filename (any slashes or dots will be removed). This method is called during enclave initialization. For untrusted logging, this should be called in main().
directory | The log file directory. |
file_name | The name of the log file. |
level | The verbosity threshold for VLOG commands. A VLOG command with a level equal to or lower than it will be logged. |
bool asylo::IsValidSgxIdentity | ( | const SgxIdentity & | identity | ) |
Returns whether identity
is valid.
An SgxIdentity
is considered valid if its MISCSELECT and ATTRIBUTES properties are set and any additional fields present in the message are valid as well.
bool asylo::IsValidSgxIdentityExpectation | ( | const SgxIdentityExpectation & | expectation | ) |
Returns whether expectation
is valid.
An SgxIdentityExpectation
is valid if its identity and match spec components are valid and they are both compatible with each other.
bool asylo::IsValidSgxIdentityMatchSpec | ( | const SgxIdentityMatchSpec & | match_spec | ) |
Returns whether match_spec
is valid.
An SgxIdentityMatchSpec
is valid if all of its constituent fields are set.
Status asylo::LastPosixError | ( | absl::string_view | message = "" | ) |
Returns a Status representing the last POSIX error in this thread.
Equivalent to calling PosixError(errno, message)
.
message | An optional message to prepend to the POSIX error explanation string. |
primitives::Client* asylo::LoadEnclaveInChildProcess | ( | absl::string_view | enclave_name, |
void * | enclave_base_address, | ||
size_t | enclave_size | ||
) |
void asylo::MakeCheckOpValueString | ( | std::ostream * | os, |
const std::nullptr_t & | p | ||
) |
Status asylo::OkStatus | ( | ) |
Returns an OK status object.
bool asylo::operator!= | ( | const Sha256HashProto & | lhs, |
const Sha256HashProto & | rhs | ||
) |
Compares two Sha256HashProto
messages for inequality.
bool asylo::operator!= | ( | const Status & | lhs, |
const absl::Status & | rhs | ||
) |
bool asylo::operator!= | ( | const absl::Status & | lhs, |
const Status & | rhs | ||
) |
|
inline |
std::ostream& asylo::operator<< | ( | std::ostream & | os, |
const Status & | status | ||
) |
bool asylo::operator== | ( | const Sha256HashProto & | lhs, |
const Sha256HashProto & | rhs | ||
) |
Compares two Sha256HashProto
messages for equality.
bool asylo::operator== | ( | const Status & | lhs, |
const absl::Status & | rhs | ||
) |
bool asylo::operator== | ( | const absl::Status & | lhs, |
const Status & | rhs | ||
) |
StatusOr<SgxIdentity> asylo::ParseSgxIdentity | ( | const EnclaveIdentity & | generic_identity | ) |
Parses and validates generic_identity
, returning an SgxIdentity
on success or a non-OK Status on failure.
StatusOr<SgxIdentityExpectation> asylo::ParseSgxIdentityExpectation | ( | const EnclaveIdentityExpectation & | generic_expectation | ) |
Parses and validates generic_expectation
, returning an SgxIdentityExpectation
on success or a non-OK Status on failure.
StatusOr<SgxIdentityMatchSpec> asylo::ParseSgxIdentityMatchSpec | ( | const std::string & | generic_match_spec | ) |
Parses and validates generic_match_spec
, returning an SgxIdentityMatchSpec
on success or a non-OK Status on failure.
EnclaveCredentialsOptions asylo::PeerNullCredentialsOptions | ( | ) |
Creates options suitable for configuring a credential used in establishing a unidirectionally-unauthenticated gRPC channel between two enclave entities.
A credential configured with these options enforces unidirectional authentication using the null identity. The null identity specifies no identity in particular, which means that in the resulting connection the peer does not authenticate.
Sample usage for creating ::grpc::ChannelCredentials
:
Sample usage for creating ::grpc::ServerCredentials
:
EnclaveCredentialsOptions asylo::PeerSgxAgeRemoteCredentialsOptions | ( | ) |
Creates options suitable for configuring a credential used in establishing a unidirectionally-authenticated gRPC channel where it accepts identities attested by a remote SGX enclave using Asylo's Assertion Generator Enclave.
A credential configured with these options enforces that the peer authenticates using SGX enclave code identity attested by Asylo's Assertion Generator Enclave..
Sample usage for creating ::grpc::ChannelCredentials
:
Sample usage for creating ::grpc::ServerCredentials
:
EnclaveCredentialsOptions asylo::PeerSgxLocalCredentialsOptions | ( | ) |
Creates options suitable for configuring a credential used in establishing a unidirectionally-authenticated gRPC channel between two local SGX enclaves.
A credential configured with these options enforces that the peer authenticates using SGX enclave code identity.
Sample usage for creating ::grpc::ChannelCredentials
:
Sample usage for creating ::grpc::ServerCredentials
:
Status asylo::PosixError | ( | int | errnum, |
absl::string_view | message = "" |
||
) |
Returns a Status representing a POSIX error.
If errnum
is zero, PosixError()
returns an OK status. Otherwise, the returned error message includes the POSIX error explanation string.
Callers should not rely on how PosixError()
embeds error information in the returned Status
. Instead, callers can use GetErrno()
to inspect a Status
for POSIX error information.
However, callers may rely on stability in the mapping between POSIX error numbers and absl::StatusCode
s. Callers can also use this function to create Status
es that are understandable by other code that uses the POSIX error space.
errnum | A POSIX error number. See errno(3). |
message | An optional message to prepend to the POSIX error explanation string. |
errnum
, or an OK status if errnum
is zero. PolymorphicStatusMatcherType asylo::PosixErrorIs | ( | int | errnum | ) |
Matches a Status
-like object that contains the given POSIX error.
Works on any Status
that can be inspected by GetErrno()
.
errnum | A POSIX error code. |
errnum
. EnclaveCredentialsOptions asylo::SelfNullCredentialsOptions | ( | ) |
Creates options suitable for configuring a credential used in establishing a unidirectionally-unauthenticated gRPC channel between two enclave entities.
A credential configured with these options enforces unidirectional authentication using the null identity. The null identity specifies no identity in particular, which means that in the resulting connection the credential holder does not authenticate.
Sample usage for creating ::grpc::ChannelCredentials
:
Sample usage for creating ::grpc::ServerCredentials
:
EnclaveCredentialsOptions asylo::SelfSgxAgeRemoteCredentialsOptions | ( | ) |
Creates options suitable for configuring a credential used in establishing a unidirectionally-authenticated gRPC channel.
A credential configured with these options enforces that the credential holder authenticates using SGX enclave code identity attested by Asylo's Assertion Generator Enclave.
Sample usage for creating ::grpc::ChannelCredentials
:
Sample usage for creating ::grpc::ServerCredentials
:
EnclaveCredentialsOptions asylo::SelfSgxLocalCredentialsOptions | ( | ) |
Creates options suitable for configuring a credential used in establishing a unidirectionally-authenticated gRPC channel between two local SGX enclaves.
A credential configured with these options enforces that the credential holder authenticates using SGX enclave code identity.
Sample usage for creating ::grpc::ChannelCredentials
:
Sample usage for creating ::grpc::ServerCredentials
:
StatusOr<EnclaveIdentity> asylo::SerializeSgxIdentity | ( | const SgxIdentity & | sgx_identity | ) |
Serializes sgx_identity
, returning an EnclaveIdentity
on success or a non-OK Status on failure.
StatusOr<EnclaveIdentityExpectation> asylo::SerializeSgxIdentityExpectation | ( | const SgxIdentityExpectation & | sgx_expectation | ) |
Serializes sgx_expectation
, returning an EnclaveIdentityExpectation
on success or a non-OK Status on failure.
StatusOr<std::string> asylo::SerializeSgxIdentityMatchSpec | ( | const SgxIdentityMatchSpec & | sgx_match_spec | ) |
Serializes sgx_match_spec
, returning a string on success or a non-OK Status on failure.
bool asylo::set_log_directory | ( | const std::string & | log_directory | ) |
Sets the log directory, as specified when this enclave is initialized.
This is only set once. Any request to reset it will return false.
log_directory | The log file directory. |
void asylo::set_vlog_level | ( | int | level | ) |
Sets the verbosity threshold for VLOG.
A VLOG command with a level greater than this will be ignored.
level | The verbosity threshold for VLOG to be set. A VLOG command with level less than or equal to this will be logged. |
void asylo::SetEnclaveConfigDefaults | ( | const HostConfig & | host_config, |
EnclaveConfig * | config | ||
) |
config
to default values.host_config | Values to set in the host_config field of config . |
config[out] | EnclaveConfig object to populate. |
void asylo::SetEnclaveConfigDefaults | ( | EnclaveConfig * | config | ) |
Sets critical uninitialized fields in config
to default values.
config[out] | EnclaveConfig object to populate. |
|
inline |
Sets assertion_description
to describe a null assertion.
assertion_description | The AssertionDescription to populate. |
|
inline |
Sets identity_description
to describe a null identity.
identity_description | The EnclaveIdentityDescription to populate. |
void asylo::SetProtoPayload | ( | const MessageT & | message, |
StatusT & | status | ||
) |
Adds a payload of type MessageT
to status
.
MessageT
must be a protobuf message type. Note that a Status
can only have one payload of any given message type.
The message is embedded with the same type URL that would be used to pack the message into a google::protobuf::Any
.
The status
argument may be either an Asylo Status
or an absl::Status
.
message | A protobuf message object. | |
[in,out] | status | The status to add the payload to. |
|
inline |
Sets assertion_description
to describe an SGX remote assertion generated by the Assertion Generator Enclave (AGE).
assertion_description | The AssertionDescription to populate. |
|
inline |
Sets identity_description
to describe an SGX identity.
identity_description | The EnclaveIdentityDescription to populate. |
|
inline |
Sets assertion_description
to describe an SGX remote assertion generated by the Intel ECDSA Quoting Enclave (QE).
assertion_description | The AssertionDescription to populate. |
|
inline |
Sets assertion_description
to describe an SGX local assertion.
assertion_description | The AssertionDescription to populate. |
Status asylo::StatusFromProto | ( | const StatusProto & | status_proto | ) |
Returns a Status
based on the contents of the given status_proto
.
If the error space given by status_proto.space()
is unrecognized, the returned Status
is in the canonical error space and has an error code equal to status_proto.canonical_code()
. If status_proto
has no canonical code, the returned Status
has an error code of absl::StatusCode::kUnknown
. Note that the error message is only set if status_proto
represents a non-OK status.
If the given status_proto
is invalid, then the returned Status
has an appropriate error code and message. A StatusProto
is valid if and only if all the following conditions hold:
code()
is 0, then canonical_code()
is set to 0.canonical_code()
is 0, then code()
is set to 0.canonical_code()
is equal to the equivalent canonical code given by the error space.status_proto | A protobuf object to unpack. |
Status
based on the contents of status_proto
. StatusProto asylo::StatusToProto | ( | const Status & | status | ) |
Exports the contents of status
into a StatusProto
.
This function sets the space
and canonical_code
fields in status_proto
even if status
is in the canonical error space.
status | A Status to pack into a proto. |
StatusProto
representing status
. Status asylo::ValidateSha256HashProto | ( | const Sha256HashProto & | hash_proto | ) |
Validates that |hash_proto| has a hash that is exactly 32 bytes.
Returns the Status
with the provided context prepended to its error message.
Returns OkStatus()
if the given Status
is OK.
status
with context
prepended, along with an appropriate separator. absl::StatusOr<T> asylo::WithContext | ( | absl::StatusOr< T > | status_or, |
absl::string_view | context | ||
) |
As the StatusOr<T>
overload above, but for absl::StatusOr<T>
.
status | An absl::StatusOr<T> to add context to, if it is not OK. |
context | Additional context to add to the absl::Status . |
status_or
if it is OK, otherwise status_or.status()
with context
prepended to the error message. ABSL_CONST_INIT const char asylo::kStatusMoveAssignmentMsg[] |
ABSL_CONST_INIT const char asylo::kStatusMoveConstructorMsg[] |
ABSL_CONST_INIT const char asylo::kValueMoveAssignmentMsg[] |
ABSL_CONST_INIT const char asylo::kValueMoveConstructorMsg[] |
ABSL_CONST_INIT const char asylo::kValueOrDieMovedMsg[] |