toniebox-reverse-engineering / teddycloud

teddyCloud is an open source server replacement for the Boxine Cloud
https://toniebox-reverse-engineering.github.io/docs/tools/teddycloud/
GNU General Public License v2.0
404 stars 31 forks source link

First setup of Toniebox #88

Open jensMF opened 9 months ago

jensMF commented 9 months ago

Hi,

I have an ESP32-box where I never did the first setup but I already flashed the patched image with the webinterface.

Now, when I run the W-Lan seutp, at the end I get the errorcode 'Ant' (or 'Ameise'). I looked it up and it means, the box is conntected to W-Lan but could not 'reach the internet.'

Is it possible, to successfully finish the initial setup with an already patched Toniebox?

Thank you in advance!

g3gg0 commented 9 months ago

No, that's not tested yet. Please set it up first with the original firmware. It should be backed up in teddycloud.

When you've done that step, the SSID and password will be stored in NVM. In theory we could set it up via web interface as well.

SciLor commented 9 months ago

Please check the logs during / after the setup and drop it here.

jensMF commented 9 months ago

What logs do you mean and how do I get them? I thought about a mitm-proxy but I would apriciate something easier …

SciLor commented 9 months ago

What logs do you mean and how do I get them? I thought about a mitm-proxy but I would apriciate something easier …

You can view and export the logs with docker if you are using that

jensMF commented 9 months ago

Yes, I use docker. Is there a public documentation how to export them or can you write a short how-to here?

SciLor commented 9 months ago

https://docs.docker.com/engine/reference/commandline/logs/

jensMF commented 9 months ago

I managed to setup a mitmproxy. Is it possible to patch the firmware with a different ca over the web gui? I could sniff some requests from the Toniebox, but I only got status code 400 (exept for the time request):

GET https://prod.de.tbs.toys/v1/time
               << 200 OK 10b

POST https://prod.de.tbs.toys/v1/cloud-reset
               << 400 Bad Request 154b

GET https://prod.de.tbs.toys/v1/ota/5?cv=1638869115
               << 400 Bad Request 154b

GET https://prod.de.tbs.toys/v1/ota/2?cv=1666701414
               << 400 Bad Request 154b

GET https://prod.de.tbs.toys/v1/ota/6?cv=1534781997
               << 400 Bad Request 154b

GET https://prod.de.tbs.toys/v1/ota/3?cv=1
               << 400 Bad Request 154b

I try to figure out, how to use the client-certificate from the box as client certificate for the mitmproxy. My first attempt does (obviously) not work.

SciLor commented 9 months ago

teddyCloud uses the CA from the certs/server directory to patch your box. But why are you using mitmproxy? This is not needed for teddyCloud.

jensMF commented 9 months ago

I try to reverse the initial setup of the box, so it could be implemented to teddycloud. Or is this already known but not implemented?

SciLor commented 9 months ago

https://github.com/toniebox-reverse-engineering/teddycloud/blob/6acef3e6ff6e15028a793434f8f5de1145c335ed/src/handler_cloud.c#L703

It is partly implemented. I think there is just a small mistake in teddyCloud that prevents it iirc. So take a look at the logs of teddyCloud, a mitmproxy log could help too.

jensMF commented 9 months ago

teddycloud log:

==9==ERROR: AddressSanitizer: heap-use-after-free on address 0x61d0000c2680 at pc 0x556e8bff0835 bp 0x7f8e3f20c650 sp 0x7f8e3f20c640
READ of size 1 at 0x61d0000c2680 thread T38                                                                                                                                                  
    #0 0x556e8bff0834 in pemFindTag cyclone/cyclone_crypto/pkix/pem_common.c:349
    #1 0x556e8bff2234 in pemDecodeFile cyclone/cyclone_crypto/pkix/pem_common.c:67
    #2 0x556e8bfeac95 in pemImportCertificate cyclone/cyclone_crypto/pkix/pem_import.c:72
    #3 0x556e8c05e271 in tlsValidateCertificate src/cyclone/cyclone_ssl/tls_certificate.c:1314
    #4 0x556e8bf14b91 in tlsParseCertificateList src/tls_adapter.c:600
    #5 0x556e8bf945a4 in tlsParseCertificate cyclone/cyclone_ssl/tls_common.c:1542
    #6 0x556e8bf6f545 in tlsParseHandshakeMessage cyclone/cyclone_ssl/tls_handshake.c:381
    #7 0x556e8bf6f903 in tlsReceiveHandshakeMessage cyclone/cyclone_ssl/tls_handshake.c:281
    #8 0x556e8bf74dd7 in tlsPerformClientHandshake cyclone/cyclone_ssl/tls_client_fsm.c:203
    #9 0x556e8bf4abe8 in httpClientConnect cyclone/cyclone_tcp/http/http_client.c:314
    #10 0x556e8be758b6 in cloud_request src/cloud_request.c:178
    #11 0x556e8be79396 in cloud_request_get src/cloud_request.c:89
    #12 0x556e8beb4be3 in handleCloudTime src/handler_cloud.c:54
    #13 0x556e8c052dd1 in httpConnectionTask src/cyclone/cyclone_tcp/http/http_server.c:546
    #14 0x7f8e55580ac2  (/lib/x86_64-linux-gnu/libc.so.6+0x94ac2)
    #15 0x7f8e55611bf3 in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x125bf3)

0x61d0000c2680 is located 0 bytes inside of 2009-byte region [0x61d0000c2680,0x61d0000c2e59)
freed by thread T0 here:                                                                                                                                                                     
    #0 0x556e8be26197 in free (/usr/local/bin/teddycloud+0x5fc197)
    #1 0x556e8bf049fd in settings_deinit src/settings.c:409

previously allocated by thread T35 here:
    #0 0x556e8bdcd627 in strdup (/usr/local/bin/teddycloud+0x5a3627)
    #1 0x556e8bf05263 in overlay_settings_init src/settings.c:250

Thread T38 created by T0 here:
    #0 0x556e8bdca305 in pthread_create (/usr/local/bin/teddycloud+0x5a0305)
    #1 0x556e8c2be9e3 in osCreateTask src/cyclone/common/os_port_posix.c:87

Thread T35 created by T0 here:
    #0 0x556e8bdca305 in pthread_create (/usr/local/bin/teddycloud+0x5a0305)
    #1 0x556e8c2be9e3 in osCreateTask src/cyclone/common/os_port_posix.c:87

SUMMARY: AddressSanitizer: heap-use-after-free cyclone/cyclone_crypto/pkix/pem_common.c:349 in pemFindTag
Shadow bytes around the buggy address:
  0x0c3a80010480: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c3a80010490: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c3a800104a0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fa
  0x0c3a800104b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c3a800104c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
=>0x0c3a800104d0:[fd]fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c3a800104e0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c3a800104f0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c3a80010500: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c3a80010510: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c3a80010520: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
  Shadow gap:              cc
==9==ABORTING
jensMF commented 9 months ago

I realized, that the box falls back to the original server during first setup. At the moment, I have forward 'time' queries, forward 'ota' queries and forward 'cloudReset' queries set to true. This seems to revert the firmware patch.

jensMF commented 9 months ago

Ok, that was a big mistake. It seems to me, that I do not get into the UART download-mode anymore ...

SciLor commented 9 months ago

I realized, that the box falls back to the original server during first setup. At the moment, I have forward 'time' queries, forward 'ota' queries and forward 'cloudReset' queries set to true. This seems to revert the firmware patch.

If you forward the OTA this will update your firmware if your box is factory fresh. I think this was the root of the problem, as the box needs an initial update to the latest firmware as the box only has a factory image installed that is only there to update itself. This will overwrite your patched firmware. You'll need to patch it again after that.

Ok, that was a big mistake. It seems to me, that I do not get into the UART download-mode anymore ...

I don't think this is related to it. Please check your jumper and cut the power to the box a moment

jensMF commented 9 months ago

You are right, it is not related. Unfortunately now I always get a timeout when I try to download the new firmware from the esp. Always at different percentages, but I never get the 100%. I don't know why and I don't know, what I could do about it.

SciLor commented 9 months ago

Maybe you got an unstable connection. Especially check GND and your power supply of the box. Maybe the battery is low? Or you using the power supply?

jensMF commented 9 months ago

I am using the power supply. My soldering work was not so good at first. I had do redo it a few times. It then worked stable for some time and now it's like I described above ...

jensMF commented 9 months ago

I had to use esptool.py. That could establish a reliable connection. So I probably have no more interesting logs.

SciLor commented 9 months ago

Thank you for sharing your journey. We found two things, we can document in the future:

jensMF commented 9 months ago

It would be nice, if teddycloud could patch the ota update(s) on the fly.

I got this https://github.com/toniebox-reverse-engineering/teddycloud/issues/88#issuecomment-1853905388 error again while running teddycloud. I don't know what caused it, but I think it was the first time I put a creative tonie on the box that was already registered with the boxine (tonie) cloud after I flashed the patched box image.

SciLor commented 9 months ago

Could you please provide me the certs/server and config directory? This way I can try to reproduce it. (You may replace your mac of the box within the config files.)

After that, you may try to generate the certificates yourself with the gencerts.sh script. https://github.com/toniebox-reverse-engineering/teddycloud/blob/master/contrib/gencerts.sh

Just enter your teddyCloud container.

sudo docker exec -it teddycloud /bin/bash
cd teddycloud
gencerts.sh

you may need to install faketime before sudo apt update && sudo apt install faketime

jensMF commented 9 months ago

After that, you may try to generate the certificates yourself with the gencerts.sh script. https://github.com/toniebox-reverse-engineering/teddycloud/blob/master/contrib/gencerts.sh

When I do this, I have to flash the box again, rigth? I would very much like to avoid that. Is there a possibility to reproduce without my server certificates? Or do you suggest to recreate the server certificates because you think, they cause the error?

SciLor commented 9 months ago

I just want to be sure, that your certs are fine. So recreating them in another way may help you to fix this. This involves reflashing the box. I currently have no esp32 box to test. I will try to reproduce it on another box this weekend. As we recently changed the way of generating the certs there might be a problem.

jensMF commented 9 months ago

Ok, understood. How could I provide the folders to you?

SciLor commented 9 months ago

