From 2473836074c4803030aecc609233c915e954a179 Mon Sep 17 00:00:00 2001 From: Dmitry Eremin-Solenikov Date: Mon, 9 Jul 2018 14:22:34 +0300 Subject: lib/x509: use new function to deduce default GOST paramset Use new _gnutls_gost_paramset_default() function to deduce default GOST paramset, instead of hardcoding if/else in several places. Signed-off-by: Dmitry Eremin-Solenikov --- lib/x509/key_encode.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'lib/x509/key_encode.c') diff --git a/lib/x509/key_encode.c b/lib/x509/key_encode.c index 6cd42f2c0f..bbcbab2e16 100644 --- a/lib/x509/key_encode.c +++ b/lib/x509/key_encode.c @@ -581,13 +581,8 @@ _gnutls_x509_write_gost_params(gnutls_pk_params_st * params, goto cleanup; } - if (params->algo == GNUTLS_PK_GOST_01) { - if (params->gost_params == GNUTLS_GOST_PARAMSET_CP_A) - oid = NULL; - } else { - if (params->gost_params == GNUTLS_GOST_PARAMSET_TC26_Z) - oid = NULL; - } + if (params->gost_params == _gnutls_gost_paramset_default(params->algo)) + oid = NULL; if ((result = asn1_write_value(spk, "encryptionParamSet", oid, -- cgit v1.2.1