You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix StatefulSignature segfault when liboqs lacks STFL keygen support (#144)
Closes#121.
liboqs typedefs OQS_SIG_STFL to OQS_SIG when built without
OQS_HAZARDOUS_EXPERIMENTAL_ENABLE_SIG_STFL_KEY_SIG_GEN, so
OQS_SIG_STFL_new() returns a struct with an incompatible layout.
StatefulSignature.__init__ then segfaulted reading alg_version as a
c_char_p over non-pointer data.
Detect the build mode before touching the struct: prefer the upstream
OQS_SIG_STFL_keygen_and_sign_supported() API (open-quantum-safe/liboqs#2434);
fall back to a struct-layout probe (safe c_char_p read at offset 8) for
older liboqs. Also add keypair_cb/sign_cb NULL guards in generate_keypair
and sign as defense in depth, and document the build-flag requirement in
the README.
Signed-off-by: Douglas Stebila <dstebila@uwaterloo.ca>
0 commit comments