ra-challenger.h 829 字节
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
#ifndef _RA_CHALLENGER_H_
#define _RA_CHALLENGER_H_

#include <sgx_quote.h>

/**
 * Extract an Intel SGX quote from an Intel Attestation Service (IAS) report.
 */
void get_quote_from_report
(
    const uint8_t* report /* in */,
    const int report_len  /* in */,
    sgx_quote_t* quote
);

/**
 * Extract an Intel SGX quote from a DER-encoded X.509 certificate.
 */
void get_quote_from_cert
(
    const uint8_t* der_crt,
    uint32_t der_crt_len,
    sgx_quote_t* q
);

/**
 * Verify SGX-related X.509 extensions.
 * @return 0 if verification succeeds, 1 otherwise.
 */
int verify_sgx_cert_extensions
(
    uint8_t* der_crt,
    uint32_t der_crt_len
);

/**
 * Pretty-print information of RA-TLS certificate to file descriptor.
 */
void dprintf_ratls_cert
(
    int fd,
    uint8_t* der_crt,
    uint32_t der_crt_len
);

#endif