From 319cfd709a29d8dd369e35f17d83ee0c701fab9c Mon Sep 17 00:00:00 2001 From: weetmuts Date: Mon, 11 Mar 2019 17:21:13 +0100 Subject: [PATCH] Only check for 2f2f after aes cbc decrypt. --- src/meter_iperl.cc | 3 --- src/wmbus_utils.cc | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/meter_iperl.cc b/src/meter_iperl.cc index be63cb4..9b4147e 100644 --- a/src/meter_iperl.cc +++ b/src/meter_iperl.cc @@ -114,9 +114,6 @@ void MeterIperl::handleTelegram(Telegram *t) } else { t->content = t->payload; } - if (t->content[0] != 0x2f || t->content[1] != 0x2f) { - warning("(meter_iperl) warning: telegram payload does not start with 2F2F (did you use the correct encryption key?)\n"); - } char log_prefix[256]; snprintf(log_prefix, 255, "(%s) log", "iperl"); logTelegram(log_prefix, t->parsed, t->content); diff --git a/src/wmbus_utils.cc b/src/wmbus_utils.cc index 746dac9..d2ed7b1 100644 --- a/src/wmbus_utils.cc +++ b/src/wmbus_utils.cc @@ -126,7 +126,7 @@ void decryptMode5_AES_CBC(Telegram *t, vector &aeskey) AES_CBC_decrypt_buffer(decrypted_data, content_data, content.size(), &aeskey[0], iv); if (decrypted_data[0] != 0x2F || decrypted_data[1] != 0x2F) { - verbose("(Mode5) decrypt failed!\n"); + warning("(Mode5) warning: telegram payload does not start with 2F2F (did you use the correct encryption key?)\n"); } t->content.clear();