]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
Fix compilation error in ssh-pcks11-client.c
authorRose <83477269+AtariDreams@users.noreply.github.com>
Tue, 19 Dec 2023 16:48:20 +0000 (11:48 -0500)
committerDamien Miller <djm@mindrot.org>
Mon, 8 Jan 2024 05:23:19 +0000 (16:23 +1100)
Compilation fails becaus of an undefined reference to helper_by_ec,
because we forgot the preprocessor conditional that excludes that function
from being called in unsupported configurations.

ssh-pkcs11-client.c

index 82e86a518443fb9f2409dd03d17fb43e36f3614a..5fa8bf02b3dad29aa094f71ac6ccd90e637e48fe 100644 (file)
@@ -457,6 +457,7 @@ pkcs11_make_cert(const struct sshkey *priv,
                RSA_set_method(ret->rsa, helper->rsa_meth);
                if (helper->nrsa++ >= INT_MAX)
                        fatal_f("RSA refcount error");
+#if defined(OPENSSL_HAS_ECC) && defined(HAVE_EC_KEY_METHOD_NEW)
        } else if (priv->type == KEY_ECDSA) {
                if ((helper = helper_by_ec(priv->ecdsa)) == NULL ||
                    helper->fd == -1)
@@ -466,6 +467,7 @@ pkcs11_make_cert(const struct sshkey *priv,
                EC_KEY_set_method(ret->ecdsa, helper->ec_meth);
                if (helper->nec++ >= INT_MAX)
                        fatal_f("EC refcount error");
+#endif
        } else
                fatal_f("unknown key type %s", sshkey_type(priv));