Annotate

util/adhoc.lua @ 10224:94e341dee51c

core.certmanager: Move EECDH ciphers before EDH in default cipherstring The original intent of having kEDH before kEECDH was that if a `dhparam` file was specified, this would be interpreted as a preference by the admin for old and well-tested Diffie-Hellman key agreement over newer elliptic curve ones. Otherwise the faster elliptic curve ciphersuites would be preferred. This didn't really work as intended since this affects the ClientHello on outgoing s2s connections, leading to some servers using poorly configured kEDH. With Debian shipping OpenSSL settings that enforce a higher security level, this caused interoperability problems with servers that use DH params smaller than 2048 bits. E.g. jabber.org at the time of this writing has 1024 bit DH params. MattJ says > Curves have won, and OpenSSL is less weird about them now
author Kim Alvefur <zash@zash.se>
date Sun, 25 Aug 2019 20:22:35 +0200
parent 8382:e5d00bf4a4d5
child 10667:49312378ba1d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8382
e5d00bf4a4d5 util: Various minor changes to please [luacheck]
Kim Alvefur <zash@zash.se>
parents: 7912
diff changeset
1 -- luacheck: ignore 212/self
e5d00bf4a4d5 util: Various minor changes to please [luacheck]
Kim Alvefur <zash@zash.se>
parents: 7912
diff changeset
2
5513
755f705f126a util.adhoc: New util for generating common adhoc handler patterns
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff changeset
3 local function new_simple_form(form, result_handler)
755f705f126a util.adhoc: New util for generating common adhoc handler patterns
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff changeset
4 return function(self, data, state)
755f705f126a util.adhoc: New util for generating common adhoc handler patterns
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff changeset
5 if state then
755f705f126a util.adhoc: New util for generating common adhoc handler patterns
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff changeset
6 if data.action == "cancel" then
755f705f126a util.adhoc: New util for generating common adhoc handler patterns
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff changeset
7 return { status = "canceled" };
755f705f126a util.adhoc: New util for generating common adhoc handler patterns
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff changeset
8 end
755f705f126a util.adhoc: New util for generating common adhoc handler patterns
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff changeset
9 local fields, err = form:data(data.form);
755f705f126a util.adhoc: New util for generating common adhoc handler patterns
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff changeset
10 return result_handler(fields, err, data);
755f705f126a util.adhoc: New util for generating common adhoc handler patterns
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff changeset
11 else
755f705f126a util.adhoc: New util for generating common adhoc handler patterns
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff changeset
12 return { status = "executing", actions = {"next", "complete", default = "complete"}, form = form }, "executing";
755f705f126a util.adhoc: New util for generating common adhoc handler patterns
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff changeset
13 end
755f705f126a util.adhoc: New util for generating common adhoc handler patterns
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff changeset
14 end
755f705f126a util.adhoc: New util for generating common adhoc handler patterns
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff changeset
15 end
755f705f126a util.adhoc: New util for generating common adhoc handler patterns
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff changeset
16
755f705f126a util.adhoc: New util for generating common adhoc handler patterns
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff changeset
17 local function new_initial_data_form(form, initial_data, result_handler)
755f705f126a util.adhoc: New util for generating common adhoc handler patterns
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff changeset
18 return function(self, data, state)
755f705f126a util.adhoc: New util for generating common adhoc handler patterns
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff changeset
19 if state then
755f705f126a util.adhoc: New util for generating common adhoc handler patterns
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff changeset
20 if data.action == "cancel" then
755f705f126a util.adhoc: New util for generating common adhoc handler patterns
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff changeset
21 return { status = "canceled" };
755f705f126a util.adhoc: New util for generating common adhoc handler patterns
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff changeset
22 end
755f705f126a util.adhoc: New util for generating common adhoc handler patterns
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff changeset
23 local fields, err = form:data(data.form);
755f705f126a util.adhoc: New util for generating common adhoc handler patterns
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff changeset
24 return result_handler(fields, err, data);
755f705f126a util.adhoc: New util for generating common adhoc handler patterns
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff changeset
25 else
755f705f126a util.adhoc: New util for generating common adhoc handler patterns
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff changeset
26 return { status = "executing", actions = {"next", "complete", default = "complete"},
7912
2c204ba8e52e util.adhoc: Pass command data to initial_data callback in order to allow loading per-user settings
Kim Alvefur <zash@zash.se>
parents: 5513
diff changeset
27 form = { layout = form, values = initial_data(data) } }, "executing";
5513
755f705f126a util.adhoc: New util for generating common adhoc handler patterns
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff changeset
28 end
755f705f126a util.adhoc: New util for generating common adhoc handler patterns
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff changeset
29 end
755f705f126a util.adhoc: New util for generating common adhoc handler patterns
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff changeset
30 end
755f705f126a util.adhoc: New util for generating common adhoc handler patterns
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff changeset
31
755f705f126a util.adhoc: New util for generating common adhoc handler patterns
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff changeset
32 return { new_simple_form = new_simple_form,
755f705f126a util.adhoc: New util for generating common adhoc handler patterns
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff changeset
33 new_initial_data_form = new_initial_data_form };