Fix AES ECB mode in Data processor - #1986
Conversation
| } | ||
|
|
||
| void process() override { | ||
| const auto &mode = static_cast<crypt::AESMode>(m_mode); |
There was a problem hiding this comment.
I don't think this should be a reference. (How does that even compile??)
There was a problem hiding this comment.
I think i was just like 'make everything const reference' but i think this works because it converts the lvalue to a rvalue to that lvalue, since its just a static cast to that lvalue. might also be UB
There was a problem hiding this comment.
Yeah I believe static_cast will return a prvalue which will expire right after that line finishes so you have a dangling reference there. It compiles because rvalues can bind to const lvalue references but assignments like this don't cause lifetime extensions so it's still a bug
|
|
||
| // if we are in ECB mode, we don't need to set the nonce | ||
| if (mode != MBEDTLS_MODE_ECB) { | ||
| std::ranges::copy(nonce, nonceCounter.begin()); |
There was a problem hiding this comment.
Where does the name nonceCounter come from? I feel like it should be called IV or something instead
There was a problem hiding this comment.
nonceCounter was originally named by you, as shown by the blame, i didn't want to change the naming as i thought it was correctly named by you. I will address it.
Fix the AES ECB mode in the data processor along with some other misc fixes: