summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog27
-rw-r--r--auth-options.c16
-rw-r--r--auth-rsa.c14
-rw-r--r--dh.c6
-rw-r--r--session.c6
-rw-r--r--ssh-agent.118
-rw-r--r--ssh-agent.c18
-rw-r--r--ssh-keygen.c4
-rw-r--r--ssh.c4
9 files changed, 74 insertions, 39 deletions
diff --git a/ChangeLog b/ChangeLog
index 9247ca021..4cf384c04 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,30 @@
120001123
2 - (bal) Merge OpenBSD changes:
3 - markus@cvs.openbsd.org 2000/11/15 22:31:36
4 [auth-options.c]
5 case insensitive key options; from stevesk@sweeden.hp.com
6 - markus@cvs.openbsd.org 2000/11/16 17:55:43
7 [dh.c]
8 do not use perror() in sshd, after child is forked()
9 - markus@cvs.openbsd.org 2000/11/14 23:42:40
10 [auth-rsa.c]
11 parse option only if key matches; fix some confusing seen by the client
12 - markus@cvs.openbsd.org 2000/11/14 23:44:19
13 [session.c]
14 check no_agent_forward_flag for ssh-2, too
15 - markus@cvs.openbsd.org 2000/11/15
16 [ssh-agent.1]
17 reorder SYNOPSIS; typo, use .It
18 - markus@cvs.openbsd.org 2000/11/14 23:48:55
19 [ssh-agent.c]
20 do not reorder keys if a key is removed
21 - markus@cvs.openbsd.org 2000/11/15 19:58:08
22 [ssh.c]
23 just ignore non existing user keys
24 - millert@cvs.openbsd.org 200/11/15 20:24:43
25 [ssh-keygen.c]
26 Add missing \n at end of error message.
27
120001122 2820001122
2 - (bal) Minor patch to ensure platforms lacking IRIX job limit supports 29 - (bal) Minor patch to ensure platforms lacking IRIX job limit supports
3 are compilable. 30 are compilable.
diff --git a/auth-options.c b/auth-options.c
index c9c149d69..181bf7321 100644
--- a/auth-options.c
+++ b/auth-options.c
@@ -14,7 +14,7 @@
14 */ 14 */
15 15
16#include "includes.h" 16#include "includes.h"
17RCSID("$OpenBSD: auth-options.c,v 1.5 2000/10/09 21:32:34 markus Exp $"); 17RCSID("$OpenBSD: auth-options.c,v 1.6 2000/11/15 22:31:36 markus Exp $");
18 18
19#include "ssh.h" 19#include "ssh.h"
20#include "packet.h" 20#include "packet.h"
@@ -65,35 +65,35 @@ auth_parse_options(struct passwd *pw, char *options, unsigned long linenum)
65 65
66 while (*options && *options != ' ' && *options != '\t') { 66 while (*options && *options != ' ' && *options != '\t') {
67 cp = "no-port-forwarding"; 67 cp = "no-port-forwarding";
68 if (strncmp(options, cp, strlen(cp)) == 0) { 68 if (strncasecmp(options, cp, strlen(cp)) == 0) {
69 packet_send_debug("Port forwarding disabled."); 69 packet_send_debug("Port forwarding disabled.");
70 no_port_forwarding_flag = 1; 70 no_port_forwarding_flag = 1;
71 options += strlen(cp); 71 options += strlen(cp);
72 goto next_option; 72 goto next_option;
73 } 73 }
74 cp = "no-agent-forwarding"; 74 cp = "no-agent-forwarding";
75 if (strncmp(options, cp, strlen(cp)) == 0) { 75 if (strncasecmp(options, cp, strlen(cp)) == 0) {
76 packet_send_debug("Agent forwarding disabled."); 76 packet_send_debug("Agent forwarding disabled.");
77 no_agent_forwarding_flag = 1; 77 no_agent_forwarding_flag = 1;
78 options += strlen(cp); 78 options += strlen(cp);
79 goto next_option; 79 goto next_option;
80 } 80 }
81 cp = "no-X11-forwarding"; 81 cp = "no-X11-forwarding";
82 if (strncmp(options, cp, strlen(cp)) == 0) { 82 if (strncasecmp(options, cp, strlen(cp)) == 0) {
83 packet_send_debug("X11 forwarding disabled."); 83 packet_send_debug("X11 forwarding disabled.");
84 no_x11_forwarding_flag = 1; 84 no_x11_forwarding_flag = 1;
85 options += strlen(cp); 85 options += strlen(cp);
86 goto next_option; 86 goto next_option;
87 } 87 }
88 cp = "no-pty"; 88 cp = "no-pty";
89 if (strncmp(options, cp, strlen(cp)) == 0) { 89 if (strncasecmp(options, cp, strlen(cp)) == 0) {
90 packet_send_debug("Pty allocation disabled."); 90 packet_send_debug("Pty allocation disabled.");
91 no_pty_flag = 1; 91 no_pty_flag = 1;
92 options += strlen(cp); 92 options += strlen(cp);
93 goto next_option; 93 goto next_option;
94 } 94 }
95 cp = "command=\""; 95 cp = "command=\"";
96 if (strncmp(options, cp, strlen(cp)) == 0) { 96 if (strncasecmp(options, cp, strlen(cp)) == 0) {
97 int i; 97 int i;
98 options += strlen(cp); 98 options += strlen(cp);
99 forced_command = xmalloc(strlen(options) + 1); 99 forced_command = xmalloc(strlen(options) + 1);
@@ -121,7 +121,7 @@ auth_parse_options(struct passwd *pw, char *options, unsigned long linenum)
121 goto next_option; 121 goto next_option;
122 } 122 }
123 cp = "environment=\""; 123 cp = "environment=\"";
124 if (strncmp(options, cp, strlen(cp)) == 0) { 124 if (strncasecmp(options, cp, strlen(cp)) == 0) {
125 int i; 125 int i;
126 char *s; 126 char *s;
127 struct envstring *new_envstring; 127 struct envstring *new_envstring;
@@ -156,7 +156,7 @@ auth_parse_options(struct passwd *pw, char *options, unsigned long linenum)
156 goto next_option; 156 goto next_option;
157 } 157 }
158 cp = "from=\""; 158 cp = "from=\"";
159 if (strncmp(options, cp, strlen(cp)) == 0) { 159 if (strncasecmp(options, cp, strlen(cp)) == 0) {
160 int mname, mip; 160 int mname, mip;
161 char *patterns = xmalloc(strlen(options) + 1); 161 char *patterns = xmalloc(strlen(options) + 1);
162 int i; 162 int i;
diff --git a/auth-rsa.c b/auth-rsa.c
index e8bfa1651..72cb909d7 100644
--- a/auth-rsa.c
+++ b/auth-rsa.c
@@ -14,7 +14,7 @@
14 */ 14 */
15 15
16#include "includes.h" 16#include "includes.h"
17RCSID("$OpenBSD: auth-rsa.c,v 1.32 2000/10/14 12:19:45 markus Exp $"); 17RCSID("$OpenBSD: auth-rsa.c,v 1.33 2000/11/14 23:42:40 markus Exp $");
18 18
19#include "rsa.h" 19#include "rsa.h"
20#include "packet.h" 20#include "packet.h"
@@ -231,12 +231,6 @@ auth_rsa(struct passwd *pw, BIGNUM *client_n)
231 } 231 }
232 } else 232 } else
233 options = NULL; 233 options = NULL;
234 /*
235 * If our options do not allow this key to be used,
236 * do not send challenge.
237 */
238 if (!auth_parse_options(pw, options, linenum))
239 continue;
240 234
241 /* Parse the key from the line. */ 235 /* Parse the key from the line. */
242 if (!auth_rsa_read_key(&cp, &bits, pk->e, pk->n)) { 236 if (!auth_rsa_read_key(&cp, &bits, pk->e, pk->n)) {
@@ -259,6 +253,12 @@ auth_rsa(struct passwd *pw, BIGNUM *client_n)
259 file, linenum, BN_num_bits(pk->n), bits); 253 file, linenum, BN_num_bits(pk->n), bits);
260 254
261 /* We have found the desired key. */ 255 /* We have found the desired key. */
256 /*
257 * If our options do not allow this key to be used,
258 * do not send challenge.
259 */
260 if (!auth_parse_options(pw, options, linenum))
261 continue;
262 262
263 /* Perform the challenge-response dialog for this key. */ 263 /* Perform the challenge-response dialog for this key. */
264 if (!auth_rsa_challenge_dialog(pk)) { 264 if (!auth_rsa_challenge_dialog(pk)) {
diff --git a/dh.c b/dh.c
index ff84619cf..35e901433 100644
--- a/dh.c
+++ b/dh.c
@@ -23,7 +23,7 @@
23 */ 23 */
24 24
25#include "includes.h" 25#include "includes.h"
26RCSID("$OpenBSD: dh.c,v 1.2 2000/10/11 20:11:35 markus Exp $"); 26RCSID("$OpenBSD: dh.c,v 1.3 2000/11/16 17:55:43 markus Exp $");
27 27
28#include "xmalloc.h" 28#include "xmalloc.h"
29 29
@@ -102,7 +102,6 @@ choose_dh(int minbits)
102 102
103 f = fopen(DH_PRIMES, "r"); 103 f = fopen(DH_PRIMES, "r");
104 if (!f) { 104 if (!f) {
105 perror(DH_PRIMES);
106 log("WARNING: %s does not exist, using old prime", DH_PRIMES); 105 log("WARNING: %s does not exist, using old prime", DH_PRIMES);
107 return (dh_new_group1()); 106 return (dh_new_group1());
108 } 107 }
@@ -133,8 +132,7 @@ choose_dh(int minbits)
133 132
134 f = fopen(DH_PRIMES, "r"); 133 f = fopen(DH_PRIMES, "r");
135 if (!f) { 134 if (!f) {
136 perror(DH_PRIMES); 135 fatal("WARNING: %s dissappeared, giving up", DH_PRIMES);
137 exit(1);
138 } 136 }
139 137
140 linenum = 0; 138 linenum = 0;
diff --git a/session.c b/session.c
index 890e16d59..826307ef1 100644
--- a/session.c
+++ b/session.c
@@ -33,7 +33,7 @@
33 */ 33 */
34 34
35#include "includes.h" 35#include "includes.h"
36RCSID("$OpenBSD: session.c,v 1.43 2000/11/06 23:04:56 markus Exp $"); 36RCSID("$OpenBSD: session.c,v 1.44 2000/11/14 23:44:19 markus Exp $");
37 37
38#include "xmalloc.h" 38#include "xmalloc.h"
39#include "ssh.h" 39#include "ssh.h"
@@ -1745,6 +1745,10 @@ session_auth_agent_req(Session *s)
1745{ 1745{
1746 static int called = 0; 1746 static int called = 0;
1747 packet_done(); 1747 packet_done();
1748 if (no_agent_forwarding_flag) {
1749 debug("session_auth_agent_req: no_agent_forwarding_flag");
1750 return 0;
1751 }
1748 if (called) { 1752 if (called) {
1749 return 0; 1753 return 0;
1750 } else { 1754 } else {
diff --git a/ssh-agent.1 b/ssh-agent.1
index 31ea2b318..3ee5074b6 100644
--- a/ssh-agent.1
+++ b/ssh-agent.1
@@ -1,4 +1,4 @@
1.\" $OpenBSD: ssh-agent.1,v 1.17 2000/11/10 05:10:40 aaron Exp $ 1.\" $OpenBSD: ssh-agent.1,v 1.19 2000/11/15 20:09:01 markus Exp $
2.\" 2.\"
3.\" Author: Tatu Ylonen <ylo@cs.hut.fi> 3.\" Author: Tatu Ylonen <ylo@cs.hut.fi>
4.\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4.\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -42,12 +42,12 @@
42.Nd authentication agent 42.Nd authentication agent
43.Sh SYNOPSIS 43.Sh SYNOPSIS
44.Nm ssh-agent 44.Nm ssh-agent
45.Op Fl c Li | Fl s
46.Op Fl k
47.Oo
48.Ar command 45.Ar command
49.Op Ar args ... 46.Ar args ...
50.Oc 47.Nm ssh-agent
48.Op Fl c Li | Fl s
49.Nm ssh-agent
50.Fl k
51.Sh DESCRIPTION 51.Sh DESCRIPTION
52.Nm 52.Nm
53is a program to hold private keys used for public key authentication 53is a program to hold private keys used for public key authentication
@@ -154,7 +154,7 @@ but is normally added to the agent using
154at login time. 154at login time.
155.It Pa $HOME/.ssh/id_dsa 155.It Pa $HOME/.ssh/id_dsa
156Contains the DSA authentication identity of the user. 156Contains the DSA authentication identity of the user.
157.Pq Pa /tmp/ssh-XXXXXXXX/agent.<pid> , 157.It Pa /tmp/ssh-XXXXXXXX/agent.<pid>
158Unix-domain sockets used to contain the connection to the 158Unix-domain sockets used to contain the connection to the
159authentication agent. 159authentication agent.
160These sockets should only be readable by the owner. 160These sockets should only be readable by the owner.
@@ -172,7 +172,7 @@ This version of OpenSSH
172.Bl -bullet 172.Bl -bullet
173.It 173.It
174has all components of a restrictive nature (i.e., patents, see 174has all components of a restrictive nature (i.e., patents, see
175.Xr crypto 3 ) 175.Xr ssl 8 )
176directly removed from the source code; any licensed or patented components 176directly removed from the source code; any licensed or patented components
177are chosen from 177are chosen from
178external libraries. 178external libraries.
@@ -191,4 +191,4 @@ supports one-time password authentication with
191.Xr ssh-add 1 , 191.Xr ssh-add 1 ,
192.Xr ssh-keygen 1 , 192.Xr ssh-keygen 1 ,
193.Xr sshd 8 , 193.Xr sshd 8 ,
194.Xr crypto 3 194.Xr ssl 8
diff --git a/ssh-agent.c b/ssh-agent.c
index f5f87cca3..6f89dd5ca 100644
--- a/ssh-agent.c
+++ b/ssh-agent.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh-agent.c,v 1.39 2000/11/12 19:50:38 markus Exp $ */ 1/* $OpenBSD: ssh-agent.c,v 1.40 2000/11/14 23:48:55 markus Exp $ */
2 2
3/* 3/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -37,7 +37,7 @@
37 */ 37 */
38 38
39#include "includes.h" 39#include "includes.h"
40RCSID("$OpenBSD: ssh-agent.c,v 1.39 2000/11/12 19:50:38 markus Exp $"); 40RCSID("$OpenBSD: ssh-agent.c,v 1.40 2000/11/14 23:48:55 markus Exp $");
41 41
42#include "ssh.h" 42#include "ssh.h"
43#include "rsa.h" 43#include "rsa.h"
@@ -308,8 +308,9 @@ process_remove_identity(SocketEntry *e, int version)
308 /* 308 /*
309 * We have this key. Free the old key. Since we 309 * We have this key. Free the old key. Since we
310 * don\'t want to leave empty slots in the middle of 310 * don\'t want to leave empty slots in the middle of
311 * the array, we actually free the key there and copy 311 * the array, we actually free the key there and move
312 * data from the last entry. 312 * all the entries between the empty slot and the end
313 * of the array.
313 */ 314 */
314 Idtab *tab = idtab_lookup(version); 315 Idtab *tab = idtab_lookup(version);
315 key_free(tab->identities[idx].key); 316 key_free(tab->identities[idx].key);
@@ -318,8 +319,13 @@ process_remove_identity(SocketEntry *e, int version)
318 fatal("process_remove_identity: " 319 fatal("process_remove_identity: "
319 "internal error: tab->nentries %d", 320 "internal error: tab->nentries %d",
320 tab->nentries); 321 tab->nentries);
321 if (idx != tab->nentries - 1) 322 if (idx != tab->nentries - 1) {
322 tab->identities[idx] = tab->identities[tab->nentries - 1]; 323 int i;
324 for (i = idx; i < tab->nentries - 1; i++)
325 tab->identities[i] = tab->identities[i+1];
326 }
327 tab->identities[tab->nentries - 1].key = NULL;
328 tab->identities[tab->nentries - 1].comment = NULL;
323 tab->nentries--; 329 tab->nentries--;
324 success = 1; 330 success = 1;
325 } 331 }
diff --git a/ssh-keygen.c b/ssh-keygen.c
index 3653fc244..5da90035a 100644
--- a/ssh-keygen.c
+++ b/ssh-keygen.c
@@ -12,7 +12,7 @@
12 */ 12 */
13 13
14#include "includes.h" 14#include "includes.h"
15RCSID("$OpenBSD: ssh-keygen.c,v 1.33 2000/11/12 19:50:38 markus Exp $"); 15RCSID("$OpenBSD: ssh-keygen.c,v 1.34 2000/11/15 20:24:43 millert Exp $");
16 16
17#include <openssl/evp.h> 17#include <openssl/evp.h>
18#include <openssl/pem.h> 18#include <openssl/pem.h>
@@ -727,7 +727,7 @@ main(int ac, char **av)
727 if (key_type_name != NULL) { 727 if (key_type_name != NULL) {
728 type = key_type_from_name(key_type_name); 728 type = key_type_from_name(key_type_name);
729 if (type == KEY_UNSPEC) { 729 if (type == KEY_UNSPEC) {
730 fprintf(stderr, "unknown key type %s", key_type_name); 730 fprintf(stderr, "unknown key type %s\n", key_type_name);
731 exit(1); 731 exit(1);
732 } 732 }
733 } 733 }
diff --git a/ssh.c b/ssh.c
index a1cedc7e0..b41c87e12 100644
--- a/ssh.c
+++ b/ssh.c
@@ -39,7 +39,7 @@
39 */ 39 */
40 40
41#include "includes.h" 41#include "includes.h"
42RCSID("$OpenBSD: ssh.c,v 1.72 2000/11/12 19:50:38 markus Exp $"); 42RCSID("$OpenBSD: ssh.c,v 1.73 2000/11/15 19:58:08 markus Exp $");
43 43
44#include <openssl/evp.h> 44#include <openssl/evp.h>
45#include <openssl/dsa.h> 45#include <openssl/dsa.h>
@@ -1049,7 +1049,7 @@ guess_identity_file_type(const char *filename)
1049 int type = KEY_RSA1; /* default */ 1049 int type = KEY_RSA1; /* default */
1050 1050
1051 if (stat(filename, &st) < 0) { 1051 if (stat(filename, &st) < 0) {
1052 perror(filename); 1052 /* ignore this key */
1053 return KEY_UNSPEC; 1053 return KEY_UNSPEC;
1054 } 1054 }
1055 public = key_new(type); 1055 public = key_new(type);