]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
complete PKCS#11 stubs and move to ssh-pkcs11.c
authorDamien Miller <djm@mindrot.org>
Thu, 9 Oct 2025 02:12:15 +0000 (13:12 +1100)
committerDamien Miller <djm@mindrot.org>
Thu, 9 Oct 2025 02:12:15 +0000 (13:12 +1100)
Should unbreak --disable-pkcs11 builds

ssh-pkcs11-helper.c
ssh-pkcs11.c

index 7ed4bdb768413572c35e7adb1e3fce7b1bfaafb7..aeb5b7a8a924f4588951ca9ab4e802e07ba14241 100644 (file)
@@ -310,22 +310,6 @@ main(int argc, char **argv)
        }
 }
 #else /* ENABLE_PKCS11 */
-/* stubs */
-int
-pkcs11_sign(struct sshkey *key,
-    u_char **sigp, size_t *lenp,
-    const u_char *data, size_t datalen,
-    const char *alg, const char *sk_provider,
-    const char *sk_pin, u_int compat)
-{
-       return SSH_ERR_INTERNAL_ERROR;
-}
-
-void
-pkcs11_key_free(struct sshkey *key)
-{
-}
-
 int
 main(int argc, char **argv)
 {
index f68617f47e350f77920b76e716011c0352202f8f..c8817947395a89100d1ca4d8777f129b55fda91a 100644 (file)
@@ -2289,11 +2289,13 @@ out:
 
 #include "log.h"
 #include "sshkey.h"
+#include "ssherr.h"
+#include "ssh-pkcs11.h"
 
 int
 pkcs11_init(int interactive)
 {
-       error_f("dlopen() not supported");
+       error_f("PKCS#11 not supported");
        return (-1);
 }
 
@@ -2301,13 +2303,30 @@ int
 pkcs11_add_provider(char *provider_id, char *pin, struct sshkey ***keyp,
     char ***labelsp)
 {
-       error_f("dlopen() not supported");
+       error_f("PKCS#11 not supported");
        return (-1);
 }
 
+void
+pkcs11_key_free(struct sshkey *key)
+{
+       error_f("PKCS#11 not supported");
+}
+
+int
+pkcs11_sign(struct sshkey *key,
+    u_char **sigp, size_t *lenp,
+    const u_char *data, size_t datalen,
+    const char *alg, const char *sk_provider,
+    const char *sk_pin, u_int compat)
+{
+       error_f("PKCS#11 not supported");
+       return SSH_ERR_FEATURE_UNSUPPORTED;
+}
+
 void
 pkcs11_terminate(void)
 {
-       error_f("dlopen() not supported");
+       error_f("PKCS#11 not supported");
 }
 #endif /* ENABLE_PKCS11 */