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

rduan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-teaclave-sgx-sdk.git


The following commit(s) were added to refs/heads/master by this push:
     new e1fc80e  Fix bug: set the initflag after SgxAesHandle is initialized
     new 12e3ca2  Merge pull request #324 from volcano0dr/fix_aes
e1fc80e is described below

commit e1fc80e6645a523e431fa198b0c3efddb1b5517c
Author: volcano <[email protected]>
AuthorDate: Wed Mar 10 17:52:41 2021 +0800

    Fix bug: set the initflag after SgxAesHandle is initialized
---
 sgx_tcrypto/src/crypto.rs | 5 ++++-
 sgx_ucrypto/src/crypto.rs | 5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/sgx_tcrypto/src/crypto.rs b/sgx_tcrypto/src/crypto.rs
index 0f0e4db..e6673c7 100644
--- a/sgx_tcrypto/src/crypto.rs
+++ b/sgx_tcrypto/src/crypto.rs
@@ -3792,7 +3792,10 @@ impl SgxAesHandle {
         }
         let ret = rsgx_aes_gcm128_enc_init(key, iv, aad, 
self.handle.borrow_mut().deref_mut());
         match ret {
-            sgx_status_t::SGX_SUCCESS => Ok(()),
+            sgx_status_t::SGX_SUCCESS => {
+                self.initflag.set(true);
+                Ok(())
+            }
             _ => Err(ret),
         }
     }
diff --git a/sgx_ucrypto/src/crypto.rs b/sgx_ucrypto/src/crypto.rs
index 7413dc4..c1b2d62 100644
--- a/sgx_ucrypto/src/crypto.rs
+++ b/sgx_ucrypto/src/crypto.rs
@@ -3575,7 +3575,10 @@ impl SgxAesHandle {
         }
         let ret = rsgx_aes_gcm128_enc_init(key, iv, aad, 
self.handle.borrow_mut().deref_mut());
         match ret {
-            sgx_status_t::SGX_SUCCESS => Ok(()),
+            sgx_status_t::SGX_SUCCESS => {
+                self.initflag.set(true);
+                Ok(())
+            }
             _ => Err(ret),
         }
     }


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

Reply via email to