Skip to content

Commit 873e092

Browse files
committed
fixup!
1 parent fd6393d commit 873e092

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lnpos/lnpos.ino

+4
Original file line numberDiff line numberDiff line change
@@ -1880,6 +1880,10 @@ void printSleepAnimationFrame(String text, int wait)
18801880

18811881
//////////ENCRYPTION///////////////
18821882
void encrypt(const char* key, unsigned char* iv, int length, const char* plainText, unsigned char* outputBuffer){
1883+
if (strlen(key) != 16) {
1884+
Serial.println("Key must be 16 bytes long. not " + String(strlen(key)) + " bytes.");
1885+
return;
1886+
}
18831887
mbedtls_aes_context aes;
18841888
mbedtls_aes_init(&aes);
18851889
mbedtls_aes_setkey_enc(&aes, (const unsigned char*)key, strlen(key)*8);

0 commit comments

Comments
 (0)