CCF
Loading...
Searching...
No Matches
Namespaces | Macros | Typedefs | Functions
attestation.cpp File Reference
#include "ccf/pal/attestation.h"
#include "ccf/crypto/ecdsa.h"
#include "ccf/crypto/openssl/openssl_wrappers.h"
#include "ccf/crypto/verifier.h"
#include "ccf/pal/attestation_sev_snp.h"
#include "ccf/pal/sev_snp_cpuid.h"
#include "ds/internal_logger.h"
#include <cstdint>

Namespaces

namespace  ccf
 
namespace  ccf::pal
 

Macros

#define TCB_OID_PREFIX   "1.3.6.1.4.1.3704.1.3."
 
#define RETRIEVE_TCB_FIELD(TCB, FIELD, OID_SUFFIX)
 

Typedefs

using ccf::pal::Unique_ASN1_OBJECT = ccf::crypto::OpenSSL::Unique_SSL_OBJECT< ASN1_OBJECT, ASN1_OBJECT_new, ASN1_OBJECT_free >
 
using ccf::pal::Unique_ASN1_INTEGER = ccf::crypto::OpenSSL::Unique_SSL_OBJECT< ASN1_INTEGER, ASN1_INTEGER_new, ASN1_INTEGER_free >
 

Functions

void ccf::pal::verify_virtual_attestation_report (const QuoteInfo &quote_info, PlatformAttestationMeasurement &measurement, PlatformAttestationReportData &report_data)
 
std::optional< long > ccf::pal::get_integer_from_cert_extensions (const ccf::crypto::OpenSSL::Unique_X509 &x509, const std::string &oid)
 
std::optional< snp::TcbVersionRawccf::pal::get_milan_genoa_tcb_from_cert (const crypto::Pem &vcek_leaf_cert)
 
std::optional< snp::TcbVersionRawccf::pal::get_turin_tcb_from_cert (const crypto::Pem &vcek_leaf_cert)
 
std::optional< snp::TcbVersionRawccf::pal::get_endorsed_tcb_from_cert (snp::ProductName product, const crypto::Pem &vcek_leaf_cert)
 
std::optional< std::vector< uint8_t > > ccf::pal::get_endorsed_chip_id_from_cert (const crypto::Pem &vcek_leaf_cert)
 
void ccf::pal::verify_snp_attestation_report (const QuoteInfo &quote_info, PlatformAttestationMeasurement &measurement, PlatformAttestationReportData &report_data)
 
void ccf::pal::verify_quote (const QuoteInfo &quote_info, PlatformAttestationMeasurement &measurement, PlatformAttestationReportData &report_data)
 

Macro Definition Documentation

◆ RETRIEVE_TCB_FIELD

#define RETRIEVE_TCB_FIELD (   TCB,
  FIELD,
  OID_SUFFIX 
)
Value:
do \
{ \
auto val_##FIELD = \
get_integer_from_cert_extensions(x509, TCB_OID_PREFIX OID_SUFFIX); \
if (!val_##FIELD.has_value()) \
{ \
return std::nullopt; \
} \
if (val_##FIELD.value() < 0 || val_##FIELD.value() > UINT8_MAX) \
{ \
throw std::logic_error(fmt::format( \
"Invalid {} value in TCB version: {}", #FIELD, val_##FIELD.value())); \
} \
(TCB)->FIELD = static_cast<uint8_t>(val_##FIELD.value()); \
} while (0)
#define TCB_OID_PREFIX
Definition attestation.cpp:73

◆ TCB_OID_PREFIX

#define TCB_OID_PREFIX   "1.3.6.1.4.1.3704.1.3."