Implement provider interface to support GOST TLS 1.3 #482
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Extension of gost-engine (provider) functionality to enable GOST TLS 1.3 support
Ref: #388
Ref: #167
The proposed changes introduce a minimal set of functionality required to enable GOST TLS 1.3 using the provider interface, along with the corresponding updates to the OpenSSL project (included as patch files).
The following provider modules were implemented or modified:
Implementation was focused on the functionality necessary for running the TLS 1.3 protocol with GOST. Support for TLS versions below 1.3 was not considered or implemented.
Detailed changelog:
internal_*
interface to allow internal engine functions to be reused in the provider implementation (seegost_lcl.h
);provider-keymgmt
to support key generation and loading for the following algorithms: gost2001, gost2001dh, gost2012_256, gost2012_512.Note: Key import and export are not implemented, as there was no requirement to exchange keys with other providers for TLS 1.3;
provider-encoder
andprovider-decoder
to support encoding and decoding of keys in the following formats: text (encoding only), DER, PEM;provider-signature
with digest mode support;provider-keyexchange
for the ECDHE algorithm; other algorithms are not required for TLS 1.3. This interface may later be extended to supportpkey_gost_ec_derive
;provider-cipher
with support for setting the following parameters:OSSL_CIPHER_PARAM_TLSTREE
(sets the sequence number),OSSL_CIPHER_PARAM_TLSTREE_MODE
(sets TLSTREE mode: strong or light — see RFC9367, 4.1.2. TLSTREE),OSSL_CIPHER_PARAM_AEAD
(whether the cipher is AEAD);Notes on GOST TLS 1.3 implementation
Sigalgs
To ensure compatibility with
openssl
CLI commands for both engine and provider modes, the original key generation and signature algorithm names were preserved:SN_id_GostR3410_2012_256
,SN_id_GostR3410_2012_512
, and others.When registering TLS 1.3 SIGALGs via the "TLS-SIGALG" capability, 7 sigalgs are registered:
With key algorithm
SN_id_GostR3410_2012_256
:gostr34102012_256a
gostr34102012_256b
gostr34102012_256c
gostr34102012_256d
With key algorithm
SN_id_GostR3410_2012_512
:gostr34102012_512a
gostr34102012_512b
gostr34102012_512c
It appears that the current OpenSSL implementation does not support multiple SIGALGs sharing the same signature algorithm. OpenSSL lacks an interface to differentiate sigalgs based on key parameters, making it impossible to map a sigalg to a specific key paramset.
Therefore, in the current implementation:
gostr34102012_256*
), regardless of the server key's paramset.Resolving this limitation is planned for a second stage of development. We assume that extending the
provider-keymgmt
interface (in coordination with OpenSSL maintainers) will be required.Testing
The GOST TLS 1.3 implementation was tested against the Infotecs test servers:
https://infotecs.ru/products/tls-test.php/
See test:
test/05-tls13.t
.OpenSSL version
All changes are based on OpenSSL version 3.4.2.