Remove mysterious AES_Encrypt call
This commit is contained in:
28
app/uart.c
28
app/uart.c
@@ -42,6 +42,7 @@
|
|||||||
#include "sram-overlay.h"
|
#include "sram-overlay.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define UNUSED(x) (void)(x)
|
||||||
|
|
||||||
#define DMA_INDEX(x, y) (((x) + (y)) % sizeof(UART_DMA_Buffer))
|
#define DMA_INDEX(x, y) (((x) + (y)) % sizeof(UART_DMA_Buffer))
|
||||||
|
|
||||||
@@ -211,20 +212,25 @@ static void SendVersion(void)
|
|||||||
|
|
||||||
static bool IsBadChallenge(const uint32_t *pKey, const uint32_t *pIn, const uint32_t *pResponse)
|
static bool IsBadChallenge(const uint32_t *pKey, const uint32_t *pIn, const uint32_t *pResponse)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
#ifdef ENABLE_FEAT_F4HWN
|
||||||
uint32_t IV[4];
|
UNUSED(pKey);
|
||||||
|
UNUSED(pIn);
|
||||||
|
UNUSED(pResponse);
|
||||||
|
#else
|
||||||
|
unsigned int i;
|
||||||
|
uint32_t IV[4];
|
||||||
|
|
||||||
IV[0] = 0;
|
IV[0] = 0;
|
||||||
IV[1] = 0;
|
IV[1] = 0;
|
||||||
IV[2] = 0;
|
IV[2] = 0;
|
||||||
IV[3] = 0;
|
IV[3] = 0;
|
||||||
|
|
||||||
AES_Encrypt(pKey, IV, pIn, IV, true);
|
AES_Encrypt(pKey, IV, pIn, IV, true);
|
||||||
|
|
||||||
for (i = 0; i < 4; i++)
|
|
||||||
if (IV[i] != pResponse[i])
|
|
||||||
return true;
|
|
||||||
|
|
||||||
|
for (i = 0; i < 4; i++)
|
||||||
|
if (IV[i] != pResponse[i])
|
||||||
|
return true;
|
||||||
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user