summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--auth-krb5.c16
-rw-r--r--auth-pam.c8
-rw-r--r--auth-passwd.c2
-rw-r--r--auth-sia.c2
-rw-r--r--auth.c2
-rw-r--r--auth2-gss.c14
-rw-r--r--authfd.c2
-rw-r--r--buffer.c2
-rw-r--r--channels.c2
-rw-r--r--entropy.c4
-rw-r--r--gss-genr.c4
-rw-r--r--md5crypt.c4
-rw-r--r--moduli.c4
-rw-r--r--monitor.c18
-rw-r--r--monitor_wrap.c2
-rw-r--r--scard-opensc.c8
-rw-r--r--scp.c2
-rw-r--r--session.c12
-rw-r--r--sftp-glob.c2
-rw-r--r--sftp-int.c6
-rw-r--r--ssh-keygen.c2
-rw-r--r--ssh-rand-helper.c12
-rw-r--r--sshconnect2.c18
23 files changed, 74 insertions, 74 deletions
diff --git a/auth-krb5.c b/auth-krb5.c
index b41c4882b..8377aed10 100644
--- a/auth-krb5.c
+++ b/auth-krb5.c
@@ -68,7 +68,7 @@ auth_krb5_password(Authctxt *authctxt, const char *password)
68 krb5_principal server; 68 krb5_principal server;
69 char ccname[40]; 69 char ccname[40];
70 int tmpfd; 70 int tmpfd;
71#endif 71#endif
72 krb5_error_code problem; 72 krb5_error_code problem;
73 krb5_ccache ccache = NULL; 73 krb5_ccache ccache = NULL;
74 74
@@ -97,10 +97,10 @@ auth_krb5_password(Authctxt *authctxt, const char *password)
97 goto out; 97 goto out;
98 98
99 restore_uid(); 99 restore_uid();
100 100
101 problem = krb5_verify_user(authctxt->krb5_ctx, authctxt->krb5_user, 101 problem = krb5_verify_user(authctxt->krb5_ctx, authctxt->krb5_user,
102 ccache, password, 1, NULL); 102 ccache, password, 1, NULL);
103 103
104 temporarily_use_uid(authctxt->pw); 104 temporarily_use_uid(authctxt->pw);
105 105
106 if (problem) 106 if (problem)
@@ -135,7 +135,7 @@ auth_krb5_password(Authctxt *authctxt, const char *password)
135 temporarily_use_uid(authctxt->pw); 135 temporarily_use_uid(authctxt->pw);
136 if (problem) 136 if (problem)
137 goto out; 137 goto out;
138 138
139 if (!krb5_kuserok(authctxt->krb5_ctx, authctxt->krb5_user, 139 if (!krb5_kuserok(authctxt->krb5_ctx, authctxt->krb5_user,
140 authctxt->pw->pw_name)) { 140 authctxt->pw->pw_name)) {
141 problem = -1; 141 problem = -1;
@@ -143,13 +143,13 @@ auth_krb5_password(Authctxt *authctxt, const char *password)
143 } 143 }
144 144
145 snprintf(ccname,sizeof(ccname),"FILE:/tmp/krb5cc_%d_XXXXXX",geteuid()); 145 snprintf(ccname,sizeof(ccname),"FILE:/tmp/krb5cc_%d_XXXXXX",geteuid());
146 146
147 if ((tmpfd = mkstemp(ccname+strlen("FILE:")))==-1) { 147 if ((tmpfd = mkstemp(ccname+strlen("FILE:")))==-1) {
148 logit("mkstemp(): %.100s", strerror(errno)); 148 logit("mkstemp(): %.100s", strerror(errno));
149 problem = errno; 149 problem = errno;
150 goto out; 150 goto out;
151 } 151 }
152 152
153 if (fchmod(tmpfd,S_IRUSR | S_IWUSR) == -1) { 153 if (fchmod(tmpfd,S_IRUSR | S_IWUSR) == -1) {
154 logit("fchmod(): %.100s", strerror(errno)); 154 logit("fchmod(): %.100s", strerror(errno));
155 close(tmpfd); 155 close(tmpfd);
@@ -166,12 +166,12 @@ auth_krb5_password(Authctxt *authctxt, const char *password)
166 authctxt->krb5_user); 166 authctxt->krb5_user);
167 if (problem) 167 if (problem)
168 goto out; 168 goto out;
169 169
170 problem= krb5_cc_store_cred(authctxt->krb5_ctx, authctxt->krb5_fwd_ccache, 170 problem= krb5_cc_store_cred(authctxt->krb5_ctx, authctxt->krb5_fwd_ccache,
171 &creds); 171 &creds);
172 if (problem) 172 if (problem)
173 goto out; 173 goto out;
174#endif 174#endif
175 175
176 authctxt->krb5_ticket_file = (char *)krb5_cc_get_name(authctxt->krb5_ctx, authctxt->krb5_fwd_ccache); 176 authctxt->krb5_ticket_file = (char *)krb5_cc_get_name(authctxt->krb5_ctx, authctxt->krb5_fwd_ccache);
177 177
diff --git a/auth-pam.c b/auth-pam.c
index 8b1915669..621940ab9 100644
--- a/auth-pam.c
+++ b/auth-pam.c
@@ -31,7 +31,7 @@
31 31
32/* Based on $FreeBSD: src/crypto/openssh/auth2-pam-freebsd.c,v 1.11 2003/03/31 13:48:18 des Exp $ */ 32/* Based on $FreeBSD: src/crypto/openssh/auth2-pam-freebsd.c,v 1.11 2003/03/31 13:48:18 des Exp $ */
33#include "includes.h" 33#include "includes.h"
34RCSID("$Id: auth-pam.c,v 1.83 2003/11/21 12:48:55 djm Exp $"); 34RCSID("$Id: auth-pam.c,v 1.84 2003/11/21 12:56:47 djm Exp $");
35 35
36#ifdef USE_PAM 36#ifdef USE_PAM
37#include <security/pam_appl.h> 37#include <security/pam_appl.h>
@@ -321,7 +321,7 @@ sshpam_thread(void *ctxtp)
321 ssh_msg_send(ctxt->pam_csock, PAM_AUTH_ERR, &buffer); 321 ssh_msg_send(ctxt->pam_csock, PAM_AUTH_ERR, &buffer);
322 buffer_free(&buffer); 322 buffer_free(&buffer);
323 pthread_exit(NULL); 323 pthread_exit(NULL);
324 324
325 return (NULL); /* Avoid warning for non-pthread case */ 325 return (NULL); /* Avoid warning for non-pthread case */
326} 326}
327 327
@@ -613,7 +613,7 @@ do_pam_account(void)
613{ 613{
614 sshpam_err = pam_acct_mgmt(sshpam_handle, 0); 614 sshpam_err = pam_acct_mgmt(sshpam_handle, 0);
615 debug3("%s: pam_acct_mgmt = %d", __func__, sshpam_err); 615 debug3("%s: pam_acct_mgmt = %d", __func__, sshpam_err);
616 616
617 if (sshpam_err != PAM_SUCCESS && sshpam_err != PAM_NEW_AUTHTOK_REQD) 617 if (sshpam_err != PAM_SUCCESS && sshpam_err != PAM_NEW_AUTHTOK_REQD)
618 return (0); 618 return (0);
619 619
@@ -773,7 +773,7 @@ int
773do_pam_putenv(char *name, char *value) 773do_pam_putenv(char *name, char *value)
774{ 774{
775 int ret = 1; 775 int ret = 1;
776#ifdef HAVE_PAM_PUTENV 776#ifdef HAVE_PAM_PUTENV
777 char *compound; 777 char *compound;
778 size_t len; 778 size_t len;
779 779
diff --git a/auth-passwd.c b/auth-passwd.c
index 4cbfe3689..54571f972 100644
--- a/auth-passwd.c
+++ b/auth-passwd.c
@@ -101,7 +101,7 @@ auth_password(Authctxt *authctxt, const char *password)
101 (char *)get_canonical_hostname(options.use_dns); 101 (char *)get_canonical_hostname(options.use_dns);
102 102
103 authsuccess = 1; 103 authsuccess = 1;
104 aix_remove_embedded_newlines(authmsg); 104 aix_remove_embedded_newlines(authmsg);
105 105
106 debug3("AIX/authenticate succeeded for user %s: %.100s", 106 debug3("AIX/authenticate succeeded for user %s: %.100s",
107 pw->pw_name, authmsg); 107 pw->pw_name, authmsg);
diff --git a/auth-sia.c b/auth-sia.c
index 544b601b3..cdd39d670 100644
--- a/auth-sia.c
+++ b/auth-sia.c
@@ -100,7 +100,7 @@ session_setup_sia(struct passwd *pw, char *tty)
100 if (sia_ses_launch(sia_collect_trm, ent) != SIASUCCESS) 100 if (sia_ses_launch(sia_collect_trm, ent) != SIASUCCESS)
101 fatal("Couldn't launch session for %s from %s", 101 fatal("Couldn't launch session for %s from %s",
102 pw->pw_name, host); 102 pw->pw_name, host);
103 103
104 sia_ses_release(&ent); 104 sia_ses_release(&ent);
105 105
106 if (setreuid(geteuid(), geteuid()) < 0) 106 if (setreuid(geteuid(), geteuid()) < 0)
diff --git a/auth.c b/auth.c
index a8cf0ce20..4b307dab3 100644
--- a/auth.c
+++ b/auth.c
@@ -597,7 +597,7 @@ fakepw(void)
597 memset(&fake, 0, sizeof(fake)); 597 memset(&fake, 0, sizeof(fake));
598 fake.pw_name = "NOUSER"; 598 fake.pw_name = "NOUSER";
599 fake.pw_passwd = 599 fake.pw_passwd =
600 "$2a$06$r3.juUaHZDlIbQaO2dS9FuYxL1W9M81R1Tc92PoSNmzvpEqLkLGrK"; 600 "$2a$06$r3.juUaHZDlIbQaO2dS9FuYxL1W9M81R1Tc92PoSNmzvpEqLkLGrK";
601 fake.pw_gecos = "NOUSER"; 601 fake.pw_gecos = "NOUSER";
602 fake.pw_uid = -1; 602 fake.pw_uid = -1;
603 fake.pw_gid = -1; 603 fake.pw_gid = -1;
diff --git a/auth2-gss.c b/auth2-gss.c
index 799d3326c..9249988d3 100644
--- a/auth2-gss.c
+++ b/auth2-gss.c
@@ -255,21 +255,21 @@ input_gssapi_mic(int type, u_int32_t plen, void *ctxt)
255 Buffer b; 255 Buffer b;
256 gss_buffer_desc mic, gssbuf; 256 gss_buffer_desc mic, gssbuf;
257 u_int len; 257 u_int len;
258 258
259 if (authctxt == NULL || (authctxt->methoddata == NULL && !use_privsep)) 259 if (authctxt == NULL || (authctxt->methoddata == NULL && !use_privsep))
260 fatal("No authentication or GSSAPI context"); 260 fatal("No authentication or GSSAPI context");
261 261
262 gssctxt = authctxt->methoddata; 262 gssctxt = authctxt->methoddata;
263 263
264 mic.value = packet_get_string(&len); 264 mic.value = packet_get_string(&len);
265 mic.length = len; 265 mic.length = len;
266 266
267 ssh_gssapi_buildmic(&b, authctxt->user, authctxt->service, 267 ssh_gssapi_buildmic(&b, authctxt->user, authctxt->service,
268 "gssapi-with-mic"); 268 "gssapi-with-mic");
269 269
270 gssbuf.value = buffer_ptr(&b); 270 gssbuf.value = buffer_ptr(&b);
271 gssbuf.length = buffer_len(&b); 271 gssbuf.length = buffer_len(&b);
272 272
273 if (!GSS_ERROR(PRIVSEP(ssh_gssapi_checkmic(gssctxt, &gssbuf, &mic)))) 273 if (!GSS_ERROR(PRIVSEP(ssh_gssapi_checkmic(gssctxt, &gssbuf, &mic))))
274 authenticated = PRIVSEP(ssh_gssapi_userok(authctxt->user)); 274 authenticated = PRIVSEP(ssh_gssapi_userok(authctxt->user));
275 else 275 else
@@ -277,7 +277,7 @@ input_gssapi_mic(int type, u_int32_t plen, void *ctxt)
277 277
278 buffer_free(&b); 278 buffer_free(&b);
279 xfree(mic.value); 279 xfree(mic.value);
280 280
281 authctxt->postponed = 0; 281 authctxt->postponed = 0;
282 dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_TOKEN, NULL); 282 dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_TOKEN, NULL);
283 dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_ERRTOK, NULL); 283 dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_ERRTOK, NULL);
diff --git a/authfd.c b/authfd.c
index 6a7c07205..42ca08256 100644
--- a/authfd.c
+++ b/authfd.c
@@ -607,7 +607,7 @@ ssh_update_card(AuthenticationConnection *auth, int add,
607 buffer_put_char(&msg, type); 607 buffer_put_char(&msg, type);
608 buffer_put_cstring(&msg, reader_id); 608 buffer_put_cstring(&msg, reader_id);
609 buffer_put_cstring(&msg, pin); 609 buffer_put_cstring(&msg, pin);
610 610
611 if (constrained) { 611 if (constrained) {
612 if (life != 0) { 612 if (life != 0) {
613 buffer_put_char(&msg, SSH_AGENT_CONSTRAIN_LIFETIME); 613 buffer_put_char(&msg, SSH_AGENT_CONSTRAIN_LIFETIME);
diff --git a/buffer.c b/buffer.c
index 236aeb0cd..9217cb269 100644
--- a/buffer.c
+++ b/buffer.c
@@ -105,7 +105,7 @@ restart:
105 goto restart; 105 goto restart;
106 } 106 }
107 /* Increase the size of the buffer and retry. */ 107 /* Increase the size of the buffer and retry. */
108 108
109 newlen = buffer->alloc + len + 32768; 109 newlen = buffer->alloc + len + 32768;
110 if (newlen > 0xa00000) 110 if (newlen > 0xa00000)
111 fatal("buffer_append_space: alloc %u not supported", 111 fatal("buffer_append_space: alloc %u not supported",
diff --git a/channels.c b/channels.c
index 4150b5504..25f85c8b7 100644
--- a/channels.c
+++ b/channels.c
@@ -1035,7 +1035,7 @@ channel_decode_socks5(Channel *c, fd_set * readset, fd_set * writeset)
1035 else if (inet_ntop(af, dest_addr, c->path, sizeof(c->path)) == NULL) 1035 else if (inet_ntop(af, dest_addr, c->path, sizeof(c->path)) == NULL)
1036 return -1; 1036 return -1;
1037 c->host_port = ntohs(dest_port); 1037 c->host_port = ntohs(dest_port);
1038 1038
1039 debug2("channel %d: dynamic request: socks5 host %s port %u command %u", 1039 debug2("channel %d: dynamic request: socks5 host %s port %u command %u",
1040 c->self, c->path, c->host_port, s5_req.command); 1040 c->self, c->path, c->host_port, s5_req.command);
1041 1041
diff --git a/entropy.c b/entropy.c
index f5381e32f..0997174b6 100644
--- a/entropy.c
+++ b/entropy.c
@@ -45,7 +45,7 @@
45 * XXX: we should tell the child how many bytes we need. 45 * XXX: we should tell the child how many bytes we need.
46 */ 46 */
47 47
48RCSID("$Id: entropy.c,v 1.47 2003/11/21 12:48:55 djm Exp $"); 48RCSID("$Id: entropy.c,v 1.48 2003/11/21 12:56:47 djm Exp $");
49 49
50#ifndef OPENSSL_PRNG_ONLY 50#ifndef OPENSSL_PRNG_ONLY
51#define RANDOM_SEED_SIZE 48 51#define RANDOM_SEED_SIZE 48
@@ -93,7 +93,7 @@ seed_rng(void)
93 (long int)original_uid, strerror(errno)); 93 (long int)original_uid, strerror(errno));
94 _exit(1); 94 _exit(1);
95 } 95 }
96 96
97 execl(SSH_RAND_HELPER, "ssh-rand-helper", NULL); 97 execl(SSH_RAND_HELPER, "ssh-rand-helper", NULL);
98 fprintf(stderr, "(rand child) Couldn't exec '%s': %s\n", 98 fprintf(stderr, "(rand child) Couldn't exec '%s': %s\n",
99 SSH_RAND_HELPER, strerror(errno)); 99 SSH_RAND_HELPER, strerror(errno));
diff --git a/gss-genr.c b/gss-genr.c
index 1e044dbbb..3f5727b3e 100644
--- a/gss-genr.c
+++ b/gss-genr.c
@@ -253,14 +253,14 @@ ssh_gssapi_sign(Gssctxt *ctx, gss_buffer_t buffer, gss_buffer_t hash)
253 if ((ctx->major = gss_get_mic(&ctx->minor, ctx->context, 253 if ((ctx->major = gss_get_mic(&ctx->minor, ctx->context,
254 GSS_C_QOP_DEFAULT, buffer, hash))) 254 GSS_C_QOP_DEFAULT, buffer, hash)))
255 ssh_gssapi_error(ctx); 255 ssh_gssapi_error(ctx);
256 256
257 return (ctx->major); 257 return (ctx->major);
258} 258}
259 259
260void 260void
261ssh_gssapi_buildmic(Buffer *b, const char *user, const char *service, 261ssh_gssapi_buildmic(Buffer *b, const char *user, const char *service,
262 const char *context) 262 const char *context)
263{ 263{
264 buffer_init(b); 264 buffer_init(b);
265 buffer_put_string(b, session_id2, session_id2_len); 265 buffer_put_string(b, session_id2, session_id2_len);
266 buffer_put_char(b, SSH2_MSG_USERAUTH_REQUEST); 266 buffer_put_char(b, SSH2_MSG_USERAUTH_REQUEST);
diff --git a/md5crypt.c b/md5crypt.c
index b5e3b91ab..8f2523e62 100644
--- a/md5crypt.c
+++ b/md5crypt.c
@@ -13,7 +13,7 @@
13#if defined(HAVE_MD5_PASSWORDS) && !defined(HAVE_MD5_CRYPT) 13#if defined(HAVE_MD5_PASSWORDS) && !defined(HAVE_MD5_CRYPT)
14#include <openssl/md5.h> 14#include <openssl/md5.h>
15 15
16RCSID("$Id: md5crypt.c,v 1.8 2003/11/21 12:48:55 djm Exp $"); 16RCSID("$Id: md5crypt.c,v 1.9 2003/11/21 12:56:47 djm Exp $");
17 17
18/* 0 ... 63 => ascii - 64 */ 18/* 0 ... 63 => ascii - 64 */
19static unsigned char itoa64[] = 19static unsigned char itoa64[] =
@@ -35,7 +35,7 @@ to64(unsigned long v, int n)
35 *s++ = itoa64[v&0x3f]; 35 *s++ = itoa64[v&0x3f];
36 v >>= 6; 36 v >>= 6;
37 } 37 }
38 38
39 return (buf); 39 return (buf);
40} 40}
41 41
diff --git a/moduli.c b/moduli.c
index ae71b250b..eb8cb78e9 100644
--- a/moduli.c
+++ b/moduli.c
@@ -151,7 +151,7 @@ qfileout(FILE * ofile, u_int32_t otype, u_int32_t otests, u_int32_t otries,
151 151
152 time(&time_now); 152 time(&time_now);
153 gtm = gmtime(&time_now); 153 gtm = gmtime(&time_now);
154 154
155 res = fprintf(ofile, "%04d%02d%02d%02d%02d%02d %u %u %u %u %x ", 155 res = fprintf(ofile, "%04d%02d%02d%02d%02d%02d %u %u %u %u %x ",
156 gtm->tm_year + 1900, gtm->tm_mon + 1, gtm->tm_mday, 156 gtm->tm_year + 1900, gtm->tm_mon + 1, gtm->tm_mday,
157 gtm->tm_hour, gtm->tm_min, gtm->tm_sec, 157 gtm->tm_hour, gtm->tm_min, gtm->tm_sec,
@@ -573,7 +573,7 @@ prime_test(FILE *in, FILE *out, u_int32_t trials,
573 count_in); 573 count_in);
574 continue; 574 continue;
575 } 575 }
576 576
577 /* 577 /*
578 * q is possibly prime, so go ahead and really make sure 578 * q is possibly prime, so go ahead and really make sure
579 * that p is prime. If it is, then we can go back and do 579 * that p is prime. If it is, then we can go back and do
diff --git a/monitor.c b/monitor.c
index 449397e30..46e8d16e6 100644
--- a/monitor.c
+++ b/monitor.c
@@ -783,7 +783,7 @@ int
783mm_answer_pam_start(int socket, Buffer *m) 783mm_answer_pam_start(int socket, Buffer *m)
784{ 784{
785 char *user; 785 char *user;
786 786
787 if (!options.use_pam) 787 if (!options.use_pam)
788 fatal("UsePAM not set, but ended up in %s anyway", __func__); 788 fatal("UsePAM not set, but ended up in %s anyway", __func__);
789 789
@@ -802,7 +802,7 @@ int
802mm_answer_pam_account(int socket, Buffer *m) 802mm_answer_pam_account(int socket, Buffer *m)
803{ 803{
804 u_int ret; 804 u_int ret;
805 805
806 if (!options.use_pam) 806 if (!options.use_pam)
807 fatal("UsePAM not set, but ended up in %s anyway", __func__); 807 fatal("UsePAM not set, but ended up in %s anyway", __func__);
808 808
@@ -1798,25 +1798,25 @@ mm_answer_gss_checkmic(int socket, Buffer *m)
1798 gss_buffer_desc gssbuf, mic; 1798 gss_buffer_desc gssbuf, mic;
1799 OM_uint32 ret; 1799 OM_uint32 ret;
1800 u_int len; 1800 u_int len;
1801 1801
1802 gssbuf.value = buffer_get_string(m, &len); 1802 gssbuf.value = buffer_get_string(m, &len);
1803 gssbuf.length = len; 1803 gssbuf.length = len;
1804 mic.value = buffer_get_string(m, &len); 1804 mic.value = buffer_get_string(m, &len);
1805 mic.length = len; 1805 mic.length = len;
1806 1806
1807 ret = ssh_gssapi_checkmic(gsscontext, &gssbuf, &mic); 1807 ret = ssh_gssapi_checkmic(gsscontext, &gssbuf, &mic);
1808 1808
1809 xfree(gssbuf.value); 1809 xfree(gssbuf.value);
1810 xfree(mic.value); 1810 xfree(mic.value);
1811 1811
1812 buffer_clear(m); 1812 buffer_clear(m);
1813 buffer_put_int(m, ret); 1813 buffer_put_int(m, ret);
1814 1814
1815 mm_request_send(socket, MONITOR_ANS_GSSCHECKMIC, m); 1815 mm_request_send(socket, MONITOR_ANS_GSSCHECKMIC, m);
1816 1816
1817 if (!GSS_ERROR(ret)) 1817 if (!GSS_ERROR(ret))
1818 monitor_permit(mon_dispatch, MONITOR_REQ_GSSUSEROK, 1); 1818 monitor_permit(mon_dispatch, MONITOR_REQ_GSSUSEROK, 1);
1819 1819
1820 return (0); 1820 return (0);
1821} 1821}
1822 1822
diff --git a/monitor_wrap.c b/monitor_wrap.c
index 7ca9672ff..e7c15cecd 100644
--- a/monitor_wrap.c
+++ b/monitor_wrap.c
@@ -720,7 +720,7 @@ mm_do_pam_account(void)
720 ret = buffer_get_int(&m); 720 ret = buffer_get_int(&m);
721 721
722 buffer_free(&m); 722 buffer_free(&m);
723 723
724 debug3("%s returning %d", __func__, ret); 724 debug3("%s returning %d", __func__, ret);
725 725
726 return (ret); 726 return (ret);
diff --git a/scard-opensc.c b/scard-opensc.c
index ff3017f5e..a9b7ebc61 100644
--- a/scard-opensc.c
+++ b/scard-opensc.c
@@ -189,7 +189,7 @@ sc_private_decrypt(int flen, u_char *from, u_char *to, RSA *rsa,
189 int r; 189 int r;
190 190
191 if (padding != RSA_PKCS1_PADDING) 191 if (padding != RSA_PKCS1_PADDING)
192 return -1; 192 return -1;
193 r = sc_prkey_op_init(rsa, &key_obj, SC_USAGE_DECRYPT); 193 r = sc_prkey_op_init(rsa, &key_obj, SC_USAGE_DECRYPT);
194 if (r) 194 if (r)
195 return -1; 195 return -1;
@@ -325,7 +325,7 @@ static void
325convert_rsa_to_rsa1(Key * in, Key * out) 325convert_rsa_to_rsa1(Key * in, Key * out)
326{ 326{
327 struct sc_priv_data *priv; 327 struct sc_priv_data *priv;
328 328
329 out->rsa->flags = in->rsa->flags; 329 out->rsa->flags = in->rsa->flags;
330 out->flags = in->flags; 330 out->flags = in->flags;
331 RSA_set_method(out->rsa, RSA_get_method(in->rsa)); 331 RSA_set_method(out->rsa, RSA_get_method(in->rsa));
@@ -349,7 +349,7 @@ sc_read_pubkey(Key * k, const struct sc_pkcs15_object *cert_obj)
349 EVP_PKEY *pubkey = NULL; 349 EVP_PKEY *pubkey = NULL;
350 u8 *p; 350 u8 *p;
351 char *tmp; 351 char *tmp;
352 352
353 debug("sc_read_pubkey() with cert id %02X", cinfo->id.value[0]); 353 debug("sc_read_pubkey() with cert id %02X", cinfo->id.value[0]);
354 r = sc_pkcs15_read_certificate(p15card, cinfo, &cert); 354 r = sc_pkcs15_read_certificate(p15card, cinfo, &cert);
355 if (r) { 355 if (r) {
@@ -391,7 +391,7 @@ sc_read_pubkey(Key * k, const struct sc_pkcs15_object *cert_obj)
391 tmp = key_fingerprint(k, SSH_FP_MD5, SSH_FP_HEX); 391 tmp = key_fingerprint(k, SSH_FP_MD5, SSH_FP_HEX);
392 debug("fingerprint %d %s", key_size(k), tmp); 392 debug("fingerprint %d %s", key_size(k), tmp);
393 xfree(tmp); 393 xfree(tmp);
394 394
395 return 0; 395 return 0;
396err: 396err:
397 if (cert) 397 if (cert)
diff --git a/scp.c b/scp.c
index cece74a98..10f6428b2 100644
--- a/scp.c
+++ b/scp.c
@@ -907,7 +907,7 @@ bad: run_err("%s: %s", np, strerror(errno));
907 cp += j; 907 cp += j;
908 statbytes += j; 908 statbytes += j;
909 } while (amt > 0); 909 } while (amt > 0);
910 910
911 if (limitbw) 911 if (limitbw)
912 bwlimit(4096); 912 bwlimit(4096);
913 913
diff --git a/session.c b/session.c
index 3a3a09b5b..7e56c54fb 100644
--- a/session.c
+++ b/session.c
@@ -924,11 +924,11 @@ read_etc_default_login(char ***env, u_int *envsize, uid_t uid)
924 var = child_get_env(tmpenv, "PATH"); 924 var = child_get_env(tmpenv, "PATH");
925 if (var != NULL) 925 if (var != NULL)
926 child_set_env(env, envsize, "PATH", var); 926 child_set_env(env, envsize, "PATH", var);
927 927
928 if ((var = child_get_env(tmpenv, "UMASK")) != NULL) 928 if ((var = child_get_env(tmpenv, "UMASK")) != NULL)
929 if (sscanf(var, "%5lo", &mask) == 1) 929 if (sscanf(var, "%5lo", &mask) == 1)
930 umask((mode_t)mask); 930 umask((mode_t)mask);
931 931
932 for (i = 0; tmpenv[i] != NULL; i++) 932 for (i = 0; tmpenv[i] != NULL; i++)
933 xfree(tmpenv[i]); 933 xfree(tmpenv[i]);
934 xfree(tmpenv); 934 xfree(tmpenv);
@@ -953,7 +953,7 @@ void copy_environment(char **source, char ***env, u_int *envsize)
953 953
954 debug3("Copy environment: %s=%s", var_name, var_val); 954 debug3("Copy environment: %s=%s", var_name, var_val);
955 child_set_env(env, envsize, var_name, var_val); 955 child_set_env(env, envsize, var_name, var_val);
956 956
957 xfree(var_name); 957 xfree(var_name);
958 } 958 }
959} 959}
@@ -1096,7 +1096,7 @@ do_setup_env(Session *s, const char *shell)
1096 */ 1096 */
1097 if (options.use_pam) { 1097 if (options.use_pam) {
1098 char **p; 1098 char **p;
1099 1099
1100 p = fetch_pam_child_environment(); 1100 p = fetch_pam_child_environment();
1101 copy_environment(p, &env, &envsize); 1101 copy_environment(p, &env, &envsize);
1102 free_pam_environment(p); 1102 free_pam_environment(p);
@@ -2033,13 +2033,13 @@ session_tty_list(void)
2033 for (i = 0; i < MAX_SESSIONS; i++) { 2033 for (i = 0; i < MAX_SESSIONS; i++) {
2034 Session *s = &sessions[i]; 2034 Session *s = &sessions[i];
2035 if (s->used && s->ttyfd != -1) { 2035 if (s->used && s->ttyfd != -1) {
2036 2036
2037 if (strncmp(s->tty, "/dev/", 5) != 0) { 2037 if (strncmp(s->tty, "/dev/", 5) != 0) {
2038 cp = strrchr(s->tty, '/'); 2038 cp = strrchr(s->tty, '/');
2039 cp = (cp == NULL) ? s->tty : cp + 1; 2039 cp = (cp == NULL) ? s->tty : cp + 1;
2040 } else 2040 } else
2041 cp = s->tty + 5; 2041 cp = s->tty + 5;
2042 2042
2043 if (buf[0] != '\0') 2043 if (buf[0] != '\0')
2044 strlcat(buf, ",", sizeof buf); 2044 strlcat(buf, ",", sizeof buf);
2045 strlcat(buf, cp, sizeof buf); 2045 strlcat(buf, cp, sizeof buf);
diff --git a/sftp-glob.c b/sftp-glob.c
index 4f2234654..f099227f9 100644
--- a/sftp-glob.c
+++ b/sftp-glob.c
@@ -70,7 +70,7 @@ fudge_readdir(struct SFTP_OPENDIR *od)
70#ifdef __GNU_LIBRARY__ 70#ifdef __GNU_LIBRARY__
71 static int inum = 1; 71 static int inum = 1;
72#endif /* __GNU_LIBRARY__ */ 72#endif /* __GNU_LIBRARY__ */
73 73
74 if (od->dir[od->offset] == NULL) 74 if (od->dir[od->offset] == NULL)
75 return(NULL); 75 return(NULL);
76 76
diff --git a/sftp-int.c b/sftp-int.c
index 4c280b492..599a3444d 100644
--- a/sftp-int.c
+++ b/sftp-int.c
@@ -390,7 +390,7 @@ get_pathname(const char **cpp, char **path)
390 390
391 fail: 391 fail:
392 xfree(*path); 392 xfree(*path);
393 *path = NULL; 393 *path = NULL;
394 return (-1); 394 return (-1);
395} 395}
396 396
@@ -679,7 +679,7 @@ do_globbed_ls(struct sftp_conn *conn, char *path, char *strip_path,
679 679
680 if (!(lflag & SHORT_VIEW)) { 680 if (!(lflag & SHORT_VIEW)) {
681 int m = 0, width = 80; 681 int m = 0, width = 80;
682 struct winsize ws; 682 struct winsize ws;
683 683
684 /* Count entries for sort and find longest filename */ 684 /* Count entries for sort and find longest filename */
685 for (i = 0; g.gl_pathv[i]; i++) 685 for (i = 0; g.gl_pathv[i]; i++)
@@ -759,7 +759,7 @@ parse_args(const char **cpp, int *pflag, int *lflag, int *iflag,
759 *iflag = 1; 759 *iflag = 1;
760 cp++; 760 cp++;
761 } 761 }
762 762
763 /* Figure out which command we have */ 763 /* Figure out which command we have */
764 for (i = 0; cmds[i].c; i++) { 764 for (i = 0; cmds[i].c; i++) {
765 int cmdlen = strlen(cmds[i].c); 765 int cmdlen = strlen(cmds[i].c);
diff --git a/ssh-keygen.c b/ssh-keygen.c
index 95d22b6a4..54aa5a59c 100644
--- a/ssh-keygen.c
+++ b/ssh-keygen.c
@@ -968,7 +968,7 @@ main(int ac, char **av)
968 968
969 if (do_gen_candidates) { 969 if (do_gen_candidates) {
970 FILE *out = fopen(out_file, "w"); 970 FILE *out = fopen(out_file, "w");
971 971
972 if (out == NULL) { 972 if (out == NULL) {
973 error("Couldn't open modulus candidate file \"%s\": %s", 973 error("Couldn't open modulus candidate file \"%s\": %s",
974 out_file, strerror(errno)); 974 out_file, strerror(errno));
diff --git a/ssh-rand-helper.c b/ssh-rand-helper.c
index abdb779f0..8a320a71e 100644
--- a/ssh-rand-helper.c
+++ b/ssh-rand-helper.c
@@ -39,7 +39,7 @@
39#include "pathnames.h" 39#include "pathnames.h"
40#include "log.h" 40#include "log.h"
41 41
42RCSID("$Id: ssh-rand-helper.c,v 1.15 2003/11/21 12:48:56 djm Exp $"); 42RCSID("$Id: ssh-rand-helper.c,v 1.16 2003/11/21 12:56:47 djm Exp $");
43 43
44/* Number of bytes we write out */ 44/* Number of bytes we write out */
45#define OUTPUT_SEED_SIZE 48 45#define OUTPUT_SEED_SIZE 48
@@ -779,7 +779,7 @@ main(int argc, char **argv)
779 /* Don't write binary data to a tty, unless we are forced to */ 779 /* Don't write binary data to a tty, unless we are forced to */
780 if (isatty(STDOUT_FILENO)) 780 if (isatty(STDOUT_FILENO))
781 output_hex = 1; 781 output_hex = 1;
782 782
783 while ((ch = getopt(argc, argv, "vxXhb:")) != -1) { 783 while ((ch = getopt(argc, argv, "vxXhb:")) != -1) {
784 switch (ch) { 784 switch (ch) {
785 case 'v': 785 case 'v':
@@ -806,7 +806,7 @@ main(int argc, char **argv)
806 } 806 }
807 807
808 log_init(argv[0], ll, SYSLOG_FACILITY_USER, 1); 808 log_init(argv[0], ll, SYSLOG_FACILITY_USER, 1);
809 809
810#ifdef USE_SEED_FILES 810#ifdef USE_SEED_FILES
811 prng_read_seedfile(); 811 prng_read_seedfile();
812#endif 812#endif
@@ -816,7 +816,7 @@ main(int argc, char **argv)
816 /* 816 /*
817 * Seed the RNG from wherever we can 817 * Seed the RNG from wherever we can
818 */ 818 */
819 819
820 /* Take whatever is on the stack, but don't credit it */ 820 /* Take whatever is on the stack, but don't credit it */
821 RAND_add(buf, bytes, 0); 821 RAND_add(buf, bytes, 0);
822 822
@@ -859,9 +859,9 @@ main(int argc, char **argv)
859 printf("\n"); 859 printf("\n");
860 } else 860 } else
861 ret = atomicio(vwrite, STDOUT_FILENO, buf, bytes); 861 ret = atomicio(vwrite, STDOUT_FILENO, buf, bytes);
862 862
863 memset(buf, '\0', bytes); 863 memset(buf, '\0', bytes);
864 xfree(buf); 864 xfree(buf);
865 865
866 return ret == bytes ? 0 : 1; 866 return ret == bytes ? 0 : 1;
867} 867}
diff --git a/sshconnect2.c b/sshconnect2.c
index 76670e8a8..281fecdc9 100644
--- a/sshconnect2.c
+++ b/sshconnect2.c
@@ -546,7 +546,7 @@ process_gssapi_token(void *ctxt, gss_buffer_t recv_tok)
546 gss_buffer_desc gssbuf, mic; 546 gss_buffer_desc gssbuf, mic;
547 OM_uint32 status, ms, flags; 547 OM_uint32 status, ms, flags;
548 Buffer b; 548 Buffer b;
549 549
550 status = ssh_gssapi_init_ctx(gssctxt, options.gss_deleg_creds, 550 status = ssh_gssapi_init_ctx(gssctxt, options.gss_deleg_creds,
551 recv_tok, &send_tok, &flags); 551 recv_tok, &send_tok, &flags);
552 552
@@ -555,12 +555,12 @@ process_gssapi_token(void *ctxt, gss_buffer_t recv_tok)
555 packet_start(SSH2_MSG_USERAUTH_GSSAPI_ERRTOK); 555 packet_start(SSH2_MSG_USERAUTH_GSSAPI_ERRTOK);
556 else 556 else
557 packet_start(SSH2_MSG_USERAUTH_GSSAPI_TOKEN); 557 packet_start(SSH2_MSG_USERAUTH_GSSAPI_TOKEN);
558 558
559 packet_put_string(send_tok.value, send_tok.length); 559 packet_put_string(send_tok.value, send_tok.length);
560 packet_send(); 560 packet_send();
561 gss_release_buffer(&ms, &send_tok); 561 gss_release_buffer(&ms, &send_tok);
562 } 562 }
563 563
564 if (status == GSS_S_COMPLETE) { 564 if (status == GSS_S_COMPLETE) {
565 /* send either complete or MIC, depending on mechanism */ 565 /* send either complete or MIC, depending on mechanism */
566 if (!(flags & GSS_C_INTEG_FLAG)) { 566 if (!(flags & GSS_C_INTEG_FLAG)) {
@@ -572,21 +572,21 @@ process_gssapi_token(void *ctxt, gss_buffer_t recv_tok)
572 572
573 gssbuf.value = buffer_ptr(&b); 573 gssbuf.value = buffer_ptr(&b);
574 gssbuf.length = buffer_len(&b); 574 gssbuf.length = buffer_len(&b);
575 575
576 status = ssh_gssapi_sign(gssctxt, &gssbuf, &mic); 576 status = ssh_gssapi_sign(gssctxt, &gssbuf, &mic);
577 577
578 if (!GSS_ERROR(status)) { 578 if (!GSS_ERROR(status)) {
579 packet_start(SSH2_MSG_USERAUTH_GSSAPI_MIC); 579 packet_start(SSH2_MSG_USERAUTH_GSSAPI_MIC);
580 packet_put_string(mic.value, mic.length); 580 packet_put_string(mic.value, mic.length);
581 581
582 packet_send(); 582 packet_send();
583 } 583 }
584 584
585 buffer_free(&b); 585 buffer_free(&b);
586 gss_release_buffer(&ms, &mic); 586 gss_release_buffer(&ms, &mic);
587 } 587 }
588 } 588 }
589 589
590 return status; 590 return status;
591} 591}
592 592