Files
ESP8266_RTOS_SDK/tools/make_cert.py
Espressif Systems c24c2a557d NEW VERSION: 1.1.0
1. Add pwm support;
2. Add c++ support; Please update to the latest folder "ld".
3. Add rand in libminic;
4. Add new reset reason REASON_EXT_SYS_RST in rst_reason;
5. Update the complied script ‘gen_misc.sh(bat)’, use the new boot and remove the old one;
6. Update folder "tools", and support CRC check of bin files;  Please update to the latest folder "tools".
7. Optimize the process procedure of Wi-Fi event;
8. Fix bugs in printf when its runs out of memory;
9. Fix bugs in malloc when CACHE is disabled;
10.Fix exception and WDT reset bugs when CACHE is disabled;
11.Fix some Wi-Fi connection bugs;
12.Fix some Wi-Fi scan bugs;
13.Tune API "wifi_station_get_connect_status" for more accurate WiFi positioning;
14.Porting the optimization of non-OS SDK to RTOS SDK;
15.Fix other minor bugs.
2015-08-21 18:10:07 +08:00

43 lines
1.0 KiB
Python

import os
class Cert(object):
def __init__(self, name, buff):
self.name = name
self.len = len(buff)
self.buff = buff
pass
def __str__(self):
out_str = ['\0']*32
for i in range(len(self.name)):
out_str[i] = self.name[i]
out_str = "".join(out_str)
out_str += str(chr(self.len & 0xFF))
out_str += str(chr((self.len & 0xFF00) >> 8))
out_str += self.buff
return out_str
pass
def main():
cert_list = []
file_list = os.listdir(os.getcwd())
cert_file_list = []
for _file in file_list:
pos = _file.find(".cer")
if pos != -1:
cert_file_list.append(_file[:pos])
for cert_file in cert_file_list:
with open(cert_file+".cer", 'rb') as f:
buff = f.read()
cert_list.append(Cert(cert_file, buff))
with open('esp_ca_cert.bin', 'wb+') as f:
for _cert in cert_list:
f.write("%s" % _cert)
pass
if __name__ == '__main__':
main()