From: Aydın Mercan Date: Tue, 13 Jan 2026 10:40:03 +0000 (+0300) Subject: make generate_pkcs11_ec_key consistent with others X-Git-Tag: v9.21.18~2^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=251af02fe7cef6d4051347fd6f14aac05f8d6c76;p=thirdparty%2Fbind9.git make generate_pkcs11_ec_key consistent with others --- diff --git a/lib/isc/ossl_wrap/ossl3.c b/lib/isc/ossl_wrap/ossl3.c index 1478e58683e..b8da16e8e03 100644 --- a/lib/isc/ossl_wrap/ossl3.c +++ b/lib/isc/ossl_wrap/ossl3.c @@ -12,6 +12,7 @@ */ #include +#include #include #include @@ -183,13 +184,17 @@ static isc_result_t generate_pkcs11_ec_key(char *uri, EVP_PKEY **pkeyp, int nid) { isc_result_t result; EVP_PKEY_CTX *pctx; - OSSL_PARAM params[3]; + size_t len; + + INSIST(uri != NULL); + len = strlen(uri); - params[0] = OSSL_PARAM_construct_utf8_string("pkcs11_uri", uri, 0); - params[1] = OSSL_PARAM_construct_utf8_string( - "pkcs11_key_usage", pkcs11_key_usage, - sizeof(pkcs11_key_usage) - 1); - params[2] = OSSL_PARAM_construct_end(); + const OSSL_PARAM params[] = { + OSSL_PARAM_utf8_string("pkcs11_uri", uri, len), + OSSL_PARAM_utf8_string("pkcs11_key_usage", pkcs11_key_usage, + sizeof(pkcs11_key_usage) - 1), + OSSL_PARAM_END, + }; pctx = EVP_PKEY_CTX_new_from_name(NULL, "EC", "provider=pkcs11"); if (pctx == NULL) {