|
15 | 15 | // specific language governing permissions and limitations |
16 | 16 | // under the License. |
17 | 17 |
|
18 | | -use optee_teec::{ |
19 | | - Context, ErrorKind, Operation, ParamNone, ParamTmpRef, ParamType, ParamValue, Uuid, |
20 | | -}; |
| 18 | +use optee_teec::{Context, ErrorKind, Operation, ParamNone, ParamTmpRef, Uuid}; |
21 | 19 |
|
22 | 20 | type Result<T> = optee_teec::Result<T>; |
23 | 21 |
|
@@ -53,24 +51,23 @@ impl EnclaveClient { |
53 | 51 |
|
54 | 52 | pub fn invoke(&mut self, input: &proto::EnclaveInput) -> Result<proto::EnclaveOutput> { |
55 | 53 | let command_id = input.command as u32; |
56 | | - let mut serialized_input = proto::serde_json::to_vec(input).map_err(|e| { |
| 54 | + let mut serialized_input = serde_json::to_vec(input).map_err(|e| { |
57 | 55 | eprintln!("Failed to serialize input: {}", e); |
58 | 56 | ErrorKind::BadParameters |
59 | 57 | })?; |
60 | 58 |
|
61 | 59 | let p0 = ParamTmpRef::new_input(serialized_input.as_mut_slice()); |
62 | 60 | let p1 = ParamTmpRef::new_output(&mut self.buffer); |
63 | | - let p2 = ParamValue::new(0, 0, ParamType::ValueInout); |
64 | 61 |
|
65 | | - let mut operation = Operation::new(0, p0, p1, p2, ParamNone); |
| 62 | + let mut operation = Operation::new(0, p0, p1, ParamNone, ParamNone); |
66 | 63 |
|
67 | 64 | let uuid = Uuid::parse_str(&self.uuid)?; |
68 | 65 | let mut session = self.context.open_session(uuid)?; |
69 | 66 | session.invoke_command(command_id, &mut operation)?; |
70 | | - let len = operation.parameters().2.a() as usize; |
| 67 | + let len = operation.parameters().1.updated_size(); |
71 | 68 |
|
72 | | - let output: proto::EnclaveOutput = proto::serde_json::from_slice(&self.buffer[0..len]) |
73 | | - .map_err(|e| { |
| 69 | + let output: proto::EnclaveOutput = |
| 70 | + serde_json::from_slice(&self.buffer[0..len]).map_err(|e| { |
74 | 71 | eprintln!("Failed to deserialize output: {}", e); |
75 | 72 | ErrorKind::BadParameters |
76 | 73 | })?; |
|
0 commit comments