From: Dmitry Belyavskiy Date: Fri, 9 Oct 2015 17:43:51 +0000 (+0300) Subject: Calculate number of digests/ciphers/etc provided by the engine X-Git-Tag: v1.1.0.2~41 X-Git-Url: http://wagner.pp.ru/gitweb/?a=commitdiff_plain;h=01dca9b5fa92258fbf9201e43dc77f9f428fc59f;p=openssl-gost%2Fengine.git Calculate number of digests/ciphers/etc provided by the engine --- diff --git a/gost_eng.c b/gost_eng.c index 86d1a05..88229e6 100644 --- a/gost_eng.c +++ b/gost_eng.c @@ -215,7 +215,7 @@ static int gost_digests(ENGINE *e, const EVP_MD **digest, int ok = 1; if (!digest) { *nids = gost_digest_nids; - return 5; + return sizeof(gost_digest_nids)/sizeof(gost_digest_nids[0]) - 1; } if (nid == NID_id_GostR3411_94) { *digest = &digest_gost; @@ -240,7 +240,7 @@ static int gost_ciphers(ENGINE *e, const EVP_CIPHER **cipher, int ok = 1; if (!cipher) { *nids = gost_cipher_nids; - return 4; /* three ciphers are supported */ + return sizeof(gost_cipher_nids)/sizeof(gost_cipher_nids[0]) - 1; } if (nid == NID_id_Gost28147_89) { @@ -263,7 +263,7 @@ static int gost_pkey_meths(ENGINE *e, EVP_PKEY_METHOD **pmeth, { if (!pmeth) { *nids = gost_pkey_meth_nids; - return sizeof(gost_pkey_meth_nids)/sizeof(int) - 1; + return sizeof(gost_pkey_meth_nids)/sizeof(gost_pkey_meth_nids[0]) - 1; } switch (nid) { @@ -295,7 +295,7 @@ static int gost_pkey_asn1_meths(ENGINE *e, EVP_PKEY_ASN1_METHOD **ameth, { if (!ameth) { *nids = gost_pkey_meth_nids; - return sizeof(gost_pkey_meth_nids)/sizeof(int) - 1; + return sizeof(gost_pkey_meth_nids)/sizeof(gost_pkey_meth_nids[0]) - 1; } switch (nid) { case NID_id_GostR3410_2001: