diff options
| author | Michael Forney <mforney@mforney.org> | 2019-11-03 12:29:48 -0800 |
|---|---|---|
| committer | Michael Forney <mforney@mforney.org> | 2019-11-03 13:13:44 -0800 |
| commit | 2e9b607d05081b5ebe68af664971e1c4f68ca90b (patch) | |
| tree | 3316428645e535ea6273282e760d4acd06fedb35 /pkg/openssh/patch | |
| parent | c2e4d05a2baf81e0f6b26fd932cfc963de6c88f3 (diff) | |
openssh: Update to latest git and enable security key support
Diffstat (limited to 'pkg/openssh/patch')
| -rw-r--r-- | pkg/openssh/patch/0002-Allow-security-key-provider-to-be-built-in.patch | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/pkg/openssh/patch/0002-Allow-security-key-provider-to-be-built-in.patch b/pkg/openssh/patch/0002-Allow-security-key-provider-to-be-built-in.patch new file mode 100644 index 00000000..9be4b535 --- /dev/null +++ b/pkg/openssh/patch/0002-Allow-security-key-provider-to-be-built-in.patch @@ -0,0 +1,64 @@ +From fc95498df16315eac1ebe62db51ea33b96ce6b52 Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Sun, 3 Nov 2019 11:24:13 -0800 +Subject: [PATCH] Allow security key provider to be built-in + +--- + ssh-sk.c | 30 ++++++++++++++++++------------ + 1 file changed, 18 insertions(+), 12 deletions(-) + +diff --git a/ssh-sk.c b/ssh-sk.c +index 122a1e2b..ca16a187 100644 +--- a/ssh-sk.c ++++ b/ssh-sk.c +@@ -84,16 +84,22 @@ sshsk_open(const char *path) + error("%s: strdup failed", __func__); + goto fail; + } +- if ((ret->dlhandle = dlopen(path, RTLD_NOW)) == NULL) { +- error("Security key provider %s dlopen failed: %s", +- path, dlerror()); +- goto fail; +- } +- if ((ret->sk_api_version = dlsym(ret->dlhandle, +- "sk_api_version")) == NULL) { +- error("Security key provider %s dlsym(sk_api_version) " +- "failed: %s", path, dlerror()); +- goto fail; ++ if (strcmp(path, "builtin") == 0) { ++ ret->sk_api_version = sk_api_version; ++ ret->sk_enroll = sk_enroll; ++ ret->sk_sign = sk_sign; ++ } else { ++ if ((ret->dlhandle = dlopen(path, RTLD_NOW)) == NULL) { ++ error("Security key provider %s dlopen failed: %s", ++ path, dlerror()); ++ goto fail; ++ } ++ if ((ret->sk_api_version = dlsym(ret->dlhandle, ++ "sk_api_version")) == NULL) { ++ error("Security key provider %s dlsym(sk_api_version) " ++ "failed: %s", path, dlerror()); ++ goto fail; ++ } + } + version = ret->sk_api_version(); + debug("%s: provider %s implements version 0x%08lx", __func__, +@@ -104,12 +110,12 @@ sshsk_open(const char *path) + (u_long)SSH_SK_VERSION_MAJOR); + goto fail; + } +- if ((ret->sk_enroll = dlsym(ret->dlhandle, "sk_enroll")) == NULL) { ++ if (ret->dlhandle && (ret->sk_enroll = dlsym(ret->dlhandle, "sk_enroll")) == NULL) { + error("Security key provider %s dlsym(sk_enroll) " + "failed: %s", path, dlerror()); + goto fail; + } +- if ((ret->sk_sign = dlsym(ret->dlhandle, "sk_sign")) == NULL) { ++ if (ret->dlhandle && (ret->sk_sign = dlsym(ret->dlhandle, "sk_sign")) == NULL) { + error("Security key provider %s dlsym(sk_sign) failed: %s", + path, dlerror()); + goto fail; +-- +2.23.0 + |
