pfalcon / yaota8266

Yet another OTA solution for ESP8266, this time supporting large (>512KB) firmwares even on 1MB devices (repo is rebased)
120 stars 33 forks source link

How do i convert publish key to config.h format? #18

Closed p0we7 closed 6 years ago

p0we7 commented 6 years ago

gen_keys.sh generate under like this :

-----BEGIN PUBLIC KEY-----
MFowDQYJKoZIhvcNAQEBBQADSQAwRgJBAMOnzUr31UJ2y5Trji75cqs/fq48GIEk
5f9uGQs8B2CB2B1bpKlv05NzhswxFFT5vdHqi73GGmqeCe94mBiLsScCAQM=
-----END PUBLIC KEY-----

but on config.h rsa publish key like this :

#define MODULUS "\xce\x4a\xaf\x65\x0d\x4a\x74\xda\xc1\x30\x59\x80\xcf\xdd\xe8\x2a\x2e\x1d\xf7\xa8\xc9\x6c\xa9\x4a\x2c\xb7\x8a\x5a\x2a\x25\xc0\x2b\x7b\x2f\x58\x4c\xa8\xcb\x82\x07\x06\x08\x7e\xff\x1f\xce\x47\x13\x67\x94\x5f\x9a\xac\x5e\x7d\xcf\x63\xf0\x08\xe9\x51\x98\x95\x01"

i don't know how to convert , otherwise have any documents ?

xprofiler commented 6 years ago

Hi, you can simply execute the following code in a python console within the ota-client directory after generating the key-pair: import rsa_sign rsa_sign.dump_c(rsa_sign.load_key()) Then copy the output mod = "..." to the config.h file.

p0we7 commented 6 years ago

Thanks you answer