@@ -112,16 +112,16 @@ extern "C" {
112112
113113#ifndef IMAGE_HEADER_SIZE
114114/* Largest cases first */
115- # if defined(WOLFBOOT_SIGN_RSA4096 )
115+ # if defined(WOLFBOOT_SIGN_RSA4096 ) || defined( WOLFBOOT_SIGN_RSAPSS4096 )
116116# define IMAGE_HEADER_SIZE 1024
117117
118- /* RSA3072 + strong hash */
119- # elif (defined(WOLFBOOT_SIGN_RSA3072 ) && \
118+ /* RSA3072/RSAPSS3072 + strong hash */
119+ # elif (( defined(WOLFBOOT_SIGN_RSA3072 ) || defined( WOLFBOOT_SIGN_RSAPSS3072 ) ) && \
120120 (defined(WOLFBOOT_HASH_SHA384 ) || defined(WOLFBOOT_HASH_SHA3_384 )))
121121# define IMAGE_HEADER_SIZE 1024
122122
123- /* RSA2048 + SHA256 */
124- # elif defined(WOLFBOOT_SIGN_RSA2048 ) && defined(WOLFBOOT_HASH_SHA256 )
123+ /* RSA2048/RSAPSS2048 + SHA256 */
124+ # elif ( defined(WOLFBOOT_SIGN_RSA2048 ) || defined( WOLFBOOT_SIGN_RSAPSS2048 ) ) && defined(WOLFBOOT_HASH_SHA256 )
125125# define IMAGE_HEADER_SIZE 512
126126
127127 /* ECC384 requires 512 with SHA256 */
@@ -141,7 +141,7 @@ extern "C" {
141141# define IMAGE_HEADER_SIZE 256
142142
143143 /* Secondary 512-byte fallbacks */
144- # elif defined(WOLFBOOT_SIGN_RSA3072 ) || \
144+ # elif defined(WOLFBOOT_SIGN_RSA3072 ) || defined( WOLFBOOT_SIGN_RSAPSS3072 ) || \
145145 defined(WOLFBOOT_SIGN_ECC521 ) || \
146146 defined(WOLFBOOT_SIGN_ED448 ) || \
147147 defined(WOLFBOOT_HASH_SHA384 ) || \
@@ -224,7 +224,10 @@ extern "C" {
224224#define AUTH_KEY_ECC521 0x07
225225#define AUTH_KEY_RSA3072 0x08
226226#define AUTH_KEY_LMS 0x09
227- /* 0x0A...0x0F reserved */
227+ #define AUTH_KEY_RSAPSS2048 0x0A
228+ #define AUTH_KEY_RSAPSS3072 0x0B
229+ #define AUTH_KEY_RSAPSS4096 0x0C
230+ /* 0x0D...0x0F reserved */
228231#define AUTH_KEY_XMSS 0x10
229232#define AUTH_KEY_ML_DSA 0x11
230233
@@ -245,6 +248,9 @@ extern "C" {
245248#define HDR_IMG_TYPE_AUTH_ECC521 (AUTH_KEY_ECC521 << 8)
246249#define HDR_IMG_TYPE_AUTH_RSA3072 (AUTH_KEY_RSA3072 << 8)
247250#define HDR_IMG_TYPE_AUTH_LMS (AUTH_KEY_LMS << 8)
251+ #define HDR_IMG_TYPE_AUTH_RSAPSS2048 (AUTH_KEY_RSAPSS2048 << 8)
252+ #define HDR_IMG_TYPE_AUTH_RSAPSS3072 (AUTH_KEY_RSAPSS3072 << 8)
253+ #define HDR_IMG_TYPE_AUTH_RSAPSS4096 (AUTH_KEY_RSAPSS4096 << 8)
248254#define HDR_IMG_TYPE_AUTH_XMSS (AUTH_KEY_XMSS << 8)
249255#define HDR_IMG_TYPE_AUTH_ML_DSA (AUTH_KEY_ML_DSA << 8)
250256
@@ -265,6 +271,9 @@ extern "C" {
265271#define KEYSTORE_PUBKEY_SIZE_RSA2048 320
266272#define KEYSTORE_PUBKEY_SIZE_RSA3072 448
267273#define KEYSTORE_PUBKEY_SIZE_RSA4096 576
274+ #define KEYSTORE_PUBKEY_SIZE_RSAPSS2048 KEYSTORE_PUBKEY_SIZE_RSA2048
275+ #define KEYSTORE_PUBKEY_SIZE_RSAPSS3072 KEYSTORE_PUBKEY_SIZE_RSA3072
276+ #define KEYSTORE_PUBKEY_SIZE_RSAPSS4096 KEYSTORE_PUBKEY_SIZE_RSA4096
268277#define KEYSTORE_PUBKEY_SIZE_LMS 60
269278#define KEYSTORE_PUBKEY_SIZE_XMSS 68
270279
@@ -439,6 +448,21 @@ extern "C" {
439448 # ifndef WOLFBOOT_UNIVERSAL_KEYSTORE
440449 # define KEYSTORE_PUBKEY_SIZE KEYSTORE_PUBKEY_SIZE_RSA4096
441450 # endif
451+ #elif defined(WOLFBOOT_SIGN_RSAPSS2048 )
452+ # define HDR_IMG_TYPE_AUTH HDR_IMG_TYPE_AUTH_RSAPSS2048
453+ # ifndef WOLFBOOT_UNIVERSAL_KEYSTORE
454+ # define KEYSTORE_PUBKEY_SIZE KEYSTORE_PUBKEY_SIZE_RSA2048
455+ # endif
456+ #elif defined(WOLFBOOT_SIGN_RSAPSS3072 )
457+ # define HDR_IMG_TYPE_AUTH HDR_IMG_TYPE_AUTH_RSAPSS3072
458+ # ifndef WOLFBOOT_UNIVERSAL_KEYSTORE
459+ # define KEYSTORE_PUBKEY_SIZE KEYSTORE_PUBKEY_SIZE_RSA3072
460+ # endif
461+ #elif defined(WOLFBOOT_SIGN_RSAPSS4096 )
462+ # define HDR_IMG_TYPE_AUTH HDR_IMG_TYPE_AUTH_RSAPSS4096
463+ # ifndef WOLFBOOT_UNIVERSAL_KEYSTORE
464+ # define KEYSTORE_PUBKEY_SIZE KEYSTORE_PUBKEY_SIZE_RSA4096
465+ # endif
442466 #elif defined(WOLFBOOT_SIGN_LMS )
443467 # define HDR_IMG_TYPE_AUTH HDR_IMG_TYPE_AUTH_LMS
444468 # ifndef WOLFBOOT_UNIVERSAL_KEYSTORE
0 commit comments