You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@teaclave.apache.org by "ldshyu (via GitHub)" <gi...@apache.org> on 2025/11/17 03:32:35 UTC
[PR] examples: change for acipher-rs [teaclave-trustzone-sdk]
ldshyu opened a new pull request, #255:
URL: https://github.com/apache/teaclave-trustzone-sdk/pull/255
fix potential buffer overflow and match behavior with optee_examples
--
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: dev-unsubscribe@teaclave.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@teaclave.apache.org
For additional commands, e-mail: dev-help@teaclave.apache.org
Re: [PR] examples: change for acipher-rs [teaclave-trustzone-sdk]
Posted by "DemesneGH (via GitHub)" <gi...@apache.org>.
DemesneGH commented on code in PR #255:
URL: https://github.com/apache/teaclave-trustzone-sdk/pull/255#discussion_r2532611045
##########
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:
Err(ErrorKind::ShortBuffer.into())
--
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: dev-unsubscribe@teaclave.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@teaclave.apache.org
For additional commands, e-mail: dev-help@teaclave.apache.org
Re: [PR] examples: change for acipher-rs [teaclave-trustzone-sdk]
Posted by "ldshyu (via GitHub)" <gi...@apache.org>.
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: dev-unsubscribe@teaclave.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@teaclave.apache.org
For additional commands, e-mail: dev-help@teaclave.apache.org
Re: [PR] examples: change for acipher-rs [teaclave-trustzone-sdk]
Posted by "DemesneGH (via GitHub)" <gi...@apache.org>.
DemesneGH merged PR #255:
URL: https://github.com/apache/teaclave-trustzone-sdk/pull/255
--
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: dev-unsubscribe@teaclave.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@teaclave.apache.org
For additional commands, e-mail: dev-help@teaclave.apache.org
Re: [PR] examples: change for acipher-rs [teaclave-trustzone-sdk]
Posted by "DemesneGH (via GitHub)" <gi...@apache.org>.
DemesneGH commented on PR #255:
URL: https://github.com/apache/teaclave-trustzone-sdk/pull/255#issuecomment-3540108707
LGTM, will merge once the CI passes, thanks!
--
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: dev-unsubscribe@teaclave.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@teaclave.apache.org
For additional commands, e-mail: dev-help@teaclave.apache.org