krach-protocol / smol-noice

C port of the krach IoT protocol
1 stars 0 forks source link

Trigger the necessary hardware to actually open the lock when the opening command is received. #11

Open dereulenspiegel opened 2 years ago

dereulenspiegel commented 2 years ago

When a correctly identified open command is received the ESP32 must trigger the necessary actions to actuate the lock.

dereulenspiegel commented 2 years ago

Needs implementation by @SeriousD. The point in code where to execute is already there.

SeriousD commented 2 years ago

Would be nice to get some Test-Enpoints to verify an end-to-end test

dereulenspiegel commented 2 years ago

Connector is already available, maybe @sebastian-garn might have some time to setup the connector in a project, so it can be used?

sebastian-garn commented 2 years ago

@SeriousD you have a new mail ;)

SeriousD commented 2 years ago

Unpacking Transport works against lokal test server provided by connctd but not against remote server.

Transport unpacking is the last step to a working prototype

dereulenspiegel commented 2 years ago

Unpacking actually also works against the remote server. We just the wrong expectation that the cbor message align with the underlying cryptographic record message. It didn't and doesn't need to. The server has sent the length of the cbor message in it's own record and then the message itself in another record (just like it can happen in TLS and other streaming based cryptographic protocols). Since krach needs to be agnostic about message delimination, formatting, length etc. of the upper protocol the upper protocol needs to be agnostic of krachs own record delimination. Therefore the additional length prefix of the cbor message (which got send in its own record). Solution on the client side would be to treat the incoming record as usual (read and decrypt) and let an upper protocol implementation handle the interpretation of the resulting incoming byte stream. As a quick workaround I modified the backend a bit so that command messages and krach record packets are now aligned (ugly hack) and the client side can just consume the complete message and assume that all the necessary content is there. Note: This currently only works, because we have small, infrequent messages.