Fix for increased mcapi (used by Microchip) ctx sizes if PK callbacks is enabled due to key id/label.

pull/4984/head
David Garske 2022-03-25 12:36:07 -07:00
parent 008c8509c6
commit 0930086fa1
2 changed files with 14 additions and 5 deletions

View File

@ -24,6 +24,8 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <wolfssl/wolfcrypt/settings.h>
#ifdef MICROCHIP_MPLAB_HARMONY
#include "system_config.h"
#include "crypto/crypto.h"
@ -31,8 +33,6 @@
#include "crypto.h"
#endif
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfssl/wolfcrypt/md5.h>
#include <wolfssl/wolfcrypt/sha.h>
#include <wolfssl/wolfcrypt/sha256.h>

View File

@ -27,7 +27,6 @@
#ifndef MC_CRYPTO_API_H
#define MC_CRYPTO_API_H
#ifdef __cplusplus
extern "C" {
#endif
@ -107,7 +106,12 @@ enum {
/* HMAC */
typedef struct CRYPT_HMAC_CTX {
long long holder[98]; /* big enough to hold internal, but check on init */
/* big enough to hold internal, but check on init */
#ifdef WOLF_PRIVATE_KEY_ID
long long holder[108];
#else
long long holder[98];
#endif
} CRYPT_HMAC_CTX;
int CRYPT_HMAC_SetKey(CRYPT_HMAC_CTX*, int, const unsigned char*, unsigned int);
@ -167,7 +171,12 @@ enum {
/* AES */
typedef struct CRYPT_AES_CTX {
int holder[90]; /* big enough to hold internal, but check on init */
/* big enough to hold internal, but check on init */
#ifdef WOLF_PRIVATE_KEY_ID
int holder[104];
#else
int holder[90];
#endif
} CRYPT_AES_CTX;
/* key */