All checks were successful
Latex Build / build-latex (Assignment 4 - Protokollsicherheit (Praxis)) (push) Successful in 1m4s
Latex Build / build-latex (Assignment 5 - Software Security - Teil 1) (push) Successful in 1m2s
Latex Build / build-latex (Assignment 6 - Software Security - Teil 2) (push) Successful in 59s
28 lines
No EOL
879 B
C
28 lines
No EOL
879 B
C
#include "Enclave.h"
|
|
#include "Enclave_t.h"
|
|
#include <sgx_error.h>
|
|
#include <sgx_tcrypto.h>
|
|
|
|
sgx_status_t public_key(uint8_t *gx, uint8_t *gy) {
|
|
// unseal key or from file system
|
|
}
|
|
|
|
sgx_status_t sign_firmware(uint8_t *data, size_t data_size, uint8_t *signature, size_t signature_size) {
|
|
sgx_ecc_state_handle_t ecc_handle;
|
|
sgx_ec256_private_t private;
|
|
sgx_ec256_public_t public;
|
|
|
|
sgx_status_t status;
|
|
if((status = sgx_ecc256_open_context(&ecc_handle)) != SGX_SUCCESS)
|
|
return status;
|
|
|
|
if((status = sgx_ecc256_create_key_pair(&private, &public, ecc_handle)) != SGX_SUCCESS)
|
|
return status;
|
|
|
|
sgx_ec256_signature_t ecc_signature;
|
|
if((status = sgx_ecdsa_sign(data, data_size, &private, &ecc_signature, ecc_handle)) != SGX_SUCCESS)
|
|
return status;
|
|
|
|
sgx_ecc256_close_context(ecc_handle);
|
|
return SGX_SUCCESS;
|
|
} |