This is an automated email from the ASF dual-hosted git repository.

ivila pushed a commit to branch main
in repository 
https://gitbox.apache.org/repos/asf/incubator-teaclave-trustzone-sdk.git


The following commit(s) were added to refs/heads/main by this push:
     new dda34ae  Expose login field from raw::TEEC_OpenSession
dda34ae is described below

commit dda34ae99bbb8e337dadcddb55575d4db8c431bd
Author: Fredrik Simonsson <[email protected]>
AuthorDate: Wed May 28 14:44:17 2025 +0200

    Expose login field from raw::TEEC_OpenSession
    
    Signed-off-by: Fredrik Simonsson <[email protected]>
---
 optee-teec/src/context.rs | 18 ++++++++++++++++--
 optee-teec/src/session.rs |  3 ++-
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/optee-teec/src/context.rs b/optee-teec/src/context.rs
index 6480bda..bf17616 100644
--- a/optee-teec/src/context.rs
+++ b/optee-teec/src/context.rs
@@ -15,7 +15,7 @@
 // specific language governing permissions and limitations
 // under the License.
 
-use crate::{raw, Error, Operation, Param, ParamNone, Result, Session, Uuid};
+use crate::{raw, ConnectionMethods, Error, Operation, Param, ParamNone, 
Result, Session, Uuid};
 use std::{cell::RefCell, ptr, rc::Rc};
 
 pub struct InnerContext(pub raw::TEEC_Context);
@@ -90,6 +90,20 @@ impl Context {
         Session::new(
             self,
             uuid,
+            ConnectionMethods::LoginPublic,
+            None::<&mut Operation<ParamNone, ParamNone, ParamNone, ParamNone>>,
+        )
+    }
+
+    pub fn open_session_with_login(
+        &mut self,
+        uuid: Uuid,
+        login: ConnectionMethods,
+    ) -> Result<Session> {
+        Session::new(
+            self,
+            uuid,
+            login,
             None::<&mut Operation<ParamNone, ParamNone, ParamNone, ParamNone>>,
         )
     }
@@ -121,7 +135,7 @@ impl Context {
         uuid: Uuid,
         operation: &mut Operation<A, B, C, D>,
     ) -> Result<Session> {
-        Session::new(self, uuid, Some(operation))
+        Session::new(self, uuid, ConnectionMethods::LoginPublic, 
Some(operation))
     }
 }
 
diff --git a/optee-teec/src/session.rs b/optee-teec/src/session.rs
index 98bab42..04f7525 100644
--- a/optee-teec/src/session.rs
+++ b/optee-teec/src/session.rs
@@ -56,6 +56,7 @@ impl Session {
     pub fn new<A: Param, B: Param, C: Param, D: Param>(
         context: &mut Context,
         uuid: Uuid,
+        login: ConnectionMethods,
         operation: Option<&mut Operation<A, B, C, D>>,
     ) -> Result<Self> {
         // SAFETY:
@@ -78,7 +79,7 @@ impl Session {
                 raw_ctx,
                 &mut raw_session,
                 raw_uuid,
-                ConnectionMethods::LoginPublic as u32,
+                login as u32,
                 ptr::null(),
                 raw_operation,
                 &mut err_origin,


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to