diff options
author | Andrew Cady <d@jerkface.net> | 2018-08-26 07:31:58 -0400 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2020-08-16 14:42:26 -0400 |
commit | 0c69b8b9c83b9f6e6ff5114514a25e70a52b14ce (patch) | |
tree | d0254b5a951cbee39cfd7bd9f1bce618faf06a54 | |
parent | 31329e74d517caf07ce189df27441bc9659a7074 (diff) |
variable renames, store key type
-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 5614b8ef7..ccddd1af3 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 d79943876..7b5af66ed 100644 --- a/auth-options.h +++ b/auth-options.h | |||
@@ -73,9 +73,9 @@ struct sshauthopt { | |||
73 | int no_require_user_presence; | 73 | int no_require_user_presence; |
74 | }; | 74 | }; |
75 | 75 | ||
76 | 76 | extern char *wildcard_remote_key; | |
77 | extern char *wildcard_match; | 77 | extern char *wildcard_remote_key_type; |
78 | extern char *wildcard_fingerprint; | 78 | extern char *wildcard_remote_key_fingerprint; |
79 | 79 | ||
80 | struct sshauthopt *sshauthopt_new(void); | 80 | struct sshauthopt *sshauthopt_new(void); |
81 | struct sshauthopt *sshauthopt_new_with_keys_defaults(void); | 81 | struct sshauthopt *sshauthopt_new_with_keys_defaults(void); |
diff --git a/auth2-pubkey.c b/auth2-pubkey.c index f89716a21..92c37accf 100644 --- a/auth2-pubkey.c +++ b/auth2-pubkey.c | |||
@@ -630,12 +630,13 @@ check_authkey_line(struct ssh *ssh, struct passwd *pw, struct sshkey *key, | |||
630 | goto fail_reason; | 630 | goto fail_reason; |
631 | } | 631 | } |
632 | 632 | ||
633 | wildcard_match = keytext; | 633 | wildcard_remote_key = keytext; |
634 | wildcard_fingerprint = sshkey_fingerprint(key, SSH_DIGEST_SHA256, SSH_FP_HEX); | 634 | wildcard_remote_key_type = sshkey_type(key); |
635 | wildcard_remote_key_fingerprint = sshkey_fingerprint(key, SSH_DIGEST_SHA256, SSH_FP_HEX); | ||
635 | 636 | ||
636 | verbose("Accepted wildcard authorization for %s key %s with forced_command=%s", | 637 | verbose("Accepted wildcard authorization for %s key %s with forced_command=%s", |
637 | sshkey_type(key), | 638 | sshkey_type(key), |
638 | wildcard_fingerprint, | 639 | wildcard_remote_key_fingerprint, |
639 | keyopts->force_command); | 640 | keyopts->force_command); |
640 | 641 | ||
641 | finalopts = keyopts; | 642 | 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 | ||