ldshyu commented on code in PR #255:
URL: 
https://github.com/apache/teaclave-trustzone-sdk/pull/255#discussion_r2532801742


##########
examples/acipher-rs/ta/src/main.rs:
##########
@@ -97,8 +97,13 @@ fn encrypt(rsa: &mut RsaCipher, params: &mut Parameters) -> 
Result<()> {
             match cipher.encrypt(&[], plain_text) {
                 Err(e) => Err(e),
                 Ok(cipher_text) => {
-                    p1.buffer().clone_from_slice(&cipher_text);
-                    Ok(())
+                    if cipher_text.len() > p1.buffer().len() {
+                        p1.set_updated_size(cipher_text.len());
+                        Err(optee_utee::Error::new(ErrorKind::ShortBuffer))

Review Comment:
   Thanks for reviewing.  I have updated the change accordingly.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to