<div dir="ltr">Dear Matt,<br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 18, 2016 at 6:00 PM, Matt Caswell <span dir="ltr"><<a href="mailto:matt@openssl.org" target="_blank">matt@openssl.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
<br>
On 18/04/16 15:55, Dmitry Belyavsky wrote:<br>
> Hello,<br>
><br>
> Could anybody explain how to deal with the output length in the<br>
> EVP_EncryptUpdate?<br>
><br>
> The function EVP_EncryptUpdate has the outl output parameter, which is<br>
> designed for returning the length of the resulting ciphertext. Then<br>
> internally it calls the do_cipher callback which does not take such a<br>
> parameter.<br>
><br>
> Is there a way to return an expected buffer length from the callback?<br>
> It may be necessary when we call the EVP_EncryptUpdate some times, and<br>
> we get the case when ctx->buf from the previous calls has enough bytes<br>
> to be processed together with the input buffer so the output is longer<br>
> then the input.<br>
<br>
</span>The man page advises that the size of the output buffer should be:<br>
<br>
inl + cipher_block_size - 1<br>
<br>
This should cater for all eventualities.<br></blockquote><div><br></div><div>Thank you!<br><br></div></div>-- <br><div class="gmail_signature">SY, Dmitry Belyavsky</div>
</div></div>