RedoXyde / nabgcc

Firmware of the Nabaztag:tag, ported to GCC
MIT License
29 stars 4 forks source link

Bug in rt2501_auth #6

Open ccarlo64 opened 3 years ago

ccarlo64 commented 3 years ago

Hi i found a problem in the rt2501_auth function in ieee80211.c file; the key was truncated at the first 00 found as it considered it a string, I solved it like this

void rt2501_auth ... ... case IEEE80211_CRYPT_WPA: case IEEE80211_CRYPT_WPA2: ieee80211_authmode = IEEE80211_AUTH_OPEN; // fix change strcpy to memcpy memcpy(ieee80211_key, key, IEEE80211_MAX_KEYLEN); // strcpy((char )ieee80211_key, (const char )key); rt2501_set_key(0, NULL, NULL, NULL, RT2501_CIPHER_NONE); eapol_init(); break;

Thanks for your work Regards Carlo

GilDev commented 4 months ago

Hi, What does that fixes in practice? The Nabaztag cannot connect otherwise?

ccarlo64 commented 4 months ago

Hi! Random: if the encryption key that is generated also contains the value 0 it does not work, otherwise everything is fine. C.