From 4926888306bc0d0cc93c19efa6348f5faaacee89 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Sat, 28 Nov 2020 08:13:44 +1100 Subject: [PATCH] Fix misplaced declaration (cherry picked from commit 49b9219bb332b4025ac5d2c8fa030ed5ff4fc98d) --- lib/dns/pkcs11rsa_link.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/dns/pkcs11rsa_link.c b/lib/dns/pkcs11rsa_link.c index 022638c850..462b0b01b9 100644 --- a/lib/dns/pkcs11rsa_link.c +++ b/lib/dns/pkcs11rsa_link.c @@ -338,6 +338,8 @@ pkcs11rsa_createctx_verify(dst_key_t *key, unsigned int maxbits, for (attr = pk11_attribute_first(rsa); attr != NULL; attr = pk11_attribute_next(rsa, attr)) { + unsigned int bits; + switch (attr->type) { case CKA_MODULUS: INSIST(keyTemplate[5].type == attr->type); @@ -354,7 +356,6 @@ pkcs11rsa_createctx_verify(dst_key_t *key, unsigned int maxbits, memmove(keyTemplate[6].pValue, attr->pValue, attr->ulValueLen); keyTemplate[6].ulValueLen = attr->ulValueLen; - unsigned int bits; ret = pk11_numbits(attr->pValue, attr->ulValueLen, &bits); if (ret != ISC_R_SUCCESS || @@ -954,6 +955,9 @@ pkcs11rsa_verify(dst_context_t *dctx, const isc_region_t *sig) { for (attr = pk11_attribute_first(rsa); attr != NULL; attr = pk11_attribute_next(rsa, attr)) + { + unsigned int bits; + switch (attr->type) { case CKA_MODULUS: INSIST(keyTemplate[5].type == attr->type); @@ -964,7 +968,6 @@ pkcs11rsa_verify(dst_context_t *dctx, const isc_region_t *sig) { keyTemplate[5].ulValueLen = attr->ulValueLen; break; case CKA_PUBLIC_EXPONENT: - unsigned int bits; INSIST(keyTemplate[6].type == attr->type); keyTemplate[6].pValue = isc_mem_get(dctx->mctx, attr->ulValueLen); @@ -979,6 +982,7 @@ pkcs11rsa_verify(dst_context_t *dctx, const isc_region_t *sig) { } break; } + } pk11_ctx->object = CK_INVALID_HANDLE; pk11_ctx->ontoken = false; PK11_RET(pkcs_C_CreateObject,