Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

schema for _type=lwt is requiring data #3

Open
jpmens opened this issue Dec 15, 2023 · 5 comments
Open

schema for _type=lwt is requiring data #3

jpmens opened this issue Dec 15, 2023 · 5 comments

Comments

@jpmens
Copy link
Member

jpmens commented Dec 15, 2023

As reported in owntracks/ios#755 (but likely not the reason for the crash):

2023-12-15T14:37:58.693Z  Validation error: Error Domain=com.argentumko.JSONSchemaValidationError Code=300 "JSON instance validation against the schema failed." UserInfo={path=, object={
  "_type" : "lwt",
  "tst" : 1702479180
}, NSLocalizedDescription=JSON instance validation against the schema failed., validator=<DSJSONSchemaObjectValidator: 0x2820b7260>{ maximum properties: none, minimum properties: 0, required properties: _type, data }, NSLocalizedFailureReason=Object is missing required properties: 'data'.} with {"_type":"lwt","tst":1702479180}
@ckrey
Copy link
Member

ckrey commented Dec 15, 2023

This is probably when using application level encryption. I guess lwt is not encrypted

@jpmens
Copy link
Member Author

jpmens commented Dec 15, 2023

Looking at #755 again regarding the not-encrypted lwt message: I think it's fine and logical that it's not encrypted (and it can't really be as the broker doesn't know anything about encryption), but I wonder whether it would be feasable to give the broker an LWT to transmit which has encrypted data ... ? IIRC libsodium isn't time sensitive, so technically it ought to be possible to

  1. encrypt a payload for LWT
  2. submit the LWT on connect to the broker
  3. have the broker transmit the pre-encrypted LWT when the client dies

I'm definitely not saying we should do this; I'm rather thinking out loud whether it could make sense?

A disadvantage would be that monitors (other than, say, Recorder) for LWT would not be able to decrypt the payload.

@yantoz
Copy link

yantoz commented Dec 15, 2023

This is probably when using application level encryption. I guess lwt is not encrypted

@ckrey yes, application level encryption is enabled.

@ckrey
Copy link
Member

ckrey commented Dec 16, 2023

I learned a lot about how app level encryption is used with OwnTracks...

@ckrey
Copy link
Member

ckrey commented Dec 16, 2023

Basically, old versions process encrypted and unencrypted messages well.
In the newer versions, non encrypted messages cause a crash. Will revert the change.
I believed if app level encryption is enabled everything outgoing or incoming is encrypted...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants