Fix for AES-CFB1 encrypt/decrypt on size (8*x-1) bits#7431
Fix for AES-CFB1 encrypt/decrypt on size (8*x-1) bits#7431JacobBarthelmeh merged 1 commit intowolfSSL:masterfrom
Conversation
|
Great find @lealem47! Adding @SparkiDev for visibility. |
All credit to @JacobBarthelmeh |
|
Retest this please |
JacobBarthelmeh
left a comment
There was a problem hiding this comment.
Thanks for adding in the test cases!
There was a problem hiding this comment.
Reviewing this more, I don't think there is a case here where 'sz' does not equal 0 once it hits this check? Having broken out of the while loop (sz > 0) and 'ret' is 0. Think the bounds check on 'bit' might just need to be inclusive with 0 if ((bit >= 0 && bit < 7)) { . Cases where 'bit' is 7 then out[0] is updated in the while loop and all other cases out[0] should be updated with the last value of cur after exiting the while loop.
There was a problem hiding this comment.
Just check bit < 7.
7 indicates no bits encrypted and not outputted.
There was a problem hiding this comment.
Just check bit < 7.
7 indicates no bits encrypted and not outputted.
|
Retest this please |
Description
Prior to this commit, AES-CFB1 encrypt/decrypts of size (8*x-1) bits would leave the last 7 bits of the input the same as the output
Testing
SRTP-KDF harness
Checklist