From e9800db481a46158a211cf030517905d1a8f220a Mon Sep 17 00:00:00 2001 From: August Quint <49277349+AugustQu@users.noreply.github.com> Date: Tue, 1 Sep 2020 11:53:49 +0200 Subject: [PATCH] Update macsniff.cpp added: CWA-handling --- src/macsniff.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/macsniff.cpp b/src/macsniff.cpp index a64e49b1..3b6ee5d5 100644 --- a/src/macsniff.cpp +++ b/src/macsniff.cpp @@ -10,7 +10,9 @@ // Local logging tag static const char TAG[] = __FILE__; -uint16_t salt; +// used here and in corona.cpp +uint16_t salt = -1; +uint16_t hashedmac = -1; // temporary buffer for generated hash value uint16_t get_salt(void) { salt = (uint16_t)random(65536); // get new 16bit random for salting hashes @@ -51,7 +53,6 @@ bool mac_add(uint8_t *paddr, int8_t rssi, bool sniff_type) { char buff[10]; // temporary buffer for printf bool added = false; int8_t beaconID; // beacon number in test monitor mode - uint16_t hashedmac; // temporary buffer for generated hash value uint32_t *mac; // temporary buffer for shortened MAC // only last 3 MAC Address bytes are used for MAC address anonymization @@ -111,18 +112,25 @@ bool mac_add(uint8_t *paddr, int8_t rssi, bool sniff_type) { payload.addAlarm(rssi, beaconID); SendPayload(BEACONPORT, prio_high); } - }; + }; } // added // Log scan result ESP_LOGV(TAG, "%s %s RSSI %ddBi -> salted MAC %s -> Hash %04X -> WiFi:%d " - "BLTH:%d -> " - "%d Bytes left", + "BLTH:%d " +#if (COUNT_CWA) + "(CWA:%d)" +#endif + "-> %d Bytes left", added ? "new " : "known", sniff_type == MAC_SNIFF_WIFI ? "WiFi" : "BLTH", rssi, buff, - hashedmac, macs_wifi, macs_ble, getFreeRAM()); + hashedmac, macs_wifi, macs_ble, +#if (COUNT_CWA) + cwa_report(), +#endif + getFreeRAM()); #if (VENDORFILTER) } else {