]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix misplaced declaration
authorMark Andrews <marka@isc.org>
Fri, 27 Nov 2020 21:13:44 +0000 (08:13 +1100)
committerMark Andrews <marka@isc.org>
Tue, 1 Dec 2020 12:19:46 +0000 (23:19 +1100)
(cherry picked from commit 49b9219bb332b4025ac5d2c8fa030ed5ff4fc98d)

lib/dns/pkcs11rsa_link.c

index c097f3ac04c9a00345ad46369db8f2ab5e81ac9a..fd6ec0a96da0a4a95ca71f7f1e9fd701ae7b0172 100644 (file)
@@ -378,6 +378,8 @@ pkcs11rsa_createctx_verify(dst_key_t *key, unsigned int maxbits,
             attr != NULL;
             attr = pk11_attribute_next(rsa, attr))
        {
+               unsigned int bits;
+
                switch (attr->type) {
                case CKA_MODULUS:
                        INSIST(keyTemplate[5].type == attr->type);
@@ -398,7 +400,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 ||
@@ -1066,6 +1067,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);
@@ -1078,7 +1082,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);
@@ -1095,6 +1098,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,