diff options
-rw-r--r-- | auth-options.c | 5 | ||||
-rw-r--r-- | auth-options.h | 6 | ||||
-rw-r--r-- | auth2-pubkey.c | 7 | ||||
-rw-r--r-- | session.c | 10 |
4 files changed, 17 insertions, 11 deletions
diff --git a/auth-options.c b/auth-options.c index 4a4ba9016..d6c4e41b2 100644 --- a/auth-options.c +++ b/auth-options.c | |||
@@ -40,8 +40,9 @@ | |||
40 | #include "ssh2.h" | 40 | #include "ssh2.h" |
41 | #include "auth-options.h" | 41 | #include "auth-options.h" |
42 | 42 | ||
43 | char *wildcard_match = NULL; | 43 | char *wildcard_remote_key = NULL; |
44 | char *wildcard_fingerprint = NULL; | 44 | char *wildcard_remote_key_type = NULL; |
45 | char *wildcard_remote_key_fingerprint = NULL; | ||
45 | 46 | ||
46 | static int | 47 | static int |
47 | dup_strings(char ***dstp, size_t *ndstp, char **src, size_t nsrc) | 48 | dup_strings(char ***dstp, size_t *ndstp, char **src, size_t nsrc) |
diff --git a/auth-options.h b/auth-options.h index 165180187..e64acdf70 100644 --- a/auth-options.h +++ b/auth-options.h | |||
@@ -75,9 +75,9 @@ struct sshauthopt { | |||
75 | int require_verify; | 75 | int require_verify; |
76 | }; | 76 | }; |
77 | 77 | ||
78 | 78 | extern char *wildcard_remote_key; | |
79 | extern char *wildcard_match; | 79 | extern char *wildcard_remote_key_type; |
80 | extern char *wildcard_fingerprint; | 80 | extern char *wildcard_remote_key_fingerprint; |
81 | 81 | ||
82 | struct sshauthopt *sshauthopt_new(void); | 82 | struct sshauthopt *sshauthopt_new(void); |
83 | struct sshauthopt *sshauthopt_new_with_keys_defaults(void); | 83 | struct sshauthopt *sshauthopt_new_with_keys_defaults(void); |
diff --git a/auth2-pubkey.c b/auth2-pubkey.c index bba8dfefa..73151b57c 100644 --- a/auth2-pubkey.c +++ b/auth2-pubkey.c | |||
@@ -644,12 +644,13 @@ check_authkey_line(struct ssh *ssh, struct passwd *pw, struct sshkey *key, | |||
644 | goto fail_reason; | 644 | goto fail_reason; |
645 | } | 645 | } |
646 | 646 | ||
647 | wildcard_match = keytext; | 647 | wildcard_remote_key = keytext; |
648 | wildcard_fingerprint = sshkey_fingerprint(key, SSH_DIGEST_SHA256, SSH_FP_HEX); | 648 | wildcard_remote_key_type = sshkey_type(key); |
649 | wildcard_remote_key_fingerprint = sshkey_fingerprint(key, SSH_DIGEST_SHA256, SSH_FP_HEX); | ||
649 | 650 | ||
650 | verbose("Accepted wildcard authorization for %s key %s with forced_command=%s", | 651 | verbose("Accepted wildcard authorization for %s key %s with forced_command=%s", |
651 | sshkey_type(key), | 652 | sshkey_type(key), |
652 | wildcard_fingerprint, | 653 | wildcard_remote_key_fingerprint, |
653 | keyopts->force_command); | 654 | keyopts->force_command); |
654 | 655 | ||
655 | finalopts = keyopts; | 656 | finalopts = keyopts; |
@@ -1071,11 +1071,15 @@ do_setup_env(struct ssh *ssh, Session *s, const char *shell) | |||
1071 | child_set_env(&env, &envsize, "TERM", s->term); | 1071 | child_set_env(&env, &envsize, "TERM", s->term); |
1072 | if (s->display) | 1072 | if (s->display) |
1073 | child_set_env(&env, &envsize, "DISPLAY", s->display); | 1073 | child_set_env(&env, &envsize, "DISPLAY", s->display); |
1074 | if (wildcard_match) { | 1074 | if (wildcard_remote_key) { |
1075 | /* This is basically obsolete because of SSH_USER_AUTH */ | ||
1076 | /* I'm leaving it here only because I have code that uses these variables. */ | ||
1075 | child_set_env(&env, &envsize, "SSH_REMOTE_KEY", | 1077 | child_set_env(&env, &envsize, "SSH_REMOTE_KEY", |
1076 | wildcard_match); | 1078 | wildcard_remote_key); |
1079 | child_set_env(&env, &envsize, "SSH_REMOTE_KEY_TYPE", | ||
1080 | wildcard_remote_key_type); | ||
1077 | child_set_env(&env, &envsize, "SSH_REMOTE_FINGERPRINT", | 1081 | child_set_env(&env, &envsize, "SSH_REMOTE_FINGERPRINT", |
1078 | wildcard_fingerprint); | 1082 | wildcard_remote_key_fingerprint); |
1079 | } | 1083 | } |
1080 | 1084 | ||
1081 | 1085 | ||