diff options
author | Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> | 2019-11-06 20:11:21 +0300 |
---|---|---|
committer | Dmitry Belyavskiy <beldmit@users.noreply.github.com> | 2019-11-06 18:20:33 +0100 |
commit | d47b346150868622f42178994fc26f799a80410a (patch) | |
tree | c03b28ce4a6c9b5a673f75e40ba9b334caaa72f5 | |
parent | 1d07dbb32c6178caaeed77169125144cfb3beb99 (diff) | |
download | gost-engine-d47b346150868622f42178994fc26f799a80410a.zip gost-engine-d47b346150868622f42178994fc26f799a80410a.tar.gz gost-engine-d47b346150868622f42178994fc26f799a80410a.tar.bz2 |
ameth: fill digestParamSet for the sake of backwards compatibility
Even though it is not recommended by R 1323565.1.023-2018 fill
digestParamSet field for 512-bit curves Test, TC26-A, TC26-B because old
cryptoproviders expect this field to be present.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
-rw-r--r-- | gost_ameth.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gost_ameth.c b/gost_ameth.c index 22631c0..7fe05c8 100644 --- a/gost_ameth.c +++ b/gost_ameth.c @@ -79,6 +79,12 @@ static ASN1_STRING *encode_gost_algor_params(const EVP_PKEY *key) break; case NID_id_GostR3410_2012_512: pkey_param_nid = EC_GROUP_get_curve_name(EC_KEY_get0_group(key_ptr)); + switch (pkey_param_nid) { + case NID_id_tc26_gost_3410_2012_512_paramSetTest: + case NID_id_tc26_gost_3410_2012_512_paramSetA: + case NID_id_tc26_gost_3410_2012_512_paramSetB: + gkp->hash_params = OBJ_nid2obj(NID_id_GostR3411_2012_512); + } break; case NID_id_GostR3410_2001: pkey_param_nid = EC_GROUP_get_curve_name(EC_KEY_get0_group(key_ptr)); |