otrv4 / libotr-ng

A new implementation of OTR with support for version 4. This is a mirror of https://bugs.otr.im/otrv4/libotr-ng
Other
43 stars 9 forks source link

What about policies to be used by plugins? #14

Closed juniorz closed 6 years ago

juniorz commented 7 years ago

Should we implement the policies in the plugin?

claucece commented 6 years ago

We decided to go for (from a specification perspective):

"""
ALLOW_V3
  Allow version 3 of the OTR protocol to be used.
ALLOW_V4
  Allow version 4 of the OTR protocol to be used.
REQUIRE_ENCRYPTION
  Refuse to send unencrypted messages.
SEND_WHITESPACE_TAG
  Advertise your support of OTR using the whitespace tag.
WHITESPACE_START_DAKE
  Start the OTR DAKE when you receive a whitespace tag.
ERROR_START_DAKE
  Start the OTR DAKE when you receive an OTR Error Message.
REQUIRE_INTERACTIVE
  Refuse to start with a non-interactive DAKE.
IDENTITY_START_DAKE
  Start OTR interactive DAKE with the sending of the Identity Message only.
TRY_DAKEZ_WHEN_OFFLINE
  Try to start an offline conversation with DAKEZ.
REQUIRE_AUTHENTICATED
  Always start an OTR conversation with authenticated parties only. 

From the library to plugin perspective:

#define OTRL_POLICY_NEVER                       0x00
#define OTRL_POLICY_OPPORTUNISTIC \
           ( OTRL_POLICY_ALLOW_V3 | \
            OTRL_POLICY_ALLOW_V4 | \
            OTRL_POLICY_SEND_WHITESPACE_TAG | \
            OTRL_POLICY_WHITESPACE_START_AKE | \
            OTRL_POLICY_ERROR_START_AKE )
#define OTRL_POLICY_MANUAL \
            ( OTRL_POLICY_ALLOW_V3 | \
             OTRL_POLICY_ALLOW_V4)
#define OTRL_POLICY_ALWAYS \
            ( OTRL_POLICY_ALLOW_V3 | \
             OTRL_POLICY_ALLOW_V4 | \
             OTRL_POLICY_REQUIRE_ENCRYPTION | \
             OTRL_POLICY_WHITESPACE_START_AKE | \
             OTRL_POLICY_ERROR_START_AKE )
#define OTRL_POLICY_DEFAULT OTRL_POLICY_OPPORTUNISTIC

We can further include

We can have:

OTRL_POLICY_HIGHEST_SEC 
        OTRL_POLICY_ALLOW_V3 | \
        OTRL_POLICY_ALLOW_V4 | \
        OTRL_POLICY_SEND_WHITESPACE_TAG | \
        OTRL_POLICY_WHITESPACE_START_AKE | \
        OTRL_POLICY_ERROR_START_AKE 
        REQUIRE_AUTHENTICATED | \
        REQUIRE_INTERACTIVE \
        IDENTITY_START_DAKE \
        )

OTRL_POLICY_OTRV4_FULL 
        OTRL_POLICY_ALLOW_V4 | \
        OTRL_POLICY_SEND_WHITESPACE_TAG | \
        OTRL_POLICY_WHITESPACE_START_AKE | \
        OTRL_POLICY_ERROR_START_AKE 
        )
olabini commented 6 years ago

Most of the policies should be implemented in libotr-ng - as discussed in the email thread.

claucece commented 6 years ago

@olabini yes! already had an issue for that :)

olabini commented 6 years ago

OK, this story has been broken up into several smaller stories:

145, #146, #147, #148, #149, #150, #151, #152, #153, #154 and #155.

claucece commented 6 years ago

Thanks! @olabini