You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@teaclave.apache.org by GitBox <gi...@apache.org> on 2021/06/24 01:21:50 UTC

[GitHub] [incubator-teaclave] ya0guang opened a new pull request #512: Add support for Teaclave protected files in WAMR executor and related teat

ya0guang opened a new pull request #512:
URL: https://github.com/apache/incubator-teaclave/pull/512


   ## Description
   
   Add support for Teaclave protected files in WAMR executor.
   A series of APIs in C for WAMR with documents is put into `teaclave_pf.h`
   Update the test for WAMR executor to an implementation of Yao's Millionaires' problem.
   
   Fixes # (issue)
   
   ## Type of change (select or add applied and delete the others)
   
   - [ ] Bug fix (non-breaking change which fixes an issue)
   - [X] New feature (non-breaking change which adds functionality)
   - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
   - [X] API change with a documentation update
   - [X] Additional test coverage
   - [ ] Code cleanup or just sync with upstream third-party crates
   
   ## How has this been tested?
   
   ## Checklist
   
   - [X] Fork the repo and create your branch from `master`.
   - [X] If you've added code that should be tested, add tests.
   - [ ] If you've changed APIs, update the documentation.
   - [ ] Ensure the tests pass (see CI results).
   - [ ] Make sure your code lints/format.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org
For additional commands, e-mail: notifications-help@teaclave.apache.org


[GitHub] [incubator-teaclave] mssun commented on a change in pull request #512: Add support for Teaclave protected files in WAMR executor and related teat

Posted by GitBox <gi...@apache.org>.
mssun commented on a change in pull request #512:
URL: https://github.com/apache/incubator-teaclave/pull/512#discussion_r658317822



##########
File path: examples/python/wasm_teaclave_pf_payload/teaclave_pf.h
##########
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+/**
+ * Open a protected file as input
+ * 
+ * @param fid the uid of the file, c string pointer
+ * 
+ * @return file handler, -1 if error occurs
+ */
+int teaclave_open_input(char *file_id);
+
+/**
+ * Create/Open? a protected file as output
+ * 
+ * @param fid the uid of the file, c string pointer
+ * 
+ * @return file handler, -1 if error occurs
+ */
+int teaclave_create_output(char *file_id);
+
+/**
+ * Read content from a file to a buffer
+ * 
+ * @param fd file handler returned by `teaclave_open_input`
+ * @param out_buf the pointer to output buffer
+ * @param buf_size the total size in bytes of the output buffer
+ * 
+ * @return bytes read from the file, -1 if error occurs
+ */
+int teaclave_read_file(int fd, void *out_buf, int buf_size);
+
+/**
+ * Write content from a buffer to a file
+ * 
+ * @param fd file handler returned by `teaclave_create_output`
+ * @param buf the pointer to the buffer holding content to write
+ * @param buf_size the total size in bytes to read from the buffer and write to the file
+ * 
+ * @return bytes written to the file, -1 if error occurs
+ */
+int teaclave_write_file(int fd, void *buf, int buf_size);
+
+/**
+ * Close a file handler
+ * 
+ * @param fd file handler to close
+ * 
+ * @return 0 if succeed, -1 otherwise
+ */
+int teaclave_close_file(int fd);

Review comment:
       Please put a new line here.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org
For additional commands, e-mail: notifications-help@teaclave.apache.org


[GitHub] [incubator-teaclave] mssun merged pull request #512: Add support for Teaclave protected files in WAMR executor and related tests

Posted by GitBox <gi...@apache.org>.
mssun merged pull request #512:
URL: https://github.com/apache/incubator-teaclave/pull/512


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org
For additional commands, e-mail: notifications-help@teaclave.apache.org


[GitHub] [incubator-teaclave] mssun merged pull request #512: Add support for Teaclave protected files in WAMR executor and related tests

Posted by GitBox <gi...@apache.org>.
mssun merged pull request #512:
URL: https://github.com/apache/incubator-teaclave/pull/512


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org
For additional commands, e-mail: notifications-help@teaclave.apache.org