From 4d7e9c189c21c06595de847a6774692a7ca16886 Mon Sep 17 00:00:00 2001 From: Tess Gauthier Date: Fri, 13 Sep 2024 15:34:15 -0400 Subject: [PATCH] address review feedback --- log.c | 15 --------------- ssh-pkcs11-client.c | 6 +++++- ssh-sk-helper.c | 22 ++++++++++++++++++---- sshd.c | 2 -- 4 files changed, 23 insertions(+), 22 deletions(-) diff --git a/log.c b/log.c index 108630042..d70872492 100644 --- a/log.c +++ b/log.c @@ -452,21 +452,6 @@ sshlogdie(const char *file, const char *func, int line, int showfunc, cleanup_exit(255); } -#ifdef WINDOWS -void -sshsigdie(const char* file, const char* func, int line, int showfunc, - LogLevel level, const char* suffix, const char* fmt, ...) -{ - va_list args; - - va_start(args, fmt); - sshlogv(file, func, line, showfunc, SYSLOG_LEVEL_FATAL, - suffix, fmt, args); - va_end(args); - _exit(1); -} -#endif /* WINDOWS */ - void sshlogv(const char *file, const char *func, int line, int showfunc, LogLevel level, const char *suffix, const char *fmt, va_list args) diff --git a/ssh-pkcs11-client.c b/ssh-pkcs11-client.c index 8ac96ba1c..843a10e68 100644 --- a/ssh-pkcs11-client.c +++ b/ssh-pkcs11-client.c @@ -904,7 +904,11 @@ pkcs11_add_provider(char *name, char *pin, struct sshkey ***keysp, struct sshkey *k; int r, type; u_char *blob; - char *label; +#ifdef WINDOWS + char *label = NULL; +#else + char* label; +#endif /* WINDOWS*/ size_t blen; u_int nkeys, i; struct sshbuf *msg; diff --git a/ssh-sk-helper.c b/ssh-sk-helper.c index 410a3c72b..2e1cb4351 100644 --- a/ssh-sk-helper.c +++ b/ssh-sk-helper.c @@ -94,7 +94,11 @@ process_sign(struct sshbuf *req) struct sshbuf *resp, *kbuf; struct sshkey *key = NULL; uint32_t compat; - const u_char *message; +#ifdef WINDOWS + const u_char *message = NULL; +#else + const u_char* message; +#endif /* WINDOWS */ u_char *sig = NULL; size_t msglen, siglen = 0; char *provider = NULL, *pin = NULL; @@ -160,9 +164,15 @@ process_enroll(struct sshbuf *req) { int r; u_int type; - char *provider, *application, *pin, *device, *userid; +#ifdef WINDOWS + char *provider = NULL, *application = NULL, *pin, *device, *userid; uint8_t flags; - struct sshbuf *challenge, *attest, *kbuf, *resp; + struct sshbuf *challenge = NULL, *attest, *kbuf = NULL, *resp; +#else + char* provider, * application, * pin, * device, * userid; + uint8_t flags; + struct sshbuf* challenge, * attest, * kbuf, * resp; +#endif /* WINDOWS*/ struct sshkey *key; if ((attest = sshbuf_new()) == NULL || @@ -294,7 +304,11 @@ main(int argc, char **argv) { SyslogFacility log_facility = SYSLOG_FACILITY_AUTH; LogLevel log_level = SYSLOG_LEVEL_ERROR; - struct sshbuf *req, *resp; +#ifdef WINDOWS + struct sshbuf *req, *resp = NULL; +#else + struct sshbuf* req, * resp; +#endif /* WINDOWS */ int in, out, ch, r, vflag = 0; u_int rtype, ll = 0; uint8_t version, log_stderr = 0; diff --git a/sshd.c b/sshd.c index 95c65e86c..3124748a3 100644 --- a/sshd.c +++ b/sshd.c @@ -1761,8 +1761,6 @@ main(int ac, char **av) rexec_argv = xcalloc(rexec_argc + 3, sizeof(char *)); /* Point to the sshd-session binary instead of sshd */ rexec_argv[0] = options.sshd_session_path; - extern wchar_t* __wprogdir; - debug("__wprogdir: %ls", __wprogdir); for (i = 1; i < (u_int)rexec_argc; i++) { debug("rexec_argv[%d]='%s'", i, saved_argv[i]); rexec_argv[i] = saved_argv[i];