Skip to content

Commit

Permalink
tless: add demo functions
Browse files Browse the repository at this point in the history
  • Loading branch information
csegarragonz committed Oct 18, 2024
1 parent 6589bbc commit e281d8f
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions func/demo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ demo_func(string string.cpp)
demo_func(sysconf sysconf.cpp)
demo_func(time time.cpp)
demo_func(time_of_day time_of_day.cpp)
demo_func(tless tless.cpp)
demo_func(uname uname.cpp)
demo_func(va_arg va_arg.cpp)
demo_func(waitpid waitpid.cpp)
Expand Down
22 changes: 22 additions & 0 deletions func/demo/tless.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#include <cstdint>
#include <iostream>
#include <string>

extern "C" {
void __tless_get_attestation_jwt(char** jwtPtrPtr, int32_t* jwtPtrSize);
}

int main()
{
char* jwt;
int32_t jwtSize;

// JWT is heap-allocated
__tless_get_attestation_jwt(&jwt, &jwtSize);

std::string jwtStr(jwt);

std::cout << "JWT: " << jwtStr << std::endl;

return 0;
}
3 changes: 3 additions & 0 deletions libfaasm/libfaasm.imports
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,6 @@ __faasm_s3_get_key_bytes

# Test
__faasm_host_interface_test

# TLess TODO consider!
__tless_get_attestation_jwt

0 comments on commit e281d8f

Please sign in to comment.