summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2018-08-26 07:31:58 -0400
committerAndrew Cady <d@jerkface.net>2020-10-27 17:45:22 -0400
commitef9269c4983dd3706c90157bdb39717d83e7d085 (patch)
tree2077dc33842df4613ce8029143c6c80ad21d6fab
parentede8986e4a0e4f19dcc8b972987d29c398c414b9 (diff)
variable renames, store key type
-rw-r--r--auth-options.c5
-rw-r--r--auth-options.h6
-rw-r--r--auth2-pubkey.c7
-rw-r--r--session.c10
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
43char *wildcard_match = NULL; 43char *wildcard_remote_key = NULL;
44char *wildcard_fingerprint = NULL; 44char *wildcard_remote_key_type = NULL;
45char *wildcard_remote_key_fingerprint = NULL;
45 46
46static int 47static int
47dup_strings(char ***dstp, size_t *ndstp, char **src, size_t nsrc) 48dup_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 78extern char *wildcard_remote_key;
79extern char *wildcard_match; 79extern char *wildcard_remote_key_type;
80extern char *wildcard_fingerprint; 80extern char *wildcard_remote_key_fingerprint;
81 81
82struct sshauthopt *sshauthopt_new(void); 82struct sshauthopt *sshauthopt_new(void);
83struct sshauthopt *sshauthopt_new_with_keys_defaults(void); 83struct 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;
diff --git a/session.c b/session.c
index b36e8b1fb..4ae9cab66 100644
--- a/session.c
+++ b/session.c
@@ -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