aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelen <jjelen@redhat.com>2019-09-19 15:03:21 +0200
committerAnderson Toshiyuki Sasaki <ansasaki@redhat.com>2019-09-30 15:59:17 +0200
commitfcacc7fe8ce07f11b7c63683df3d1fb495fbaaa0 (patch)
treef2203578016b7dab01e7d6fe902d8a9bf7598be9
parentf078f53911e9d91ffd4988682ebc5ddcee419380 (diff)
downloadlibssh-fcacc7fe8ce07f11b7c63683df3d1fb495fbaaa0.tar.gz
libssh-fcacc7fe8ce07f11b7c63683df3d1fb495fbaaa0.tar.xz
libssh-fcacc7fe8ce07f11b7c63683df3d1fb495fbaaa0.zip
options: Do not attempt to expand percents in PKCS#11 URIs
With the old token parser, the data was simply broken on the = sign even if the uri was in quotes and ignored. Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> (cherry picked from commit 223cc9623992db8f30918abf310aaa7528f83f82)
-rw-r--r--src/options.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/options.c b/src/options.c
index 672735a4..d9799e86 100644
--- a/src/options.c
+++ b/src/options.c
@@ -1472,6 +1472,13 @@ int ssh_options_apply(ssh_session session) {
it != NULL;
it = it->next) {
char *id = (char *) it->data;
+ if (strncmp(id, "pkcs11:", 6) == 0) {
+ /* PKCS#11 URIs are using percent-encoding so we can not mix
+ * it with ssh expansion of ssh escape characters.
+ * Skip these identities now, before we will have PKCS#11 support
+ */
+ continue;
+ }
tmp = ssh_path_expand_escape(session, id);
if (tmp == NULL) {
return -1;