mbedtls: added SOC_AES_SUPPORT_AES_192 check in esp_aes_gcm_setkey()

pull/10716/head
harshal.patil 2022-12-07 14:22:52 +05:30
rodzic db60b5b628
commit 342671a943
1 zmienionych plików z 6 dodań i 0 usunięć

Wyświetl plik

@ -40,6 +40,7 @@
#include "esp_heap_caps.h"
#include "soc/soc_memory_layout.h"
#include "mbedtls/error.h"
#include <string.h>
#define ESP_PUT_BE64(a, val) \
@ -257,6 +258,11 @@ int esp_aes_gcm_setkey( esp_gcm_context *ctx,
const unsigned char *key,
unsigned int keybits )
{
#if !SOC_AES_SUPPORT_AES_192
if (keybits == 192) {
return MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED;
}
#endif
if (keybits != 128 && keybits != 192 && keybits != 256) {
return MBEDTLS_ERR_AES_INVALID_KEY_LENGTH;
}