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

Refactor implementation data format #7

Open
fingolfin opened this issue Apr 8, 2015 · 2 comments
Open

Refactor implementation data format #7

fingolfin opened this issue Apr 8, 2015 · 2 comments

Comments

@fingolfin
Copy link
Owner

Currently, we store the list of supported protocols as arrays like this:

protocols:
    cipher:
        - aes256-cbc
        - [email protected]
        - [email protected]
        - ...

I think this should be changed to a dictionary instead. This has multiple advantages:

  • it makes it a bit easier to test in the code if a client supports a protocol;
  • it deemphasises the (arbitrary) ordering of protocols
  • it allows adding extra information to the support for a given protocol, say, the first version the protocol was supported (the idea being that normally, the keys are booleans, but they could also be strings or more complex data).

Hypothetical example

protocols:
    cipher:
        aes256-cbc: yes
        [email protected]: "since version 2.0"
        [email protected]:
              supported: yes
              note: "since version 3.1"
        bad-algo:
              supported: no
              note: "supported dropped for security reasons in 2.7"
        ...

(Not sure whether the last veriant, with a full sub-dictionary of data, is ever needed... perhaps skip it for now, and only add it if we encounter cases that would benefit form it?)

@fingolfin
Copy link
Owner Author

Actually, thinking some more about it, the sub-dict variant might be highly useful if one also wants to distinguish whether e.g. a cipher is supported vs. "enabled by default". E.g. the "none" cipher may be supported in principle by an implementation, but a good implementation will disable it by default. Same for other unsafe protocols.

@fingolfin
Copy link
Owner Author

Also, it actually makes sense to keep the protocols in a list (i.e. ordered,) as that can be used to represent the default order in the implementation (i.e. which protocols are preferred.

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

No branches or pull requests

1 participant