Reduce minimal out length in CRYPTO_128_unwrap_pad#6266
Reduce minimal out length in CRYPTO_128_unwrap_pad#6266yhwang wants to merge 1 commit intoopenssl:masterfrom
Conversation
crypto/modes/wrap128.c
Outdated
There was a problem hiding this comment.
It's not like you're obliged to perform block operation in place, you can simply block(in, buff, key) and skip memcpy. And in case of allocation of intermediate buffer for protected secret value, it's only appropriate to wipe it with OPENSSL_cleanse. Even if it's on stack.
Styling nit. It's considered appropriate to add an empty line after declarations, in this case after buff declaration.
There was a problem hiding this comment.
@dot-asm thanks for your review. just back from vacation and updated my change per your comments.
In `aes_wrap_cipher()`, the minimal out buff length is `(inlen - 8)`. Since it calls `CRYPTO_128_unwrap_pad()` underneath, it makes sense to reduce the minimal out length in `CRYPTO_128_unwrap_pad()` to align to its caller. Signed-off-by: Yihong Wang <[email protected]>
1db1bd9 to
c1cfe38
Compare
|
Close/open to kick the CLA bot. |
|
There is no 2nd approval tick. I suppose you, Rich, meant to approve, but it's shouldn't be mind-reading exercise. You have to click on "approve", just replacing label doesn't formally count. |
|
oops, closed window before clicking 'send review' |
In `aes_wrap_cipher()`, the minimal out buff length is `(inlen - 8)`. Since it calls `CRYPTO_128_unwrap_pad()` underneath, it makes sense to reduce the minimal out length in `CRYPTO_128_unwrap_pad()` to align to its caller. Signed-off-by: Yihong Wang <[email protected]> Reviewed-by: Andy Polyakov <[email protected]> Reviewed-by: Rich Salz <[email protected]> (Merged from #6266)
|
Merged. Thanks! |
In
aes_wrap_cipher(), the minimal out buff length is(inlen - 8).Since it calls
CRYPTO_128_unwrap_pad()underneath, it makes sense toreduce the minimal out length in
CRYPTO_128_unwrap_pad()to align toits caller.
Signed-off-by: Yihong Wang [email protected]
Checklist