From cd9cdeba5fc17c546a581d3b9ebae27a5d22f191 Mon Sep 17 00:00:00 2001 From: Andrew Hutchings Date: Mon, 11 May 2026 12:29:15 +0100 Subject: [PATCH] Fix wc_ecc_import_unsigned cdef to match wolfSSL header scripts/build_ffi.py declared qx, qy, and d as `byte*` while the wolfSSL header (ecc.h) declares all three as `const byte*`. wolfSSL is const-correct here and does not mutate the inputs, so there is no observable bug today, but the non-const cdef let CFFI hand a writable pointer into Python bytes storage on EccPublic.decode_key_raw and EccPrivate.decode_key_raw calls. Update the cdef to match the header. F-3087 --- scripts/build_ffi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/build_ffi.py b/scripts/build_ffi.py index a6ab7a5..c647233 100644 --- a/scripts/build_ffi.py +++ b/scripts/build_ffi.py @@ -1092,8 +1092,8 @@ def build_ffi(local_wolfssl, features): int wc_ecc_import_x963(const byte* in, word32 inLen, ecc_key* key); int wc_ecc_export_private_raw(ecc_key* key, byte* qx, word32* qxLen, byte* qy, word32* qyLen, byte* d, word32* dLen); - int wc_ecc_import_unsigned(ecc_key* key, byte* qx, byte* qy, - byte* d, int curve_id); + int wc_ecc_import_unsigned(ecc_key* key, const byte* qx, const byte* qy, + const byte* d, int curve_id); int wc_ecc_export_public_raw(ecc_key* key, byte* qx, word32* qxLen, byte* qy, word32* qyLen);