I'm working from the Basic WiFi application project, using the iPhone app to connect it to my router.
Okay, the function wlan_smart_config_process() is called after Smart Config is complete. It calls nvmem_read() to extract the smart config info from the CC3000. I am having problems with the way it extracts the wifi password from that data.
1. The application expect the password to be encrypted. The password is not encrypted. The application on the host receives the plain text password and passes it through aes_decrypt(). This produces garbage. As far as I can tell, the iPhone app and the Basic WiFi Application example project were made to work together, so why do they disagree on weather the data should be encrypted?
2. nvmem_read() pulls 67 bytes out of the CC3000, the SSID name and password do not take up the entire 67 bits, the rest is padded with 0xFF. Then code that is written attempts to decipher the length of the password. The first thing it does is look at the 31st byte in the password buffer. If it finds a zero there, then it assumes the data is less than 31 bytes long, if anything besides a zero is there, it assumes the length is greater than (or equal to) 31. Obviously the author of this example code was certain that the password buffer would end with '\0' if the length of the password were less than 31 bytes. Why then, do I have an 0xFF there?