|
3 | 3 | * wolfCrypt configuration for RSA (PKCS#1 v1.5 and PSS) signature |
4 | 4 | * verification. |
5 | 5 | * |
6 | | - * Active when any WOLFBOOT_SIGN_RSA{2048,3072,4096} (or RSAPSS, or |
7 | | - * SECONDARY) is defined, or when WOLFCRYPT_SECURE_MODE && !PKCS11_SMALL. |
| 6 | + * Active when WOLFBOOT_RSA_ENABLED is set by cascade.h (any RSA SIGN |
| 7 | + * flag, or WOLFCRYPT_SECURE_MODE && !PKCS11_SMALL). |
8 | 8 | * |
9 | 9 | * The companion `NO_RSA` fallback (when RSA isn't enabled) is also in |
10 | 10 | * this file, in the #else branch -- so the fragment is included |
|
32 | 32 | #ifndef _WOLFBOOT_USER_SETTINGS_SIGN_RSA_H_ |
33 | 33 | #define _WOLFBOOT_USER_SETTINGS_SIGN_RSA_H_ |
34 | 34 |
|
35 | | -/* This fragment is included unconditionally by user_settings.h: the trigger |
36 | | - * condition is here in the outer #if, and the #else branch defines NO_RSA |
37 | | - * so downstream blocks that test `#if defined(NO_RSA)` (e.g. the NO_ASN |
38 | | - * carve-out) keep seeing the same value. */ |
| 35 | +/* This fragment is included unconditionally by user_settings.h. The opt-in |
| 36 | + * condition lives in cascade.h as WOLFBOOT_RSA_ENABLED (single source of |
| 37 | + * truth shared with the WOLFBOOT_NEEDS_RSA marker). The #else branch |
| 38 | + * defines NO_RSA so downstream blocks that test `#if defined(NO_RSA)` |
| 39 | + * (e.g. the hash_sha*.h NO_ASN carve-outs) keep seeing the same value. */ |
39 | 40 |
|
40 | | -#if defined(WOLFBOOT_SIGN_RSA2048) || \ |
41 | | - defined(WOLFBOOT_SIGN_RSA3072) || \ |
42 | | - defined(WOLFBOOT_SIGN_RSA4096) || \ |
43 | | - defined(WOLFBOOT_SIGN_SECONDARY_RSA2048) || \ |
44 | | - defined(WOLFBOOT_SIGN_SECONDARY_RSA3072) || \ |
45 | | - defined(WOLFBOOT_SIGN_SECONDARY_RSA4096) || \ |
46 | | - defined(WOLFBOOT_SIGN_RSAPSS2048) || \ |
47 | | - defined(WOLFBOOT_SIGN_RSAPSS3072) || \ |
48 | | - defined(WOLFBOOT_SIGN_RSAPSS4096) || \ |
49 | | - defined(WOLFBOOT_SIGN_SECONDARY_RSAPSS2048) || \ |
50 | | - defined(WOLFBOOT_SIGN_SECONDARY_RSAPSS3072) || \ |
51 | | - defined(WOLFBOOT_SIGN_SECONDARY_RSAPSS4096) || \ |
52 | | - (defined(WOLFCRYPT_SECURE_MODE) && !defined(PKCS11_SMALL)) |
| 41 | +#ifdef WOLFBOOT_RSA_ENABLED |
53 | 42 |
|
54 | 43 | #define WC_RSA_BLINDING |
55 | 44 | #define WC_RSA_DIRECT |
|
132 | 121 | # define RSA_MAX_SIZE 4096 |
133 | 122 | #endif |
134 | 123 |
|
135 | | -#else /* No RSA SIGN flag, no SECURE_MODE without PKCS11_SMALL */ |
| 124 | +#else /* !WOLFBOOT_RSA_ENABLED */ |
136 | 125 | # define NO_RSA |
137 | 126 | #endif |
138 | 127 |
|
|
0 commit comments