Technically an API break

Brian Smith brian at briansmith.org
Thu May 7 15:02:38 UTC 2020


Matt Caswell <matt at openssl.org> wrote:

> PR11589 makes a change to the public API function
> `SSL_set_record_padding_callback` to change its return type from void to
> int:
>
> https://github.com/openssl/openssl/pull/11589
>
> This is technically an API break - but it doesn't seem too serious. It's
> possible, I suppose, that existing applications that use this will fail
> to spot the error return since this function can now fail. The function
> itself was only recently added (in 1.1.1), and I suspect real-world
> usage is very small (or possibly nil).
>
> Is this considered ok?
>

This kind of change might cause memory unsafety issues unless the
application is recompiled. At least, it's worth investigating that.

On most platforms the ABI of a function that returns `void` and one that
returns `int` is the same, from the perspective of a caller that doesn't
expect or use the return value. I seem to vaguely remember in the past that
there was at least one common platform where that isn't true though.
Unfortunately I cannot remember which one it is. I also don't remember if
it is problematic to change from "int" to "void" or "void" to "int" or both.

Anyway, my point is that you should consider this an ABI-breaking change,
not just an API breaking one.

Cheers,
Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mta.openssl.org/pipermail/openssl-project/attachments/20200507/96f003ef/attachment.html>


More information about the openssl-project mailing list