DecryptorWrapper.cpp 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #include <stdint.h>
  2. #include "Decryptor.h"
  3. #include "Decryptor_t.h"
  4. /*void initialize()
  5. {
  6. ECDSASignatureBox Decryptor::signatureBox();
  7. HybridEncryptionBox Decryptor::hybridEncryptionBoxClient();
  8. SymmetricEncryptionBox Decryptor::symmetricEncryptionBoxApache();
  9. SymmetricEncryptionBox Decryptor::symmetricEncryptionBoxVerifier();
  10. uint8_t Decryptor::verifier_mr_enclave = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  11. uint8_t Decryptor::apache_mr_signer = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  12. }
  13. */
  14. uint32_t process_apache_message_generate_response_wrapper(uint8_t* input_ciphertext, uint32_t input_ciphertext_plus_tag_length, uint8_t* output_ciphertext, uint32_t* output_ciphertext_plus_tag_length)
  15. {
  16. return Decryptor::process_apache_message_generate_response(input_ciphertext, input_ciphertext_plus_tag_length, output_ciphertext, output_ciphertext_plus_tag_length);
  17. }
  18. uint32_t decrypt_verifiers_message_set_apache_mrsigner_wrapper(uint8_t* ciphertext_plus_tag)
  19. {
  20. return Decryptor::decrypt_verifiers_message_set_apache_mrsigner(ciphertext_plus_tag);
  21. }
  22. uint32_t unseal_and_restore_long_term_signing_key_pair_wrapper(uint8_t* sealed_data, uint32_t* sgx_sealed_data_length)
  23. {
  24. return Decryptor::unseal_and_restore_long_term_signing_key_pair(sealed_data, sgx_sealed_data_length);
  25. }
  26. void calculate_sealed_keypair_size_wrapper(uint32_t* length)
  27. {
  28. Decryptor::calculate_sealed_keypair_size(length);
  29. }
  30. uint32_t create_and_encrypt_mitigator_header_H_wrapper(uint8_t* ciphertext_token_H_plus_tag)
  31. {
  32. return Decryptor::create_and_encrypt_mitigator_header_H(ciphertext_token_H_plus_tag);
  33. }
  34. uint32_t create_and_seal_long_term_signing_key_pair_wrapper(uint32_t* sealed_data_length, uint8_t* sealed_data)
  35. {
  36. /* uint32_t counter;
  37. for(counter=0; counter< 0x290; counter++)
  38. sealed_data[counter]=counter;
  39. return 0;
  40. */
  41. /*
  42. uint8_t* temp_sealed_data = (uint8_t*) malloc(0x300);
  43. uint32_t temp_sealed_data_length;
  44. */ return Decryptor::create_and_seal_long_term_signing_key_pair(sealed_data_length, sealed_data);
  45. /* uint32_t counter;
  46. for(counter=0; counter<temp_sealed_data_length; counter++)
  47. sealed_data[counter] = temp_sealed_data[counter];
  48. *sealed_data_length = temp_sealed_data_length;
  49. return ret_status;
  50. */
  51. }