Skip to content

Make (TLS) groups fully independent of (EC) curves #13767

@baentsch

Description

@baentsch

Referring to the statement by @mattcaswell in #10512

We have implemented fully pluggable KEM and KEX in libssl

wouldn't the expectation be fair that after adding new TLS (1.3) groups (via a pluggable KEM provider) those new groups should be visible/accessible in a similar way as the original (EC) curves?

More specifically, the API SSL_get_shared_group seems to behave somewhat out of line with this full integration: By returning only NIDs (of known libcrypto implementations), it effectively returns nothing if a new, Provider-implemented, TLS1.3 KEM group (PQC in this case) has been integrated and runs:

Supported Elliptic Groups: 0x0201
Shared Elliptic groups: <NULL>

TLS1.3 operates correctly with the new crypto (KEM) from the Provider (confirming the statement at the beginning), but only tries to display built-in/libcrypto-provided shared (Elliptic) groups.

In any case, the output above seems to be inconsistent: Either it should display nothing (as the new KEM is not an EC curve) OR also display the shared group (which already is shown as supported with its group ID). The reason for the NULL above is this statement in ssl/s3_lib.c:

return tls1_group_id2nid(id, 1);

A possible alternative is to amend the above return statement as follows

if (s->session->ssl_version != TLS1_3_VERSION) return tls1_group_id2nid(id, 1);

and update the documentation in doc/man3/SSL_CTX_set1_curves.pod accordingly: Amend the current

SSL_get_shared_group() returns the NID of the shared group B for a server-side SSL B.

as follows:

SSL_get_shared_group() returns the NID of the shared group B for a server-side SSL B when running SSL or TLS<1.3; for TLS1.3, returns the shared group ID.

In addition, it would be nice to amend the code in apps/lib/s_cb.c annotated "TODO(TLS1.3)" to fetch the group name. When trying to implement this I had to find I'm out of my depth here: At first look, the function tls1_group_id_lookup could deliver the TLS_GROUP_INFO structure containing all required information, however, function and data structures seem to be only (SSL-)local and not generally accessible, so some internal "API opening" may be be required for this. So, any reference to APIs I am not aware of and already delivering this functionality would be gratefully welcomed: I'd volunteer to integrate that into apps/lib/s_cb.c.

An alternative to this proposal would be a new API for TLS1.3 groups that has no relation to the old (EC) curves.

Metadata

Metadata

Assignees

Labels

branch: masterApplies to master branchtriaged: bugThe issue/pr is/fixes a bugtriaged: featureThe issue/pr requests/adds a feature

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions