open-quantum-safe / liboqs

C library for prototyping and experimenting with quantum-resistant cryptography
https://openquantumsafe.org/
Other
1.68k stars 414 forks source link

Forward-declare OQS_SIG in sig_stfl.h #1820

Closed SWilson4 closed 3 weeks ago

SWilson4 commented 3 weeks ago

When an application (e.g., oqs-provider) includes <oqs/sig.h>, the following happens:

This breaks the application's build: see https://github.com/open-quantum-safe/liboqs/issues/1815, https://github.com/open-quantum-safe/oqs-provider/issues/427, and https://github.com/open-quantum-safe/oqs-demos/issues/281.

This PR resolves the issue by forward-declaring the OQS_SIG type in sig_stfl.h. This fixes the failing oqs-provider build: see the downstream tests before and after.

I don't believe that the forward-declaration violates any C programming rules / best practices, but it would be great if someone with more experience could confirm this.

ashman-p commented 3 weeks ago

@SWilson4 Thanks for looking at this and resolving it. I did also find that an alternative resolution but i prefer this fix.