Commit a50c3c2
[noup] crypto: Guard EC point ops when ECP curves are disabled
TF-PSA-Crypto only defines MBEDTLS_ECP_SHORT_WEIERSTRASS_ENABLED and
exposes mbedtls_ecp_muladd() when at least one Weierstrass or Montgomery
curve is enabled via MBEDTLS_ECP_DP_*_ENABLED. WPA3/SAE enables
CRYPTO_MBEDTLS_CRYPTO_EC without always selecting PSA_WANT_ECC_SECP_*,
so azure_iot_hub-style builds (WIFI_NM_WPA_SUPPLICANT_WPA3,
MBEDTLS_DECLARE_PRIVATE_IDENTIFIERS, PSA_WANT_ALG_ECDH/ECDSA only) can
compile crypto_ec_point_from_bin() and crypto_ec_point_add() with no
matching curve support and trigger -Wunused-variable and implicit
declaration errors.
Wrap the helpers in the same MBEDTLS_ECP_*_ENABLED guards used in
private/ecp.h and return failure when the builtins are not available.
Assisted-by: Cursor: Auto
Co-authored-by: Cursor <cursoragent@cursor.com>1 parent c2d85cb commit a50c3c2
1 file changed
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2303 | 2303 | | |
2304 | 2304 | | |
2305 | 2305 | | |
| 2306 | + | |
| 2307 | + | |
| 2308 | + | |
2306 | 2309 | | |
2307 | 2310 | | |
2308 | 2311 | | |
| 2312 | + | |
2309 | 2313 | | |
2310 | 2314 | | |
2311 | 2315 | | |
| |||
2336 | 2340 | | |
2337 | 2341 | | |
2338 | 2342 | | |
| 2343 | + | |
2339 | 2344 | | |
2340 | 2345 | | |
2341 | 2346 | | |
| |||
2346 | 2351 | | |
2347 | 2352 | | |
2348 | 2353 | | |
| 2354 | + | |
| 2355 | + | |
| 2356 | + | |
2349 | 2357 | | |
2350 | 2358 | | |
2351 | 2359 | | |
| |||
2354 | 2362 | | |
2355 | 2363 | | |
2356 | 2364 | | |
| 2365 | + | |
2357 | 2366 | | |
2358 | 2367 | | |
| 2368 | + | |
2359 | 2369 | | |
2360 | 2370 | | |
2361 | 2371 | | |
| |||
0 commit comments