You may either just upload it here or send it to me via Telegram (But you said, you don't use it right?) But beside that I will try to replicate your problem without them on the weekend. So, it would be just a way if I cannot reproduce it without it.

SciLor commented 9 months ago

@jensMF what is your log regarding the certs?

This is mine, after a fresh installation. It works with a cc3200 Box.

INFO |tls_adapter.c:0387:tls_adapter_init()| Loading certificates... INFO |tls_adapter.c:0208:read_certificate()| File 'certs/server/ca-root.pem' assumed PEM style INFO |tls_adapter.c:0205:read_certificate()| File 'certs/server/ca-key.pem' detected as DER style RSA PRIVATE KEY INFO |tls_adapter.c:0208:read_certificate()| File 'certs/server/teddy-cert.pem' assumed PEM style INFO |tls_adapter.c:0205:read_certificate()| File 'certs/server/teddy-key.pem' detected as DER style RSA PRIVATE KEY INFO |tls_adapter.c:0201:read_certificate()| File 'certs/client/bluedev/ca.der' detected as DER style CERTIFICATE INFO |tls_adapter.c:0201:read_certificate()| File 'certs/client/bluedev/client.der' detected as DER style CERTIFICATE INFO |tls_adapter.c:0205:read_certificate()| File 'certs/client/bluedev/private.der' detected as DER style RSA PRIVATE KEY

jensMF commented 9 months ago

This must have been the first run of a teddycloud-container on my machine with docker run ghcr.io/toniebox-reverse-engineering/teddycloud:tc_v0.3.2

TeddyCloud v0.3.2 (50869be) - 2023-12-08 08:09:28 +0000 linux-x86_64

INFO |settings.c:0622:settings_load_ovl| Load settings from config/config.overlay.ini
WARN |settings.c:0630:settings_load_ovl| Config file does not exist, creating it...
INFO |settings.c:0517:settings_save_ovl| Save settings to config/config.overlay.ini
INFO |settings.c:0622:settings_load_ovl| Load settings from config/config.ini
WARN |settings.c:0630:settings_load_ovl| Config file does not exist, creating it...
INFO |settings.c:0517:settings_save_ovl| Save settings to config/config.ini
INFO |settings.c:0622:settings_load_ovl| Load settings from config/config.overlay.ini
INFO |tls_adapter.c:0387:tls_adapter_init| Loading certificates...
ERROR|tls_adapter.c:0193:read_certificate| Failed to open 'certs/server/ca-root.pem' for cert type detection
ERROR|tls_adapter.c:0375:load_cert| Loading cert 'certs/server/ca-root.pem' failed
INFO |settings.c:1227:settings_load_certs_id| ********************************************
INFO |settings.c:1228:settings_load_certs_id|    No certificates found. Generating.
INFO |settings.c:1229:settings_load_certs_id|    This will take some time...
INFO |settings.c:1230:settings_load_certs_id| ********************************************
INFO |cert.c:0396:cert_generate_default| Generating CA certificate...
INFO |cert.c:0042:cert_generate_rsa| Generating RSA Key... (slow!)
cyclone/cyclone_crypto/cipher/aes.c:260:47: runtime error: left shift of 176 by 24 places cannot be represented in type 'int'
cyclone/cyclone_crypto/cipher/aes.c:268:55: runtime error: left shift of 129 by 24 places cannot be represented in type 'int'
cyclone/cyclone_crypto/cipher/aes.c:395:34: runtime error: left shift of 253 by 24 places cannot be represented in type 'int'
cyclone/cyclone_crypto/cipher/aes.c:400:34: runtime error: left shift of 185 by 24 places cannot be represented in type 'int'
cyclone/cyclone_crypto/cipher/aes.c:385:34: runtime error: left shift of 195 by 24 places cannot be represented in type 'int'
cyclone/cyclone_crypto/cipher/aes.c:390:34: runtime error: left shift of 213 by 24 places cannot be represented in type 'int'
src/cyclone/cyclone_crypto/mpi.c:792:48: runtime error: left shift of 167 by 24 places cannot be represented in type 'int'
INFO |tls_adapter.c:0208:read_certificate| File 'certs/server/ca-root.pem' assumed PEM style
INFO |tls_adapter.c:0205:read_certificate| File 'certs/server/ca-key.pem' detected as DER style RSA PRIVATE KEY
ERROR|tls_adapter.c:0193:read_certificate| Failed to open 'certs/server/teddy-cert.pem' for cert type detection
ERROR|tls_adapter.c:0375:load_cert| Loading cert 'certs/server/teddy-cert.pem' failed
INFO |cert.c:0420:cert_generate_default| Generating Server certificate...
INFO |cert.c:0079:cert_load_ca| Load CA certificate...
INFO |cert.c:0103:cert_load_ca| Load CA key...
INFO |cert.c:0042:cert_generate_rsa| Generating RSA Key... (slow!)
INFO |tls_adapter.c:0208:read_certificate| File 'certs/server/ca-root.pem' assumed PEM style
INFO |tls_adapter.c:0205:read_certificate| File 'certs/server/ca-key.pem' detected as DER style RSA PRIVATE KEY
INFO |tls_adapter.c:0208:read_certificate| File 'certs/server/teddy-cert.pem' assumed PEM style
INFO |tls_adapter.c:0205:read_certificate| File 'certs/server/teddy-key.pem' detected as DER style RSA PRIVATE KEY
ERROR|tls_adapter.c:0193:read_certificate| Failed to open 'certs/client/ca.der' for cert type detection
ERROR|tls_adapter.c:0375:load_cert| Loading cert 'certs/client/ca.der' failed
ERROR|tls_adapter.c:0193:read_certificate| Failed to open 'certs/client/client.der' for cert type detection
ERROR|tls_adapter.c:0375:load_cert| Loading cert 'certs/client/client.der' failed
ERROR|tls_adapter.c:0193:read_certificate| Failed to open 'certs/client/private.der' for cert type detection
ERROR|tls_adapter.c:0375:load_cert| Loading cert 'certs/client/private.der' failed
INFO |settings.c:1232:settings_load_certs_id| ********************************************
INFO |settings.c:1233:settings_load_certs_id|    FINISHED
INFO |settings.c:1234:settings_load_certs_id| ********************************************
INFO |toniesJson.c:0053:tonies_readJson| Trying to read config/tonies.custom.json with size 0
INFO |toniesJson.c:0136:tonies_readJson| Create empty json file
INFO |toniesJson.c:0053:tonies_readJson| Trying to read config/tonies.json with size 3574945
INFO |settings.c:1152:settings_loop| Settings file changed. Reloading.
INFO |settings.c:0622:settings_load_ovl| Load settings from config/config.ini
INFO |tls_adapter.c:0208:read_certificate| File 'certs/server/ca-root.pem' assumed PEM style
INFO |tls_adapter.c:0205:read_certificate| File 'certs/server/ca-key.pem' detected as DER style RSA PRIVATE KEY
INFO |tls_adapter.c:0208:read_certificate| File 'certs/server/teddy-cert.pem' assumed PEM style
INFO |tls_adapter.c:0205:read_certificate| File 'certs/server/teddy-key.pem' detected as DER style RSA PRIVATE KEY
ERROR|tls_adapter.c:0193:read_certificate| Failed to open 'certs/client/ca.der' for cert type detection
ERROR|tls_adapter.c:0375:load_cert| Loading cert 'certs/client/ca.der' failed
ERROR|tls_adapter.c:0193:read_certificate| Failed to open 'certs/client/client.der' for cert type detection
ERROR|tls_adapter.c:0375:load_cert| Loading cert 'certs/client/client.der' failed
ERROR|tls_adapter.c:0193:read_certificate| Failed to open 'certs/client/private.der' for cert type detection
ERROR|tls_adapter.c:0375:load_cert| Loading cert 'certs/client/private.der' failed
INFO |settings.c:0622:settings_load_ovl| Load settings from config/config.overlay.ini

and this was the first time I ran it with docker compose run teddycloud:

TeddyCloud v0.3.2 (50869be) - 2023-12-08 08:09:28 +0000 linux-x86_64

INFO |settings.c:0622:settings_load_ovl()| Load settings from config/config.overlay.ini
WARN |settings.c:0630:settings_load_ovl()| Config file does not exist, creating it...
INFO |settings.c:0517:settings_save_ovl()| Save settings to config/config.overlay.ini
INFO |settings.c:0622:settings_load_ovl()| Load settings from config/config.ini
WARN |settings.c:0630:settings_load_ovl()| Config file does not exist, creating it...
INFO |settings.c:0517:settings_save_ovl()| Save settings to config/config.ini
INFO |settings.c:0622:settings_load_ovl()| Load settings from config/config.overlay.ini
INFO |tls_adapter.c:0387:tls_adapter_init()| Loading certificates...
ERROR|tls_adapter.c:0193:read_certificate()| Failed to open 'certs/server/ca-root.pem' for cert type detection
ERROR|tls_adapter.c:0375:load_cert()| Loading cert 'certs/server/ca-root.pem' failed
INFO |settings.c:1227:settings_load_certs_id()| ********************************************
INFO |settings.c:1228:settings_load_certs_id()|    No certificates found. Generating.
INFO |settings.c:1229:settings_load_certs_id()|    This will take some time...
INFO |settings.c:1230:settings_load_certs_id()| ********************************************
INFO |cert.c:0396:cert_generate_default()| Generating CA certificate...
INFO |cert.c:0042:cert_generate_rsa()| Generating RSA Key... (slow!)
cyclone/cyclone_crypto/cipher/aes.c:260:47: runtime error: left shift of 141 by 24 places cannot be represented in type 'int'
cyclone/cyclone_crypto/cipher/aes.c:268:55: runtime error: left shift of 252 by 24 places cannot be represented in type 'int'
cyclone/cyclone_crypto/cipher/aes.c:395:34: runtime error: left shift of 192 by 24 places cannot be represented in type 'int'
cyclone/cyclone_crypto/cipher/aes.c:385:34: runtime error: left shift of 151 by 24 places cannot be represented in type 'int'
cyclone/cyclone_crypto/cipher/aes.c:400:34: runtime error: left shift of 204 by 24 places cannot be represented in type 'int'
cyclone/cyclone_crypto/cipher/aes.c:390:34: runtime error: left shift of 220 by 24 places cannot be represented in type 'int'
src/cyclone/cyclone_crypto/mpi.c:792:48: runtime error: left shift of 208 by 24 places cannot be represented in type 'int'
INFO |tls_adapter.c:0208:read_certificate()| File 'certs/server/ca-root.pem' assumed PEM style
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/server/ca-key.pem' detected as DER style RSA PRIVATE KEY
ERROR|tls_adapter.c:0193:read_certificate()| Failed to open 'certs/server/teddy-cert.pem' for cert type detection
ERROR|tls_adapter.c:0375:load_cert()| Loading cert 'certs/server/teddy-cert.pem' failed
INFO |cert.c:0420:cert_generate_default()| Generating Server certificate...
INFO |cert.c:0079:cert_load_ca()| Load CA certificate...
INFO |cert.c:0103:cert_load_ca()| Load CA key...
INFO |cert.c:0042:cert_generate_rsa()| Generating RSA Key... (slow!)
INFO |tls_adapter.c:0208:read_certificate()| File 'certs/server/ca-root.pem' assumed PEM style
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/server/ca-key.pem' detected as DER style RSA PRIVATE KEY
INFO |tls_adapter.c:0208:read_certificate()| File 'certs/server/teddy-cert.pem' assumed PEM style
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/server/teddy-key.pem' detected as DER style RSA PRIVATE KEY
ERROR|tls_adapter.c:0193:read_certificate()| Failed to open 'certs/client/ca.der' for cert type detection
ERROR|tls_adapter.c:0375:load_cert()| Loading cert 'certs/client/ca.der' failed
ERROR|tls_adapter.c:0193:read_certificate()| Failed to open 'certs/client/client.der' for cert type detection
ERROR|tls_adapter.c:0375:load_cert()| Loading cert 'certs/client/client.der' failed
ERROR|tls_adapter.c:0193:read_certificate()| Failed to open 'certs/client/private.der' for cert type detection
ERROR|tls_adapter.c:0375:load_cert()| Loading cert 'certs/client/private.der' failed
INFO |settings.c:1232:settings_load_certs_id()| ********************************************
INFO |settings.c:1233:settings_load_certs_id()|    FINISHED
INFO |settings.c:1234:settings_load_certs_id()| ********************************************
INFO |toniesJson.c:0053:tonies_readJson()| Trying to read config/tonies.custom.json with size 0
INFO |toniesJson.c:0136:tonies_readJson()| Create empty json file
INFO |toniesJson.c:0053:tonies_readJson()| Trying to read config/tonies.json with size 3574945
INFO |settings.c:1152:settings_loop()| Settings file changed. Reloading.
INFO |settings.c:0622:settings_load_ovl()| Load settings from config/config.ini
INFO |tls_adapter.c:0208:read_certificate()| File 'certs/server/ca-root.pem' assumed PEM style
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/server/ca-key.pem' detected as DER style RSA PRIVATE KEY
INFO |tls_adapter.c:0208:read_certificate()| File 'certs/server/teddy-cert.pem' assumed PEM style
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/server/teddy-key.pem' detected as DER style RSA PRIVATE KEY
ERROR|tls_adapter.c:0193:read_certificate()| Failed to open 'certs/client/ca.der' for cert type detection
ERROR|tls_adapter.c:0375:load_cert()| Loading cert 'certs/client/ca.der' failed
ERROR|tls_adapter.c:0193:read_certificate()| Failed to open 'certs/client/client.der' for cert type detection
ERROR|tls_adapter.c:0375:load_cert()| Loading cert 'certs/client/client.der' failed
ERROR|tls_adapter.c:0193:read_certificate()| Failed to open 'certs/client/private.der' for cert type detection
ERROR|tls_adapter.c:0375:load_cert()| Loading cert 'certs/client/private.der' failed
INFO |settings.c:0622:settings_load_ovl()| Load settings from config/config.overlay.ini
SciLor commented 9 months ago

This looks fine, except the missing client certs of the box.

jensMF commented 9 months ago

This was before I extracted the firmware. I used the web ui to extract the firmware. Then I extracted the certs from the firmware and copied it to the right places. Here is the beginning and the end of the log where the error happened a second time:

INFO |settings.c:0622:settings_load_ovl()| Load settings from config/config.overlay.ini
INFO |tls_adapter.c:0208:read_certificate()| File 'certs/server/ca-root.pem' assumed PEM style
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/server/ca-key.pem' detected as DER style RSA PRIVATE KEY
INFO |tls_adapter.c:0208:read_certificate()| File 'certs/server/teddy-cert.pem' assumed PEM style
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/server/teddy-key.pem' detected as DER style RSA PRIVATE KEY
INFO |tls_adapter.c:0201:read_certificate()| File 'certs/client/ca.der' detected as DER style CERTIFICATE
INFO |tls_adapter.c:0201:read_certificate()| File 'certs/client/client.der' detected as DER style CERTIFICATE
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/client/private.der' detected as DER style RSA PRIVATE KEY
INFO |settings.c:0622:settings_load_ovl()| Load settings from config/config.ini
DEBUG|settings.c:0734:settings_load_ovl()| log.level=6
DEBUG|settings.c:0725:settings_load_ovl()| log.color=true
DEBUG|settings.c:0725:settings_load_ovl()| log.logFullAuth=true
DEBUG|settings.c:0734:settings_load_ovl()| core.server.https_port=443
DEBUG|settings.c:0734:settings_load_ovl()| core.server.http_port=80
DEBUG|settings.c:0743:settings_load_ovl()| core.server.bind_ip=
DEBUG|settings.c:0743:settings_load_ovl()| core.host_url=http://localhost
DEBUG|settings.c:0743:settings_load_ovl()| core.certdir=certs/client
DEBUG|settings.c:0743:settings_load_ovl()| core.contentdir=default
DEBUG|settings.c:0743:settings_load_ovl()| core.librarydir=library
DEBUG|settings.c:0743:settings_load_ovl()| core.datadir=data
DEBUG|settings.c:0743:settings_load_ovl()| core.firmwaredir=firmware
DEBUG|settings.c:0743:settings_load_ovl()| core.sslkeylogfile=tls.log
DEBUG|settings.c:0743:settings_load_ovl()| core.server_cert.file.ca=certs/server/ca-root.pem
DEBUG|settings.c:0743:settings_load_ovl()| core.server_cert.file.ca_der=certs/server/ca.der
DEBUG|settings.c:0743:settings_load_ovl()| core.server_cert.file.ca_key=certs/server/ca-key.pem
DEBUG|settings.c:0743:settings_load_ovl()| core.server_cert.file.crt=certs/server/teddy-cert.pem
DEBUG|settings.c:0743:settings_load_ovl()| core.server_cert.file.key=certs/server/teddy-key.pem
DEBUG|settings.c:0743:settings_load_ovl()| core.server_cert.data.ca=
DEBUG|settings.c:0743:settings_load_ovl()| core.client_cert.file.ca=certs/client/ca.der
DEBUG|settings.c:0743:settings_load_ovl()| core.client_cert.file.crt=certs/client/client.der
DEBUG|settings.c:0743:settings_load_ovl()| core.client_cert.file.key=certs/client/private.der
DEBUG|settings.c:0743:settings_load_ovl()| core.allowOrigin=
DEBUG|settings.c:0725:settings_load_ovl()| core.flex_enabled=true
DEBUG|settings.c:0743:settings_load_ovl()| core.flex_uid=
DEBUG|settings.c:0725:settings_load_ovl()| cloud.enabled=true
DEBUG|settings.c:0743:settings_load_ovl()| cloud.remote_hostname=prod.de.tbs.toys
DEBUG|settings.c:0734:settings_load_ovl()| cloud.remote_port=443
DEBUG|settings.c:0725:settings_load_ovl()| cloud.enableV1Claim=false
DEBUG|settings.c:0725:settings_load_ovl()| cloud.enableV1CloudReset=false
DEBUG|settings.c:0725:settings_load_ovl()| cloud.enableV1FreshnessCheck=true
DEBUG|settings.c:0725:settings_load_ovl()| cloud.enableV1Log=false
DEBUG|settings.c:0725:settings_load_ovl()| cloud.enableV1Time=false
DEBUG|settings.c:0725:settings_load_ovl()| cloud.enableV1Ota=false
DEBUG|settings.c:0725:settings_load_ovl()| cloud.enableV2Content=true
DEBUG|settings.c:0725:settings_load_ovl()| cloud.cacheContent=false
DEBUG|settings.c:0725:settings_load_ovl()| cloud.markCustomTagByPass=true
DEBUG|settings.c:0725:settings_load_ovl()| cloud.prioCustomContent=true
DEBUG|settings.c:0725:settings_load_ovl()| cloud.updateOnLowerAudioId=true
DEBUG|settings.c:0725:settings_load_ovl()| cloud.dumpRuidAuthContentJson=true
DEBUG|settings.c:0734:settings_load_ovl()| cloud.ffmpeg_stream_buffer_ms=5000
DEBUG|settings.c:0725:settings_load_ovl()| toniebox.overrideCloud=true
DEBUG|settings.c:0734:settings_load_ovl()| toniebox.max_vol_spk=3
DEBUG|settings.c:0734:settings_load_ovl()| toniebox.max_vol_hdp=3
DEBUG|settings.c:0725:settings_load_ovl()| toniebox.slap_enabled=true
DEBUG|settings.c:0725:settings_load_ovl()| toniebox.slap_back_left=false
DEBUG|settings.c:0734:settings_load_ovl()| toniebox.led=0
DEBUG|settings.c:0725:settings_load_ovl()| rtnl.logRaw=true
DEBUG|settings.c:0725:settings_load_ovl()| rtnl.logHuman=true
DEBUG|settings.c:0743:settings_load_ovl()| rtnl.logRawFile=config/rtnl.bin
DEBUG|settings.c:0743:settings_load_ovl()| rtnl.logHumanFile=config/rtnl.csv
DEBUG|settings.c:0725:settings_load_ovl()| mqtt.enabled=false
DEBUG|settings.c:0743:settings_load_ovl()| mqtt.hostname=
DEBUG|settings.c:0734:settings_load_ovl()| mqtt.port=1883
DEBUG|settings.c:0743:settings_load_ovl()| mqtt.username=
DEBUG|settings.c:0743:settings_load_ovl()| mqtt.password=
DEBUG|settings.c:0743:settings_load_ovl()| mqtt.identification=
DEBUG|settings.c:0743:settings_load_ovl()| mqtt.topic=teddyCloud
DEBUG|settings.c:0734:settings_load_ovl()| mqtt.qosLevel=0
DEBUG|settings.c:0743:settings_load_ovl()| hass.name=teddyCloud - Server
DEBUG|settings.c:0743:settings_load_ovl()| hass.id=teddyCloud_Server
INFO |tls_adapter.c:0208:read_certificate()| File 'certs/server/ca-root.pem' assumed PEM style
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/server/ca-key.pem' detected as DER style RSA PRIVATE KEY
INFO |tls_adapter.c:0208:read_certificate()| File 'certs/server/teddy-cert.pem' assumed PEM style
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/server/teddy-key.pem' detected as DER style RSA PRIVATE KEY
INFO |tls_adapter.c:0201:read_certificate()| File 'certs/client/ca.der' detected as DER style CERTIFICATE
INFO |tls_adapter.c:0201:read_certificate()| File 'certs/client/client.der' detected as DER style CERTIFICATE
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/client/private.der' detected as DER style RSA PRIVATE KEY
INFO |settings.c:0622:settings_load_ovl()| Load settings from config/config.overlay.ini
DEBUG|settings.c:0743:settings_load_ovl()| commonName=
DEBUG|settings.c:0743:settings_load_ovl()| boxName=teddyCloud Box
DEBUG|settings.c:0743:settings_load_ovl()| core.client_cert.file.crt=certs/client/client.der
DEBUG|settings.c:0743:settings_load_ovl()| core.client_cert.file.key=certs/client/private.der
INFO |tls_adapter.c:0208:read_certificate()| File 'certs/server/ca-root.pem' assumed PEM style
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/server/ca-key.pem' detected as DER style RSA PRIVATE KEY
INFO |tls_adapter.c:0208:read_certificate()| File 'certs/server/teddy-cert.pem' assumed PEM style
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/server/teddy-key.pem' detected as DER style RSA PRIVATE KEY
INFO |tls_adapter.c:0201:read_certificate()| File 'certs/client/ca.der' detected as DER style CERTIFICATE
INFO |tls_adapter.c:0201:read_certificate()| File 'certs/client/client.der' detected as DER style CERTIFICATE
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/client/private.der' detected as DER style RSA PRIVATE KEY
INFO |tls_adapter.c:0387:tls_adapter_init()| Loading certificates...
INFO |tls_adapter.c:0208:read_certificate()| File 'certs/server/ca-root.pem' assumed PEM style
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/server/ca-key.pem' detected as DER style RSA PRIVATE KEY
INFO |tls_adapter.c:0208:read_certificate()| File 'certs/server/teddy-cert.pem' assumed PEM style
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/server/teddy-key.pem' detected as DER style RSA PRIVATE KEY
INFO |tls_adapter.c:0201:read_certificate()| File 'certs/client/ca.der' detected as DER style CERTIFICATE
INFO |tls_adapter.c:0201:read_certificate()| File 'certs/client/client.der' detected as DER style CERTIFICATE
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/client/private.der' detected as DER style RSA PRIVATE KEY
INFO |toniesJson.c:0053:tonies_readJson()| Trying to read config/tonies.custom.json with size 2
INFO |toniesJson.c:0053:tonies_readJson()| Trying to read config/tonies.json with size 3578128
cyclone/cyclone_crypto/cipher/aes.c:260:47: runtime error: left shift of 254 by 24 places cannot be represented in type 'int'
cyclone/cyclone_crypto/cipher/aes.c:268:55: runtime error: left shift of 243 by 24 places cannot be represented in type 'int'
cyclone/cyclone_crypto/cipher/aes.c:385:34: runtime error: left shift of 216 by 24 places cannot be represented in type 'int'
cyclone/cyclone_crypto/cipher/aes.c:395:34: runtime error: left shift of 187 by 24 places cannot be represented in type 'int'
cyclone/cyclone_crypto/cipher/aes.c:400:34: runtime error: left shift of 250 by 24 places cannot be represented in type 'int'
cyclone/cyclone_crypto/cipher/aes.c:390:34: runtime error: left shift of 183 by 24 places cannot be represented in type 'int'
src/cyclone/cyclone_crypto/mpi.c:792:48: runtime error: left shift of 255 by 24 places cannot be represented in type 'int'
INFO |server.c:0564:server_init()| 1 open HTTPS connections
DEBUG|server.c:0123:httpServerRequestCallback()| No certificate authentication
DEBUG|server.c:0126:httpServerRequestCallback()|  >> client requested '/api/stats' via GET 
DEBUG|server.c:0123:httpServerRequestCallback()| No certificate authentication
DEBUG|server.c:0126:httpServerRequestCallback()|  >> client requested '/api/stats' via GET 
INFO |server.c:0564:server_init()| 2 open HTTPS connections
DEBUG|server.c:0123:httpServerRequestCallback()| No certificate authentication
DEBUG|server.c:0126:httpServerRequestCallback()|  >> client requested '/api/stats' via GET 
INFO |server.c:0564:server_init()| 3 open HTTPS connections
DEBUG|server.c:0123:httpServerRequestCallback()| No certificate authentication
DEBUG|server.c:0126:httpServerRequestCallback()|  >> client requested 'index.shtm' via GET 
DEBUG|server.c:0123:httpServerRequestCallback()| No certificate authentication
DEBUG|server.c:0126:httpServerRequestCallback()|  >> client requested '/library/esptool.js' via GET 
DEBUG|server.c:0123:httpServerRequestCallback()| No certificate authentication
DEBUG|server.c:0126:httpServerRequestCallback()|  >> client requested '/v1/time' via GET 
INFO |handler_cloud.c:0038:handleCloudTime()|  >> respond with current time
INFO |mqtt.c:0684:mqtt_init_box()| Skipping client 'Toniebox' (cn: 'default')
DEBUG|server.c:0123:httpServerRequestCallback()| No certificate authentication
DEBUG|server.c:0126:httpServerRequestCallback()|  >> client requested '/api/stats' via GET 
DEBUG|server.c:0123:httpServerRequestCallback()| No certificate authentication
DEBUG|server.c:0126:httpServerRequestCallback()|  >> client requested '/api/fileIndex' via GET 
INFO |handler_api.c:0094:queryPrepare()| requested index for 'content'
DEBUG|server.c:0123:httpServerRequestCallback()| No certificate authentication
DEBUG|server.c:0126:httpServerRequestCallback()|  >> client requested '/api/toniesJson' via GET 
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 657A5C2A unknown but previous content known by model .
DEBUG|server.c:0123:httpServerRequestCallback()| No certificate authentication
DEBUG|server.c:0126:httpServerRequestCallback()|  >> client requested '/api/toniesCustomJson' via GET 
DEBUG|server.c:0123:httpServerRequestCallback()| No certificate authentication
DEBUG|server.c:0126:httpServerRequestCallback()|  >> client requested '/api/get/internal.version.v_long' via GET 
DEBUG|server.c:0123:httpServerRequestCallback()| No certificate authentication
DEBUG|server.c:0126:httpServerRequestCallback()|  >> client requested '/api/getIndex' via GET 
INFO |server.c:0564:server_init()| 4 open HTTPS connections
DEBUG|server.c:0123:httpServerRequestCallback()| No certificate authentication
DEBUG|server.c:0126:httpServerRequestCallback()|  >> client requested '/img_unknown.png' via GET 
DEBUG|server.c:0123:httpServerRequestCallback()| No certificate authentication
DEBUG|server.c:0126:httpServerRequestCallback()|  >> client requested '/api/fileIndex' via GET 
INFO |handler_api.c:0094:queryPrepare()| requested index for 'content'
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 657A5C2A unknown but previous content known by model .
DEBUG|server.c:0123:httpServerRequestCallback()| No certificate authentication
DEBUG|server.c:0126:httpServerRequestCallback()|  >> client requested '/api/stats' via GET 
DEBUG|server.c:0123:httpServerRequestCallback()| No certificate authentication
DEBUG|server.c:0126:httpServerRequestCallback()|  >> client requested '/api/fileIndex' via GET 
INFO |handler_api.c:0094:queryPrepare()| requested index for 'content'
INFO |server.c:0564:server_init()| 3 open HTTPS connections
DEBUG|server.c:0123:httpServerRequestCallback()| No certificate authentication
DEBUG|server.c:0126:httpServerRequestCallback()|  >> client requested '/api/stats' via GET 
INFO |server.c:0564:server_init()| 4 open HTTPS connections
INFO |server.c:0564:server_init()| 5 open HTTPS connections
DEBUG|server.c:0116:httpServerRequestCallback()| Certificate authentication:
DEBUG|server.c:0117:httpServerRequestCallback()|   Issuer:     'Boxine Factory SubCA 13'
DEBUG|server.c:0118:httpServerRequestCallback()|   Subject:    ''
DEBUG|server.c:0119:httpServerRequestCallback()|   Serial:     ''
DEBUG|server.c:0126:httpServerRequestCallback()|  >> client requested '/v1/freshness-check' via POST 
INFO |server.c:0247:httpServerRequestCallback()| UA=toniebox-esp32-eu/v5.229.0, ESPFW=eu/v5.229.0
INFO |mqtt.c:0698:mqtt_init_box()| Registered new box 'teddyCloud Box ' (cn: '')
INFO |mqtt.c:0699:mqtt_init_box()| Using base path 'teddyCloud/box/' and id 'teddyCloud_Box_'
DEBUG|home_assistant.c:0073:ha_publish()| [HA] Publish
DEBUG|home_assistant.c:0073:ha_publish()| [HA] Publish
INFO |handler_cloud.c:0568:handleCloudFreshnessCheck()| Content (416 of 416)
INFO |handler_cloud.c:0576:handleCloudFreshnessCheck()| Found 26 tonies:
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 657A5C2A unknown but previous content known by model .
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: , nocloud: 0, live: 0, updated: 0, audioid: 657A5C2A (2023-12-14 01:36:42), audioid-server: 657A5C2A (2023-12-14 01:36:42)
.
.
.
INFO |cloud_request.c:0126:cloud_request()| Connecting to HTTP server prod.de.tbs.toys:443...
INFO |cloud_request.c:0174:cloud_request()|   trying IP: 3.69.182.181
INFO |cloud_request.c:0036:httpClientTlsInitCallback()| Initializing TLS...
INFO |cloud_request.c:0081:httpClientTlsInitCallback()| Initializing TLS done
INFO |handler_api.c:0383:handleApiSet()| Setting: 'cloud.cacheContent' to 'false'
INFO |settings.c:0622:settings_load_ovl()| Load settings from config/config.overlay.ini
INFO |tls_adapter.c:0208:read_certificate()| File 'certs/server/ca-root.pem' assumed PEM style
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/server/ca-key.pem' detected as DER style RSA PRIVATE KEY
INFO |tls_adapter.c:0208:read_certificate()| File 'certs/server/teddy-cert.pem' assumed PEM style
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/server/teddy-key.pem' detected as DER style RSA PRIVATE KEY
INFO |tls_adapter.c:0201:read_certificate()| File 'certs/client/ca.der' detected as DER style CERTIFICATE
INFO |tls_adapter.c:0201:read_certificate()| File 'certs/client/client.der' detected as DER style CERTIFICATE
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/client/private.der' detected as DER style RSA PRIVATE KEY
=================================================================
==9==ERROR: AddressSanitizer: heap-use-after-free on address 0x61c000369880 at pc 0x5636534cc835 bp 0x7f06ddaf7270 sp 0x7f06ddaf7260
READ of size 1 at 0x61c000369880 thread T36
    #0 0x5636534cc834 in pemFindTag cyclone/cyclone_crypto/pkix/pem_common.c:349
    #1 0x5636534ce234 in pemDecodeFile cyclone/cyclone_crypto/pkix/pem_common.c:67
    #2 0x5636534c7898 in pemImportRsaPrivateKey cyclone/cyclone_crypto/pkix/pem_import.c:409
    #3 0x563653475128 in tls12GenerateSignature cyclone/cyclone_ssl/tls_signature.c:701
    #4 0x56365346b5f8 in tlsFormatCertificateVerify cyclone/cyclone_ssl/tls_common.c:713
    #5 0x56365346b5f8 in tlsSendCertificateVerify cyclone/cyclone_ssl/tls_common.c:215
    #6 0x563653450e27 in tlsPerformClientHandshake cyclone/cyclone_ssl/tls_client_fsm.c:123
    #7 0x563653426be8 in httpClientConnect cyclone/cyclone_tcp/http/http_client.c:314
    #8 0x5636533518b6 in cloud_request src/cloud_request.c:178
    #9 0x5636533553ca in cloud_request_post src/cloud_request.c:94
    #10 0x56365339ee93 in handleCloudFreshnessCheck src/handler_cloud.c:674
    #11 0x56365352edd1 in httpConnectionTask src/cyclone/cyclone_tcp/http/http_server.c:546
    #12 0x7f06f2e38ac2  (/lib/x86_64-linux-gnu/libc.so.6+0x94ac2)
    #13 0x7f06f2ec9bf3 in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x125bf3)

0x61c000369880 is located 0 bytes inside of 1703-byte region [0x61c000369880,0x61c000369f27)
freed by thread T37 here:
    #0 0x563653302197 in free (/usr/local/bin/teddycloud+0x5fc197)
    #1 0x5636533e09fd in settings_deinit src/settings.c:409

previously allocated by thread T0 here:
    #0 0x5636532a9627 in strdup (/usr/local/bin/teddycloud+0x5a3627)
    #1 0x5636533e88cf in settings_set_string_id src/settings.c:1132

Thread T36 created by T0 here:
    #0 0x5636532a6305 in pthread_create (/usr/local/bin/teddycloud+0x5a0305)
    #1 0x56365379a9e3 in osCreateTask src/cyclone/common/os_port_posix.c:87

Thread T37 created by T0 here:
    #0 0x5636532a6305 in pthread_create (/usr/local/bin/teddycloud+0x5a0305)
    #1 0x56365379a9e3 in osCreateTask src/cyclone/common/os_port_posix.c:87

SUMMARY: AddressSanitizer: heap-use-after-free cyclone/cyclone_crypto/pkix/pem_common.c:349 in pemFindTag
Shadow bytes around the buggy address:
  0x0c38800652c0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
    0x0c38800652d0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c38800652e0: fd fd fd fd fd fa fa fa fa fa fa fa fa fa fa fa
  0x0c38800652f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c3880065300: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
=>0x0c3880065310:[fd]fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c3880065320: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c3880065330: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c3880065340: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c3880065350: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c3880065360: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
  Shadow gap:              cc
==9==ABORTING
jensMF commented 9 months ago

And this is the beginning of the actual session:

INFO |settings.c:0622:settings_load_ovl()| Load settings from config/config.overlay.ini
INFO |tls_adapter.c:0208:read_certificate()| File 'certs/server/ca-root.pem' assumed PEM style
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/server/ca-key.pem' detected as DER style RSA PRIVATE KEY
INFO |tls_adapter.c:0208:read_certificate()| File 'certs/server/teddy-cert.pem' assumed PEM style
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/server/teddy-key.pem' detected as DER style RSA PRIVATE KEY
INFO |tls_adapter.c:0201:read_certificate()| File 'certs/client/ca.der' detected as DER style CERTIFICATE
INFO |tls_adapter.c:0201:read_certificate()| File 'certs/client/client.der' detected as DER style CERTIFICATE
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/client/private.der' detected as DER style RSA PRIVATE KEY
INFO |settings.c:0622:settings_load_ovl()| Load settings from config/config.ini
INFO |tls_adapter.c:0208:read_certificate()| File 'certs/server/ca-root.pem' assumed PEM style
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/server/ca-key.pem' detected as DER style RSA PRIVATE KEY
INFO |tls_adapter.c:0208:read_certificate()| File 'certs/server/teddy-cert.pem' assumed PEM style
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/server/teddy-key.pem' detected as DER style RSA PRIVATE KEY
INFO |tls_adapter.c:0201:read_certificate()| File 'certs/client/ca.der' detected as DER style CERTIFICATE
INFO |tls_adapter.c:0201:read_certificate()| File 'certs/client/client.der' detected as DER style CERTIFICATE
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/client/private.der' detected as DER style RSA PRIVATE KEY
INFO |settings.c:0622:settings_load_ovl()| Load settings from config/config.overlay.ini
INFO |tls_adapter.c:0208:read_certificate()| File 'certs/server/ca-root.pem' assumed PEM style
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/server/ca-key.pem' detected as DER style RSA PRIVATE KEY
INFO |tls_adapter.c:0208:read_certificate()| File 'certs/server/teddy-cert.pem' assumed PEM style
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/server/teddy-key.pem' detected as DER style RSA PRIVATE KEY
INFO |tls_adapter.c:0201:read_certificate()| File 'certs/client/ca.der' detected as DER style CERTIFICATE
INFO |tls_adapter.c:0201:read_certificate()| File 'certs/client/client.der' detected as DER style CERTIFICATE
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/client/private.der' detected as DER style RSA PRIVATE KEY
INFO |tls_adapter.c:0387:tls_adapter_init()| Loading certificates...
INFO |tls_adapter.c:0208:read_certificate()| File 'certs/server/ca-root.pem' assumed PEM style
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/server/ca-key.pem' detected as DER style RSA PRIVATE KEY
INFO |tls_adapter.c:0208:read_certificate()| File 'certs/server/teddy-cert.pem' assumed PEM style
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/server/teddy-key.pem' detected as DER style RSA PRIVATE KEY
INFO |tls_adapter.c:0201:read_certificate()| File 'certs/client/ca.der' detected as DER style CERTIFICATE
INFO |tls_adapter.c:0201:read_certificate()| File 'certs/client/client.der' detected as DER style CERTIFICATE
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/client/private.der' detected as DER style RSA PRIVATE KEY
INFO |toniesJson.c:0053:tonies_readJson()| Trying to read config/tonies.custom.json with size 2
INFO |toniesJson.c:0053:tonies_readJson()| Trying to read config/tonies.json with size 3578253
cyclone/cyclone_crypto/cipher/aes.c:268:55: runtime error: left shift of 249 by 24 places cannot be represented in type 'int'
cyclone/cyclone_crypto/cipher/aes.c:260:47: runtime error: left shift of 255 by 24 places cannot be represented in type 'int'
cyclone/cyclone_crypto/cipher/aes.c:400:34: runtime error: left shift of 174 by 24 places cannot be represented in type 'int'
cyclone/cyclone_crypto/cipher/aes.c:390:34: runtime error: left shift of 216 by 24 places cannot be represented in type 'int'
cyclone/cyclone_crypto/cipher/aes.c:395:34: runtime error: left shift of 202 by 24 places cannot be represented in type 'int'
cyclone/cyclone_crypto/cipher/aes.c:385:34: runtime error: left shift of 249 by 24 places cannot be represented in type 'int'
src/cyclone/cyclone_crypto/mpi.c:792:48: runtime error: left shift of 255 by 24 places cannot be represented in type 'int'
INFO |server.c:0564:server_init()| 1 open HTTPS connections
INFO |handler_cloud.c:0038:handleCloudTime()|  >> respond with current time
INFO |mqtt.c:0684:mqtt_init_box()| Skipping client 'Toniebox' (cn: 'default')
INFO |handler_cloud.c:0038:handleCloudTime()|  >> respond with current time
INFO |mqtt.c:0684:mqtt_init_box()| Skipping client 'Toniebox' (cn: 'default')
INFO |handler_cloud.c:0038:handleCloudTime()|  >> respond with current time
INFO |mqtt.c:0684:mqtt_init_box()| Skipping client 'Toniebox' (cn: 'default')
INFO |handler_cloud.c:0038:handleCloudTime()|  >> respond with current time
INFO |mqtt.c:0684:mqtt_init_box()| Skipping client 'Toniebox' (cn: 'default')
INFO |handler_cloud.c:0038:handleCloudTime()|  >> respond with current time
SciLor commented 9 months ago

Please delete the config*.ini files, so teddyCloud is creating new ones and try again. (So it isn't using the cloud) If this works it is an indicator, that there may be a problem with your client certificates.

jensMF commented 9 months ago

I did this here is the log for the first start afterwards:

INFO |settings.c:0622:settings_load_ovl()| Load settings from config/config.overlay.ini
INFO |settings.c:0622:settings_load_ovl()| Load settings from config/config.ini
INFO |tls_adapter.c:0208:read_certificate()| File 'certs/server/ca-root.pem' assumed PEM style
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/server/ca-key.pem' detected as DER style RSA PRIVATE KEY
INFO |tls_adapter.c:0208:read_certificate()| File 'certs/server/teddy-cert.pem' assumed PEM style
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/server/teddy-key.pem' detected as DER style RSA PRIVATE KEY
INFO |tls_adapter.c:0201:read_certificate()| File 'certs/client/ca.der' detected as DER style CERTIFICATE
INFO |tls_adapter.c:0201:read_certificate()| File 'certs/client/client.der' detected as DER style CERTIFICATE
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/client/private.der' detected as DER style RSA PRIVATE KEY
INFO |settings.c:0622:settings_load_ovl()| Load settings from config/config.overlay.ini
INFO |tls_adapter.c:0387:tls_adapter_init()| Loading certificates...
INFO |tls_adapter.c:0208:read_certificate()| File 'certs/server/ca-root.pem' assumed PEM style
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/server/ca-key.pem' detected as DER style RSA PRIVATE KEY
INFO |tls_adapter.c:0208:read_certificate()| File 'certs/server/teddy-cert.pem' assumed PEM style
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/server/teddy-key.pem' detected as DER style RSA PRIVATE KEY
INFO |tls_adapter.c:0201:read_certificate()| File 'certs/client/ca.der' detected as DER style CERTIFICATE
INFO |tls_adapter.c:0201:read_certificate()| File 'certs/client/client.der' detected as DER style CERTIFICATE
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/client/private.der' detected as DER style RSA PRIVATE KEY
INFO |toniesJson.c:0053:tonies_readJson()| Trying to read config/tonies.custom.json with size 2
INFO |toniesJson.c:0053:tonies_readJson()| Trying to read config/tonies.json with size 3578403

here is the second start:

INFO |settings.c:0622:settings_load_ovl()| Load settings from config/config.overlay.ini
INFO |settings.c:0622:settings_load_ovl()| Load settings from config/config.ini
INFO |tls_adapter.c:0208:read_certificate()| File 'certs/server/ca-root.pem' assumed PEM style
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/server/ca-key.pem' detected as DER style RSA PRIVATE KEY
INFO |tls_adapter.c:0208:read_certificate()| File 'certs/server/teddy-cert.pem' assumed PEM style
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/server/teddy-key.pem' detected as DER style RSA PRIVATE KEY
INFO |tls_adapter.c:0201:read_certificate()| File 'certs/client/ca.der' detected as DER style CERTIFICATE
INFO |tls_adapter.c:0201:read_certificate()| File 'certs/client/client.der' detected as DER style CERTIFICATE
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/client/private.der' detected as DER style RSA PRIVATE KEY
INFO |settings.c:0622:settings_load_ovl()| Load settings from config/config.overlay.ini
INFO |tls_adapter.c:0387:tls_adapter_init()| Loading certificates...
INFO |tls_adapter.c:0208:read_certificate()| File 'certs/server/ca-root.pem' assumed PEM style
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/server/ca-key.pem' detected as DER style RSA PRIVATE KEY
INFO |tls_adapter.c:0208:read_certificate()| File 'certs/server/teddy-cert.pem' assumed PEM style
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/server/teddy-key.pem' detected as DER style RSA PRIVATE KEY
INFO |tls_adapter.c:0201:read_certificate()| File 'certs/client/ca.der' detected as DER style CERTIFICATE
INFO |tls_adapter.c:0201:read_certificate()| File 'certs/client/client.der' detected as DER style CERTIFICATE
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/client/private.der' detected as DER style RSA PRIVATE KEY
INFO |toniesJson.c:0053:tonies_readJson()| Trying to read config/tonies.custom.json with size 2
INFO |toniesJson.c:0053:tonies_readJson()| Trying to read config/tonies.json with size 4078648
INFO |handler_cloud.c:0038:handleCloudTime()|  >> respond with current time
INFO |mqtt.c:0684:mqtt_init_box()| Skipping client 'Toniebox' (cn: 'default')
cyclone/cyclone_crypto/cipher/aes.c:268:55: runtime error: left shift of 216 by 24 places cannot be represented in type 'int'
cyclone/cyclone_crypto/cipher/aes.c:260:47: runtime error: left shift of 236 by 24 places cannot be represented in type 'int'
cyclone/cyclone_crypto/cipher/aes.c:400:34: runtime error: left shift of 235 by 24 places cannot be represented in type 'int'
cyclone/cyclone_crypto/cipher/aes.c:385:34: runtime error: left shift of 239 by 24 places cannot be represented in type 'int'
cyclone/cyclone_crypto/cipher/aes.c:390:34: runtime error: left shift of 143 by 24 places cannot be represented in type 'int'
cyclone/cyclone_crypto/cipher/aes.c:395:34: runtime error: left shift of 163 by 24 places cannot be represented in type 'int'
src/cyclone/cyclone_crypto/mpi.c:792:48: runtime error: left shift of 255 by 24 places cannot be represented in type 'int'
WARN |tls_server_fsm.c:0260:tlsPerformServerHandshake()| TLS handshake failure!
INFO |handler_cloud.c:0038:handleCloudTime()|  >> respond with current time
INFO |mqtt.c:0684:mqtt_init_box()| Skipping client 'Toniebox' (cn: 'default')
INFO |server.c:0564:server_init()| 1 open HTTPS connections
INFO |server.c:0564:server_init()| 0 open HTTPS connections
INFO |handler_cloud.c:0038:handleCloudTime()|  >> respond with current time
INFO |mqtt.c:0684:mqtt_init_box()| Skipping client 'Toniebox' (cn: 'default')
INFO |handler_cloud.c:0038:handleCloudTime()|  >> respond with current time
INFO |mqtt.c:0684:mqtt_init_box()| Skipping client 'Toniebox' (cn: 'default')
INFO |handler_cloud.c:0038:handleCloudTime()|  >> respond with current time
INFO |mqtt.c:0684:mqtt_init_box()| Skipping client 'Toniebox' (cn: 'default')
INFO |handler_api.c:0094:queryPrepare()| requested index for 'content'
INFO |handler_cloud.c:0038:handleCloudTime()|  >> respond with current time
INFO |mqtt.c:0684:mqtt_init_box()| Skipping client 'Toniebox' (cn: 'default')
INFO |handler_cloud.c:0038:handleCloudTime()|  >> respond with current time
INFO |mqtt.c:0684:mqtt_init_box()| Skipping client 'Toniebox' (cn: 'default')
INFO |handler_cloud.c:0038:handleCloudTime()|  >> respond with current time
INFO |mqtt.c:0684:mqtt_init_box()| Skipping client 'Toniebox' (cn: 'default')

after a second time I deleted the config.*ini files the first run look like this:

INFO |settings.c:0622:settings_load_ovl()| Load settings from config/config.overlay.ini
WARN |settings.c:0630:settings_load_ovl()| Config file does not exist, creating it...
INFO |settings.c:0517:settings_save_ovl()| Save settings to config/config.overlay.ini
INFO |settings.c:0622:settings_load_ovl()| Load settings from config/config.ini
WARN |settings.c:0630:settings_load_ovl()| Config file does not exist, creating it...
INFO |settings.c:0517:settings_save_ovl()| Save settings to config/config.ini
INFO |settings.c:0622:settings_load_ovl()| Load settings from config/config.overlay.ini
INFO |tls_adapter.c:0387:tls_adapter_init()| Loading certificates...
INFO |tls_adapter.c:0208:read_certificate()| File 'certs/server/ca-root.pem' assumed PEM style
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/server/ca-key.pem' detected as DER style RSA PRIVATE KEY
INFO |tls_adapter.c:0208:read_certificate()| File 'certs/server/teddy-cert.pem' assumed PEM style
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/server/teddy-key.pem' detected as DER style RSA PRIVATE KEY
INFO |tls_adapter.c:0201:read_certificate()| File 'certs/client/ca.der' detected as DER style CERTIFICATE
INFO |tls_adapter.c:0201:read_certificate()| File 'certs/client/client.der' detected as DER style CERTIFICATE
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/client/private.der' detected as DER style RSA PRIVATE KEY
INFO |toniesJson.c:0053:tonies_readJson()| Trying to read config/tonies.custom.json with size 2
INFO |toniesJson.c:0053:tonies_readJson()| Trying to read config/tonies.json with size 4078648
INFO |settings.c:1152:settings_loop()| Settings file changed. Reloading.
INFO |settings.c:0622:settings_load_ovl()| Load settings from config/config.ini
INFO |tls_adapter.c:0208:read_certificate()| File 'certs/server/ca-root.pem' assumed PEM style
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/server/ca-key.pem' detected as DER style RSA PRIVATE KEY
INFO |tls_adapter.c:0208:read_certificate()| File 'certs/server/teddy-cert.pem' assumed PEM style
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/server/teddy-key.pem' detected as DER style RSA PRIVATE KEY
INFO |tls_adapter.c:0201:read_certificate()| File 'certs/client/ca.der' detected as DER style CERTIFICATE
INFO |tls_adapter.c:0201:read_certificate()| File 'certs/client/client.der' detected as DER style CERTIFICATE
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/client/private.der' detected as DER style RSA PRIVATE KEY
INFO |settings.c:0622:settings_load_ovl()| Load settings from config/config.overlay.ini
cyclone/cyclone_crypto/cipher/aes.c:260:47: runtime error: left shift of 196 by 24 places cannot be represented in type 'int'
cyclone/cyclone_crypto/cipher/aes.c:268:55: runtime error: left shift of 133 by 24 places cannot be represented in type 'int'
cyclone/cyclone_crypto/cipher/aes.c:385:34: runtime error: left shift of 196 by 24 places cannot be represented in type 'int'
cyclone/cyclone_crypto/cipher/aes.c:390:34: runtime error: left shift of 247 by 24 places cannot be represented in type 'int'
cyclone/cyclone_crypto/cipher/aes.c:400:34: runtime error: left shift of 254 by 24 places cannot be represented in type 'int'
cyclone/cyclone_crypto/cipher/aes.c:395:34: runtime error: left shift of 132 by 24 places cannot be represented in type 'int'
src/cyclone/cyclone_crypto/mpi.c:792:48: runtime error: left shift of 255 by 24 places cannot be represented in type 'int'
INFO |server.c:0564:server_init()| 1 open HTTPS connections
INFO |server.c:0564:server_init()| 0 open HTTPS connections
INFO |handler_cloud.c:0038:handleCloudTime()|  >> respond with current time
INFO |mqtt.c:0684:mqtt_init_box()| Skipping client 'Toniebox' (cn: 'default')
INFO |server.c:0564:server_init()| 1 open HTTPS connections
INFO |handler_cloud.c:0038:handleCloudTime()|  >> respond with current time
INFO |mqtt.c:0684:mqtt_init_box()| Skipping client 'Toniebox' (cn: 'default')
INFO |handler_api.c:0094:queryPrepare()| requested index for 'content'
INFO |server.c:0564:server_init()| 4 open HTTPS connections
INFO |handler_api.c:0383:handleApiSet()| Setting: 'cloud.cacheContent' to 'true'
INFO |settings.c:0622:settings_load_ovl()| Load settings from config/config.overlay.ini
INFO |handler_api.c:0383:handleApiSet()| Setting: 'cloud.dumpRuidAuthContentJson' to 'true'
INFO |settings.c:0622:settings_load_ovl()| Load settings from config/config.overlay.ini
INFO |handler_api.c:0383:handleApiSet()| Setting: 'log.logFullAuth' to 'true'
INFO |settings.c:0622:settings_load_ovl()| Load settings from config/config.overlay.ini
INFO |handler_api.c:0383:handleApiSet()| Setting: 'rtnl.logHuman' to 'true'
INFO |settings.c:0622:settings_load_ovl()| Load settings from config/config.overlay.ini
INFO |handler_api.c:0383:handleApiSet()| Setting: 'rtnl.logRaw' to 'true'
INFO |settings.c:0622:settings_load_ovl()| Load settings from config/config.overlay.ini
INFO |handler_api.c:0301:handleApiTrigger()| Triggered WriteConfig
INFO |settings.c:0517:settings_save_ovl()| Save settings to config/config.ini
INFO |settings.c:0517:settings_save_ovl()| Save settings to config/config.overlay.ini
INFO |settings.c:1152:settings_loop()| Settings file changed. Reloading.
INFO |settings.c:0622:settings_load_ovl()| Load settings from config/config.ini
INFO |tls_adapter.c:0208:read_certificate()| File 'certs/server/ca-root.pem' assumed PEM style
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/server/ca-key.pem' detected as DER style RSA PRIVATE KEY
INFO |tls_adapter.c:0208:read_certificate()| File 'certs/server/teddy-cert.pem' assumed PEM style
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/server/teddy-key.pem' detected as DER style RSA PRIVATE KEY
INFO |tls_adapter.c:0201:read_certificate()| File 'certs/client/ca.der' detected as DER style CERTIFICATE
INFO |tls_adapter.c:0201:read_certificate()| File 'certs/client/client.der' detected as DER style CERTIFICATE
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/client/private.der' detected as DER style RSA PRIVATE KEY
INFO |settings.c:0622:settings_load_ovl()| Load settings from config/config.overlay.ini
INFO |handler_cloud.c:0038:handleCloudTime()|  >> respond with current time
INFO |mqtt.c:0684:mqtt_init_box()| Skipping client 'Toniebox' (cn: 'default')
INFO |handler_cloud.c:0038:handleCloudTime()|  >> respond with current time
INFO |mqtt.c:0684:mqtt_init_box()| Skipping client 'Toniebox' (cn: 'default')

(I think these errors

cyclone/cyclone_crypto/cipher/aes.c:260:47: runtime error: left shift of 196 by 24 places cannot be represented in type 'int'
cyclone/cyclone_crypto/cipher/aes.c:268:55: runtime error: left shift of 133 by 24 places cannot be represented in type 'int'
cyclone/cyclone_crypto/cipher/aes.c:385:34: runtime error: left shift of 196 by 24 places cannot be represented in type 'int'
cyclone/cyclone_crypto/cipher/aes.c:390:34: runtime error: left shift of 247 by 24 places cannot be represented in type 'int'
cyclone/cyclone_crypto/cipher/aes.c:400:34: runtime error: left shift of 254 by 24 places cannot be represented in type 'int'
cyclone/cyclone_crypto/cipher/aes.c:395:34: runtime error: left shift of 132 by 24 places cannot be represented in type 'int'
src/cyclone/cyclone_crypto/mpi.c:792:48: runtime error: left shift of 255 by 24 places cannot be represented in type 'int'

always happen, after the config gets changed.) I did not connect the Box nor did I try to download something from the boxine/toniebox cloud since I deleted the config*.ini files.

SciLor commented 9 months ago

Please connect the box. You could long press one ear to initiate a connection from the box. If this works fine, there may be a problem with your client certificates (either they are different than usual or defective)

jensMF commented 9 months ago

Here is the first connection after deleting the config.*ini files:


INFO |handler_api.c:0094:queryPrepare()| requested index for 'content'
INFO |server.c:0564:server_init()| 4 open HTTPS connections
INFO |server.c:0564:server_init()| 5 open HTTPS connections
INFO |server.c:0564:server_init()| 6 open HTTPS connections
INFO |settings.c:0517:settings_save_ovl()| Save settings to config/config.overlay.ini
INFO |mqtt.c:0698:mqtt_init_box()| Registered new box 'teddyCloud Box ' (cn: '')
INFO |mqtt.c:0699:mqtt_init_box()| Using base path 'teddyCloud/box/' and id 'teddyCloud_Box_'
src/handler_rtnl.c:153:67: runtime error: left shift of 255 by 24 places cannot be represented in type 'int'
INFO |settings.c:1160:settings_loop()| Overlay settings file changed. Reloading.
INFO |settings.c:0622:settings_load_ovl()| Load settings from config/config.ini
INFO |tls_adapter.c:0208:read_certificate()| File 'certs/server/ca-root.pem' assumed PEM style
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/server/ca-key.pem' detected as DER style RSA PRIVATE KEY
INFO |tls_adapter.c:0208:read_certificate()| File 'certs/server/teddy-cert.pem' assumed PEM style
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/server/teddy-key.pem' detected as DER style RSA PRIVATE KEY
INFO |tls_adapter.c:0201:read_certificate()| File 'certs/client/ca.der' detected as DER style CERTIFICATE
INFO |tls_adapter.c:0201:read_certificate()| File 'certs/client/client.der' detected as DER style CERTIFICATE
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/client/private.der' detected as DER style RSA PRIVATE KEY
INFO |settings.c:0622:settings_load_ovl()| Load settings from config/config.overlay.ini
INFO |tls_adapter.c:0208:read_certificate()| File 'certs/server/ca-root.pem' assumed PEM style
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/server/ca-key.pem' detected as DER style RSA PRIVATE KEY
INFO |tls_adapter.c:0208:read_certificate()| File 'certs/server/teddy-cert.pem' assumed PEM style
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/server/teddy-key.pem' detected as DER style RSA PRIVATE KEY
INFO |tls_adapter.c:0201:read_certificate()| File 'certs/client/ca.der' detected as DER style CERTIFICATE
INFO |tls_adapter.c:0201:read_certificate()| File 'certs/client/client.der' detected as DER style CERTIFICATE
INFO |tls_adapter.c:0205:read_certificate()| File 'certs/client/private.der' detected as DER style RSA PRIVATE KEY
INFO |server.c:0247:httpServerRequestCallback()| UA=toniebox-esp32-eu/v5.229.0, ESPFW=eu/v5.229.0
INFO |handler_cloud.c:0568:handleCloudFreshnessCheck()| Content (464 of 464)
INFO |handler_cloud.c:0576:handleCloudFreshnessCheck()| Found 29 tonies:
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: E00403501B3249E0, nocloud: 0, live: 0, updated: 0, audioid: 657B8007 (2023-12-14 22:21:59)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 657B8007 unknown but previous content known by model .
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: E00403501A90A7AB, nocloud: 0, live: 0, updated: 0, audioid: 63594F3F (2022-10-26 15:16:15)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 63594F3F unknown but previous content known by model 10001693.
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: E0040350177DA983, nocloud: 0, live: 0, updated: 0, audioid: 6204BA5D (2022-02-10 07:10:21)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 6204BA5D unknown but previous content known by model 10000880.
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: E0040350187DC061, nocloud: 0, live: 0, updated: 0, audioid: 6246DB37 (2022-04-01 11:00:07)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 6246DB37 unknown but previous content known by model 10000906.
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 0000000001000000, nocloud: 0, live: 0, updated: 0, audioid: 58DE2BEB (2017-03-31 10:14:03)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 58DE2BEB unknown but previous content known by model box-de-de-01-00000000.
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 0100000001000000, nocloud: 0, live: 0, updated: 0, audioid: 57EE8975 (2016-09-30 15:49:09)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 57EE8975 unknown but previous content known by model .
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 0200000001000000, nocloud: 0, live: 0, updated: 0, audioid: 57EE8975 (2016-09-30 15:49:09)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 57EE8975 unknown but previous content known by model .
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 0300000001000000, nocloud: 0, live: 0, updated: 0, audioid: 57EE8975 (2016-09-30 15:49:09)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 57EE8975 unknown but previous content known by model .
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 0400000001000000, nocloud: 0, live: 0, updated: 0, audioid: 00000001 (special)
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 0500000001000000, nocloud: 0, live: 0, updated: 0, audioid: 00000001 (special)
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 0600000001000000, nocloud: 0, live: 0, updated: 0, audioid: 57EE8976 (2016-09-30 15:49:10)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 57EE8976 unknown but previous content known by model .
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 0700000001000000, nocloud: 0, live: 0, updated: 0, audioid: 595364DC (2017-06-28 08:12:12)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 595364DC unknown but previous content known by model box-de-de-01-00000007.
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 0800000001000000, nocloud: 0, live: 0, updated: 0, audioid: 59536396 (2017-06-28 08:06:46)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 59536396 unknown but previous content known by model box-de-de-01-00000008.
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 0900000001000000, nocloud: 0, live: 0, updated: 0, audioid: 57EE8977 (2016-09-30 15:49:11)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 57EE8977 unknown but previous content known by model .
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 0A00000001000000, nocloud: 0, live: 0, updated: 0, audioid: 595363CC (2017-06-28 08:07:40)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 595363CC unknown but previous content known by model box-de-de-01-0000000A.
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 0B00000001000000, nocloud: 0, live: 0, updated: 0, audioid: 57EE8977 (2016-09-30 15:49:11)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 57EE8977 unknown but previous content known by model .
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 0C00000001000000, nocloud: 0, live: 0, updated: 0, audioid: 00000001 (special)
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 0D00000001000000, nocloud: 0, live: 0, updated: 0, audioid: 57EE8978 (2016-09-30 15:49:12)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 57EE8978 unknown but previous content known by model .
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 0E00000001000000, nocloud: 0, live: 0, updated: 0, audioid: 57EE8978 (2016-09-30 15:49:12)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 57EE8978 unknown but previous content known by model .
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 0F00000001000000, nocloud: 0, live: 0, updated: 0, audioid: 57EE8978 (2016-09-30 15:49:12)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 57EE8978 unknown but previous content known by model .
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 1000000001000000, nocloud: 0, live: 0, updated: 0, audioid: 57EE8978 (2016-09-30 15:49:12)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 57EE8978 unknown but previous content known by model .
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 1100000001000000, nocloud: 0, live: 0, updated: 0, audioid: 59F0AC95 (2017-10-25 15:24:05)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 59F0AC95 unknown but previous content known by model box-de-de-01-00000011.
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 1200000001000000, nocloud: 0, live: 0, updated: 0, audioid: 57EE8979 (2016-09-30 15:49:13)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 57EE8979 unknown but previous content known by model .
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 1300000001000000, nocloud: 0, live: 0, updated: 0, audioid: 57EE8979 (2016-09-30 15:49:13)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 57EE8979 unknown but previous content known by model .
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 1400000001000000, nocloud: 0, live: 0, updated: 0, audioid: 57EE8979 (2016-09-30 15:49:13)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 57EE8979 unknown but previous content known by model .
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 1500000001000000, nocloud: 0, live: 0, updated: 0, audioid: 57EE897A (2016-09-30 15:49:14)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 57EE897A unknown but previous content known by model .
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 1600000001000000, nocloud: 0, live: 0, updated: 0, audioid: 57EE897A (2016-09-30 15:49:14)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 57EE897A unknown but previous content known by model .
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 1700000001000000, nocloud: 0, live: 0, updated: 0, audioid: 57EE897A (2016-09-30 15:49:14)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 57EE897A unknown but previous content known by model .
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 1800000001000000, nocloud: 0, live: 0, updated: 0, audioid: 57EE897A (2016-09-30 15:49:14)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 57EE897A unknown but previous content known by model .
INFO |handler_cloud.c:0692:handleCloudFreshnessCheck()| Freshness check response: size=14, content=
INFO |server.c:0247:httpServerRequestCallback()| UA=toniebox-esp32-eu/v5.229.0, ESPFW=eu/v5.229.0
INFO |handler_cloud.c:0089:handleCloudOTA()|  >> OTA-Request for 5 with timestamp 1669853893 (2022-12-01 00:18:13)
INFO |server.c:0247:httpServerRequestCallback()| UA=toniebox-esp32-eu/v5.229.0, ESPFW=eu/v5.229.0
INFO |handler_cloud.c:0089:handleCloudOTA()|  >> OTA-Request for 2 with timestamp 1679580879 (2023-03-23 14:14:39)
INFO |server.c:0247:httpServerRequestCallback()| UA=toniebox-esp32-eu/v5.229.0, ESPFW=eu/v5.229.0
INFO |handler_cloud.c:0089:handleCloudOTA()|  >> OTA-Request for 6 with timestamp 1534781997 (2018-08-20 16:19:57)
INFO |server.c:0247:httpServerRequestCallback()| UA=toniebox-esp32-eu/v5.229.0, ESPFW=eu/v5.229.0
INFO |handler_cloud.c:0089:handleCloudOTA()|  >> OTA-Request for 3 with timestamp 1691743093 (2023-08-11 08:38:13)
INFO |server.c:0247:httpServerRequestCallback()| UA=toniebox-esp32-eu/v5.229.0, ESPFW=eu/v5.229.0
INFO |handler_cloud.c:0568:handleCloudFreshnessCheck()| Content (464 of 464)
INFO |handler_cloud.c:0576:handleCloudFreshnessCheck()| Found 29 tonies:
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: E00403501B3249E0, nocloud: 0, live: 0, updated: 0, audioid: 657B8007 (2023-12-14 22:21:59)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 657B8007 unknown but previous content known by model .
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: E00403501A90A7AB, nocloud: 0, live: 0, updated: 0, audioid: 63594F3F (2022-10-26 15:16:15)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 63594F3F unknown but previous content known by model 10001693.
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: E0040350177DA983, nocloud: 0, live: 0, updated: 0, audioid: 6204BA5D (2022-02-10 07:10:21)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 6204BA5D unknown but previous content known by model 10000880.
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: E0040350187DC061, nocloud: 0, live: 0, updated: 0, audioid: 6246DB37 (2022-04-01 11:00:07)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 6246DB37 unknown but previous content known by model 10000906.
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 0000000001000000, nocloud: 0, live: 0, updated: 0, audioid: 58DE2BEB (2017-03-31 10:14:03)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 58DE2BEB unknown but previous content known by model box-de-de-01-00000000.
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 0100000001000000, nocloud: 0, live: 0, updated: 0, audioid: 57EE8975 (2016-09-30 15:49:09)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 57EE8975 unknown but previous content known by model .
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 0200000001000000, nocloud: 0, live: 0, updated: 0, audioid: 57EE8975 (2016-09-30 15:49:09)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 57EE8975 unknown but previous content known by model .
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 0300000001000000, nocloud: 0, live: 0, updated: 0, audioid: 57EE8975 (2016-09-30 15:49:09)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 57EE8975 unknown but previous content known by model .
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 0400000001000000, nocloud: 0, live: 0, updated: 0, audioid: 00000001 (special)
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 0500000001000000, nocloud: 0, live: 0, updated: 0, audioid: 00000001 (special)
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 0600000001000000, nocloud: 0, live: 0, updated: 0, audioid: 57EE8976 (2016-09-30 15:49:10)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 57EE8976 unknown but previous content known by model .
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 0700000001000000, nocloud: 0, live: 0, updated: 0, audioid: 595364DC (2017-06-28 08:12:12)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 595364DC unknown but previous content known by model box-de-de-01-00000007.
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 0800000001000000, nocloud: 0, live: 0, updated: 0, audioid: 59536396 (2017-06-28 08:06:46)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 59536396 unknown but previous content known by model box-de-de-01-00000008.
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 0900000001000000, nocloud: 0, live: 0, updated: 0, audioid: 57EE8977 (2016-09-30 15:49:11)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 57EE8977 unknown but previous content known by model .
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 0A00000001000000, nocloud: 0, live: 0, updated: 0, audioid: 595363CC (2017-06-28 08:07:40)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 595363CC unknown but previous content known by model box-de-de-01-0000000A.
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 0B00000001000000, nocloud: 0, live: 0, updated: 0, audioid: 57EE8977 (2016-09-30 15:49:11)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 57EE8977 unknown but previous content known by model .
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 0C00000001000000, nocloud: 0, live: 0, updated: 0, audioid: 00000001 (special)
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 0D00000001000000, nocloud: 0, live: 0, updated: 0, audioid: 57EE8978 (2016-09-30 15:49:12)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 57EE8978 unknown but previous content known by model .
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 0E00000001000000, nocloud: 0, live: 0, updated: 0, audioid: 57EE8978 (2016-09-30 15:49:12)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 57EE8978 unknown but previous content known by model .
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 0F00000001000000, nocloud: 0, live: 0, updated: 0, audioid: 57EE8978 (2016-09-30 15:49:12)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 57EE8978 unknown but previous content known by model .
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 1000000001000000, nocloud: 0, live: 0, updated: 0, audioid: 57EE8978 (2016-09-30 15:49:12)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 57EE8978 unknown but previous content known by model .
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 1100000001000000, nocloud: 0, live: 0, updated: 0, audioid: 59F0AC95 (2017-10-25 15:24:05)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 59F0AC95 unknown but previous content known by model box-de-de-01-00000011.
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 1200000001000000, nocloud: 0, live: 0, updated: 0, audioid: 57EE8979 (2016-09-30 15:49:13)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 57EE8979 unknown but previous content known by model .
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 1300000001000000, nocloud: 0, live: 0, updated: 0, audioid: 57EE8979 (2016-09-30 15:49:13)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 57EE8979 unknown but previous content known by model .
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 1400000001000000, nocloud: 0, live: 0, updated: 0, audioid: 57EE8979 (2016-09-30 15:49:13)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 57EE8979 unknown but previous content known by model .
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 1500000001000000, nocloud: 0, live: 0, updated: 0, audioid: 57EE897A (2016-09-30 15:49:14)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 57EE897A unknown but previous content known by model .
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 1600000001000000, nocloud: 0, live: 0, updated: 0, audioid: 57EE897A (2016-09-30 15:49:14)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 57EE897A unknown but previous content known by model .
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 1700000001000000, nocloud: 0, live: 0, updated: 0, audioid: 57EE897A (2016-09-30 15:49:14)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 57EE897A unknown but previous content known by model .
INFO |handler_cloud.c:0636:handleCloudFreshnessCheck()|   uid: 1800000001000000, nocloud: 0, live: 0, updated: 0, audioid: 57EE897A (2016-09-30 15:49:14)
WARN |contentJson.c:0275:content_json_update_model()| Audio-id 57EE897A unknown but previous content known by model .
INFO |handler_cloud.c:0692:handleCloudFreshnessCheck()| Freshness check response: size=14, content=
INFO |handler_cloud.c:0038:handleCloudTime()|  >> respond with current time
INFO |mqtt.c:0684:mqtt_init_box()| Skipping client 'Toniebox' (cn: 'default')
INFO |handler_cloud.c:0038:handleCloudTime()|  >> respond with current time
INFO |mqtt.c:0684:mqtt_init_box()| Skipping client 'Toniebox' (cn: 'default')
jensMF commented 9 months ago

Please connect the box. You could long press one ear to initiate a connection from the box. If this works fine, there may be a problem with your client certificates (either they are different than usual or defective)

Why do you think there could be a problem with my client certificates?

SciLor commented 9 months ago

Please connect the box. You could long press one ear to initiate a connection from the box. If this works fine, there may be a problem with your client certificates (either they are different than usual or defective)

Why do you think there could be a problem with my client certificates?

Because the problem only happens when connected to the tonies cloud and it crashes on something related to a certificate.

jensMF commented 9 months ago

Why do you think there could be a problem with my client certificates?

Because the problem only happens when connected to the tonies cloud and it crashes on something related to a certificate.

Ah, ok. But most time, it works properly. I had only these two crashes and could successfully download a few tonies. I also could download the content of a creative tonie a few times.