mirror of
https://github.com/espressif/esp-idf.git
synced 2024-09-20 00:36:01 -04:00
mbedtls: added SOC_AES_SUPPORT_AES_192 check in esp_aes_gcm_setkey()
This commit is contained in:
parent
e0f31edab5
commit
06bb0ee077
@ -28,6 +28,7 @@
|
|||||||
#include "esp_heap_caps.h"
|
#include "esp_heap_caps.h"
|
||||||
#include "soc/soc_memory_layout.h"
|
#include "soc/soc_memory_layout.h"
|
||||||
|
|
||||||
|
#include "mbedtls/error.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#define ESP_PUT_BE64(a, val) \
|
#define ESP_PUT_BE64(a, val) \
|
||||||
@ -245,6 +246,11 @@ int esp_aes_gcm_setkey( esp_gcm_context *ctx,
|
|||||||
const unsigned char *key,
|
const unsigned char *key,
|
||||||
unsigned int keybits )
|
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) {
|
if (keybits != 128 && keybits != 192 && keybits != 256) {
|
||||||
return MBEDTLS_ERR_AES_INVALID_KEY_LENGTH;
|
return MBEDTLS_ERR_AES_INVALID_KEY_LENGTH;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user