hannesm / jackline

minimalistic secure XMPP client in OCaml
BSD 2-Clause "Simplified" License
251 stars 20 forks source link

SMP challenges/questions containing spaces #76

Closed cfcs closed 9 years ago

cfcs commented 9 years ago

Jackline should provide a way for users to ask SMP questions containing spaces.

New users often intuitively seem to attempt to accomplish this by quoting the question using double quotes, so maybe we should parse quotation?

What would be your preferred way to do this? Please discuss below :-)

hannesm commented 9 years ago

maybe /smp question <question> which is then followed by a read on the terminal (enter shared secret: prompt)? and provide a /smp start <shared> for the other case? quotation and being smart will break intuition (or parsers).. being explicit sounds less error-prone

hannesm commented 9 years ago

an alternative would be to delay shared secret to EXPECT_2; and have /smp question <question>, let the other side do some computation, and then /smp secret <secret> once <secret> is needed... but this would break intuition a bit (the read would break UI a bit)...

cfcs commented 9 years ago

Yeah, quotation is never going to be pretty; let's avoid as long as we can :-)

I think your first suggestion (/smp question <question consisting of several words> immediately followed by a read prompt) seems reasonable and in line with the current UI behavior.

I would suggest removing /smp start and replacing it by this /smp question (so we only have /smp question; /smp answer; /smp abort). Having both question and start to initialize sessions will be confusing to everyone.

I think the /smp question <question> idea is superior to the EXPECT_2 approach which would make long-latency introductions more tedious than they have to be by adding an extra manual step.