SSL_get_finished determine length

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

SSL_get_finished determine length

Samuel Williams
Is it valid to call:

size_t size = SSL_get_finished(ssl, NULL, 0);

So we can determine the length?

Because SSL_get_finished invokes memcpy even if the size is 0, so is the undefined behaviour?

Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: SSL_get_finished determine length

Marian Beermann
> Is it valid to call:
>
> size_t size = SSL_get_finished(ssl, NULL, 0);

No

> Because SSL_get_finished invokes memcpy even if the size is 0, so is the
> undefined behaviour?

Yes
Reply | Threaded
Open this post in threaded view
|

Re: SSL_get_finished determine length

Samuel Williams
So what is the valid way to do it? Invoke it with a 1 byte array? Maybe an example should be added to the manual page?

On Thu, 6 Feb 2020 at 23:18, Marian Beermann <[hidden email]> wrote:
> Is it valid to call:
>
> size_t size = SSL_get_finished(ssl, NULL, 0);

No

> Because SSL_get_finished invokes memcpy even if the size is 0, so is the
> undefined behaviour?

Yes