Ticket #42523: 002-Apple-keychain-integration-other-changes.patch.diff
File 002-Apple-keychain-integration-other-changes.patch.diff, 42.4 KB (added by arthurmesh@…, 11 years ago) |
---|
-
0002-Apple-keychain-integration-other-changes.patch
old new 1 # HG changeset patch 2 # User Sean Farley <sean.michael.farley@gmail.com> 3 # Date 1382624667 -28800 4 # Thu Oct 24 22:24:27 2013 +0800 5 # Node ID dd6d51b7e12be5fab94a8779e890c5558e4d4001 6 # Parent 86a3bc5c8ff689a291e86950a3d8fd327f42b870 7 partial import 8 9 10 wiggled scp 11 12 13 wiggled readconf 14 15 16 wiggled readconf.c 17 18 diff --git a/Makefile.in b/Makefile.in 19 --- a/Makefile.in 20 +++ b/Makefile.in 21 @@ -56,10 +56,11 @@ 22 PERL=@PERL@ 23 SED=@SED@ 1 diff -urp openssh-6.5p1/Makefile.in openssh-6.5p1.patched/Makefile.in 2 --- openssh-6.5p1/Makefile.in 2014-01-26 22:35:04.000000000 -0800 3 +++ openssh-6.5p1.patched/Makefile.in 2014-02-15 16:27:53.000000000 -0800 4 @@ -58,6 +58,7 @@ SED=@SED@ 24 5 ENT=@ENT@ 25 6 XAUTH_PATH=@XAUTH_PATH@ 26 7 LDFLAGS=-L. -Lopenbsd-compat/ @LDFLAGS@ … … 28 9 EXEEXT=@EXEEXT@ 29 10 MANFMT=@MANFMT@ 30 11 31 TARGETS=ssh$(EXEEXT) sshd$(EXEEXT) ssh-add$(EXEEXT) ssh-keygen$(EXEEXT) ssh-keyscan${EXEEXT} ssh-keysign${EXEEXT} ssh-pkcs11-helper$(EXEEXT) ssh-agent$(EXEEXT) scp$(EXEEXT) sftp-server$(EXEEXT) sftp$(EXEEXT) 32 33 @@ -93,10 +94,12 @@ 34 sftp-server.o sftp-common.o \ 35 roaming_common.o roaming_serv.o \ 12 @@ -98,6 +99,8 @@ SSHDOBJS=sshd.o auth-rhosts.o auth-passw 36 13 sandbox-null.o sandbox-rlimit.o sandbox-systrace.o sandbox-darwin.o \ 37 sandbox-seccomp-filter.o 14 sandbox-seccomp-filter.o sandbox-capsicum.o 38 15 39 16 +KEYCHAINOBJS=keychain.o 40 17 + 41 18 MANPAGES = moduli.5.out scp.1.out ssh-add.1.out ssh-agent.1.out ssh-keygen.1.out ssh-keyscan.1.out ssh.1.out sshd.8.out sftp-server.8.out sftp.1.out ssh-keysign.8.out ssh-pkcs11-helper.8.out sshd_config.5.out ssh_config.5.out 42 19 MANPAGES_IN = moduli.5 scp.1 ssh-add.1 ssh-agent.1 ssh-keygen.1 ssh-keyscan.1 ssh.1 sshd.8 sftp-server.8 sftp.1 ssh-keysign.8 ssh-pkcs11-helper.8 sshd_config.5 ssh_config.5 43 20 MANTYPE = @MANTYPE@ 44 45 CONFIGFILES=sshd_config.out ssh_config.out moduli.out 46 @@ -127,10 +130,11 @@ 47 all: $(CONFIGFILES) $(MANPAGES) $(TARGETS) 48 21 @@ -133,6 +136,7 @@ all: $(CONFIGFILES) $(MANPAGES) $(TARGET 49 22 $(LIBSSH_OBJS): Makefile.in config.h 50 23 $(SSHOBJS): Makefile.in config.h 51 24 $(SSHDOBJS): Makefile.in config.h … … 53 26 54 27 .c.o: 55 28 $(CC) $(CFLAGS) $(CPPFLAGS) -c $< 56 57 LIBCOMPAT=openbsd-compat/libopenbsd-compat.a 58 @@ -140,24 +144,24 @@ 59 60 libssh.a: $(LIBSSH_OBJS) 29 @@ -146,8 +150,8 @@ libssh.a: $(LIBSSH_OBJS) 61 30 $(AR) rv $@ $(LIBSSH_OBJS) 62 31 $(RANLIB) $@ 63 32 … … 68 37 69 38 sshd$(EXEEXT): libssh.a $(LIBCOMPAT) $(SSHDOBJS) 70 39 $(LD) -o $@ $(SSHDOBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(SSHDLIBS) $(LIBS) $(GSSLIBS) $(K5LIBS) 71 40 @@ -155,11 +159,11 @@ sshd$(EXEEXT): libssh.a $(LIBCOMPAT) $(S 72 41 scp$(EXEEXT): $(LIBCOMPAT) libssh.a scp.o progressmeter.o 73 42 $(LD) -o $@ scp.o progressmeter.o bufaux.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) 74 43 … … 84 53 85 54 ssh-keygen$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-keygen.o 86 55 $(LD) -o $@ ssh-keygen.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) 87 88 ssh-keysign$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-keysign.o roaming_dummy.o readconf.o 89 @@ -265,11 +269,11 @@ 90 $(INSTALL) -m 0755 $(STRIP_OPT) ssh-add$(EXEEXT) $(DESTDIR)$(bindir)/ssh-add$(EXEEXT) 91 $(INSTALL) -m 0755 $(STRIP_OPT) ssh-agent$(EXEEXT) $(DESTDIR)$(bindir)/ssh-agent$(EXEEXT) 56 @@ -271,7 +275,7 @@ install-files: 92 57 $(INSTALL) -m 0755 $(STRIP_OPT) ssh-keygen$(EXEEXT) $(DESTDIR)$(bindir)/ssh-keygen$(EXEEXT) 93 58 $(INSTALL) -m 0755 $(STRIP_OPT) ssh-keyscan$(EXEEXT) $(DESTDIR)$(bindir)/ssh-keyscan$(EXEEXT) 94 59 $(INSTALL) -m 0755 $(STRIP_OPT) sshd$(EXEEXT) $(DESTDIR)$(sbindir)/sshd$(EXEEXT) … … 97 62 $(INSTALL) -m 0755 $(STRIP_OPT) ssh-pkcs11-helper$(EXEEXT) $(DESTDIR)$(SSH_PKCS11_HELPER)$(EXEEXT) 98 63 $(INSTALL) -m 0755 $(STRIP_OPT) sftp$(EXEEXT) $(DESTDIR)$(bindir)/sftp$(EXEEXT) 99 64 $(INSTALL) -m 0755 $(STRIP_OPT) sftp-server$(EXEEXT) $(DESTDIR)$(SFTP_SERVER)$(EXEEXT) 100 $(INSTALL) -m 644 ssh.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh.1 101 $(INSTALL) -m 644 scp.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/scp.1 102 diff --git a/audit-bsm.c b/audit-bsm.c 103 --- a/audit-bsm.c 104 +++ b/audit-bsm.c 105 @@ -261,11 +261,16 @@ 106 uid_t uid = -1; 107 gid_t gid = -1; 65 Only in openssh-6.5p1.patched: Makefile.in.orig 66 Only in openssh-6.5p1.patched: Makefile.in.rej 67 diff -urp openssh-6.5p1/audit-bsm.c openssh-6.5p1.patched/audit-bsm.c 68 --- openssh-6.5p1/audit-bsm.c 2012-02-23 15:40:43.000000000 -0800 69 +++ openssh-6.5p1.patched/audit-bsm.c 2014-02-15 16:25:56.000000000 -0800 70 @@ -263,7 +263,12 @@ bsm_audit_record(int typ, char *string, 108 71 pid_t pid = getpid(); 109 72 AuditInfoTermID tid = ssh_bsm_tid; 110 73 … … 118 81 uid = the_authctxt->pw->pw_uid; 119 82 gid = the_authctxt->pw->pw_gid; 120 83 } 121 122 rc = (typ == 0) ? 0 : -1; 123 diff --git a/auth-pam.c b/auth-pam.c 124 --- a/auth-pam.c 125 +++ b/auth-pam.c 126 @@ -789,14 +789,15 @@ 127 **echo_on = 0; 128 ctxt->pam_done = 1; 84 diff -urp openssh-6.5p1/auth-pam.c openssh-6.5p1.patched/auth-pam.c 85 --- openssh-6.5p1/auth-pam.c 2013-12-18 16:31:45.000000000 -0800 86 +++ openssh-6.5p1.patched/auth-pam.c 2014-02-15 16:25:56.000000000 -0800 87 @@ -793,10 +793,11 @@ sshpam_query(void *ctx, char **name, cha 129 88 free(msg); 130 89 return (0); 131 90 } … … 139 98 /* FALLTHROUGH */ 140 99 default: 141 100 *num = 0; 142 **echo_on = 0; 143 free(msg); 144 diff --git a/auth.c b/auth.c 145 --- a/auth.c 146 +++ b/auth.c 147 @@ -209,11 +209,11 @@ 148 return 0; 149 } 101 Only in openssh-6.5p1.patched: auth-pam.c.orig 102 diff -urp openssh-6.5p1/auth.c openssh-6.5p1.patched/auth.c 103 --- openssh-6.5p1/auth.c 2013-06-01 14:41:51.000000000 -0700 104 +++ openssh-6.5p1.patched/auth.c 2014-02-15 16:25:56.000000000 -0800 105 @@ -211,7 +211,7 @@ allowed_user(struct passwd * pw) 150 106 } 151 107 if (options.num_deny_groups > 0 || options.num_allow_groups > 0) { 152 108 /* Get the user's group access list (primary and supplementary) */ … … 155 111 logit("User %.100s from %.100s not allowed because " 156 112 "not in any group", pw->pw_name, hostname); 157 113 return 0; 158 } 159 160 diff --git a/authfd.c b/authfd.c 161 --- a/authfd.c 162 +++ b/authfd.c 163 @@ -687,10 +687,33 @@ 164 type = buffer_get_char(&msg); 165 buffer_free(&msg); 114 diff -urp openssh-6.5p1/authfd.c openssh-6.5p1.patched/authfd.c 115 --- openssh-6.5p1/authfd.c 2013-12-28 22:49:56.000000000 -0800 116 +++ openssh-6.5p1.patched/authfd.c 2014-02-15 16:25:56.000000000 -0800 117 @@ -638,6 +638,29 @@ ssh_remove_all_identities(Authentication 166 118 return decode_reply(type); 167 119 } 168 120 … … 192 144 int 193 145 decode_reply(int type) 194 146 { 195 switch (type) { 196 case SSH_AGENT_FAILURE: 197 diff --git a/authfd.h b/authfd.h 198 --- a/authfd.h 199 +++ b/authfd.h 200 @@ -47,10 +47,13 @@ 201 /* add key with constraints */ 202 #define SSH_AGENTC_ADD_RSA_ID_CONSTRAINED 24 147 Only in openssh-6.5p1.patched: authfd.c.orig 148 diff -urp openssh-6.5p1/authfd.h openssh-6.5p1.patched/authfd.h 149 --- openssh-6.5p1/authfd.h 2009-10-06 14:47:02.000000000 -0700 150 +++ openssh-6.5p1.patched/authfd.h 2014-02-15 16:25:56.000000000 -0800 151 @@ -49,6 +49,9 @@ 203 152 #define SSH2_AGENTC_ADD_ID_CONSTRAINED 25 204 153 #define SSH_AGENTC_ADD_SMARTCARD_KEY_CONSTRAINED 26 205 154 … … 209 158 #define SSH_AGENT_CONSTRAIN_LIFETIME 1 210 159 #define SSH_AGENT_CONSTRAIN_CONFIRM 2 211 160 212 /* extended failure messages */ 213 #define SSH2_AGENT_FAILURE 30 214 diff --git a/config.h.in b/config.h.in 215 --- a/config.h.in 216 +++ b/config.h.in 217 @@ -75,10 +75,22 @@ 218 #undef BROKEN_SNPRINTF 219 220 /* FreeBSD strnvis does not do what we need */ 161 diff -urp openssh-6.5p1/config.h.in openssh-6.5p1.patched/config.h.in 162 --- openssh-6.5p1/config.h.in 2014-01-29 17:52:44.000000000 -0800 163 +++ openssh-6.5p1.patched/config.h.in 2014-02-15 16:28:51.000000000 -0800 164 @@ -81,6 +81,18 @@ 165 /* FreeBSD strnvis argument order is swapped compared to OpenBSD */ 221 166 #undef BROKEN_STRNVIS 222 167 223 168 +/* platform uses an in-memory credentials cache */ … … 235 180 /* tcgetattr with ICANON may hang */ 236 181 #undef BROKEN_TCGETATTR_ICANON 237 182 238 /* updwtmpx is broken (if present) */ 239 #undef BROKEN_UPDWTMPX 240 diff --git a/configure.ac b/configure.ac 241 --- a/configure.ac 242 +++ b/configure.ac 243 @@ -4548,14 +4548,44 @@ 244 #ifdef HAVE_LASTLOG_H 245 #include <lastlog.h> 183 Only in openssh-6.5p1.patched: config.h.in.orig 184 Only in openssh-6.5p1.patched: config.h.in.rej 185 diff -urp openssh-6.5p1/configure.ac openssh-6.5p1.patched/configure.ac 186 --- openssh-6.5p1/configure.ac 2014-01-29 16:26:46.000000000 -0800 187 +++ openssh-6.5p1.patched/configure.ac 2014-02-15 16:25:56.000000000 -0800 188 @@ -4779,10 +4779,40 @@ AC_CHECK_MEMBER([struct utmp.ut_line], [ 246 189 #endif 247 190 ]) 248 191 … … 283 226 if test "x$ac_cv_func_getaddrinfo" != "xyes" ; then 284 227 TEST_SSH_IPV6=no 285 228 else 286 TEST_SSH_IPV6=yes 287 fi 288 diff --git a/groupaccess.c b/groupaccess.c 289 --- a/groupaccess.c 290 +++ b/groupaccess.c 291 @@ -32,62 +32,107 @@ 292 #include <unistd.h> 293 #include <stdarg.h> 229 Only in openssh-6.5p1.patched: configure.ac.orig 230 diff -urp openssh-6.5p1/groupaccess.c openssh-6.5p1.patched/groupaccess.c 231 --- openssh-6.5p1/groupaccess.c 2013-06-01 15:07:32.000000000 -0700 232 +++ openssh-6.5p1.patched/groupaccess.c 2014-02-15 16:25:56.000000000 -0800 233 @@ -34,38 +34,67 @@ 294 234 #include <stdlib.h> 295 235 #include <string.h> 296 236 … … 340 280 ngroups = NGROUPS_MAX; 341 281 #if defined(HAVE_SYSCONF) && defined(_SC_NGROUPS_MAX) 342 282 ngroups = MAX(NGROUPS_MAX, sysconf(_SC_NGROUPS_MAX)); 283 -#endif 284 - 343 285 +#endif 344 +groups_bygid = xcalloc(ngroups, sizeof(*groups_bygid));286 groups_bygid = xcalloc(ngroups, sizeof(*groups_bygid)); 345 287 +#else 346 288 + if (-1 == (ngroups = getgrouplist_2(pw->pw_name, pw->pw_gid, 347 289 + &groups_bygid))) { 348 290 + logit("getgrouplist_2 failed"); 349 291 + return 0; 350 292 + } 351 #endif 352 - 353 - groups_bygid = xcalloc(ngroups, sizeof(*groups_bygid)); 293 +#endif 354 294 groups_byname = xcalloc(ngroups, sizeof(*groups_byname)); 355 295 - 356 296 - if (getgrouplist(user, base, groups_bygid, &ngroups) == -1) … … 365 305 for (i = 0, j = 0; i < ngroups; i++) 366 306 if ((gr = getgrgid(groups_bygid[i])) != NULL) 367 307 groups_byname[j++] = xstrdup(gr->gr_name); 368 free(groups_bygid); 369 return (ngroups = j); 370 } 371 308 @@ -76,16 +105,32 @@ ga_init(const char *user, gid_t base) 372 309 /* 373 310 * Return 1 if one of user's groups is contained in groups. 374 311 * Return 0 otherwise. Use match_pattern() for string comparison. … … 401 338 return 0; 402 339 } 403 340 404 /* 405 * Return 1 if one of user's groups matches group_pattern list. 406 diff --git a/groupaccess.h b/groupaccess.h 407 --- a/groupaccess.h 408 +++ b/groupaccess.h 409 @@ -25,11 +25,11 @@ 410 */ 411 341 diff -urp openssh-6.5p1/groupaccess.h openssh-6.5p1.patched/groupaccess.h 342 --- openssh-6.5p1/groupaccess.h 2008-07-03 20:51:12.000000000 -0700 343 +++ openssh-6.5p1.patched/groupaccess.h 2014-02-15 16:25:56.000000000 -0800 344 @@ -27,7 +27,7 @@ 412 345 #ifndef GROUPACCESS_H 413 346 #define GROUPACCESS_H 414 347 … … 417 350 int ga_match(char * const *, int); 418 351 int ga_match_pattern_list(const char *); 419 352 void ga_free(void); 420 421 #endif422 353 diff --git a/keychain.c b/keychain.c 423 354 new file mode 100644 424 355 --- /dev/null … … 1168 1099 +int add_identities_using_keychain( 1169 1100 + int (*add_identity)(const char *, const char *)); 1170 1101 +char *keychain_read_passphrase(const char *filename, int oAskPassGUI); 1171 diff --git a/readconf.c b/readconf.c 1172 --- a/readconf.c 1173 +++ b/readconf.c 1174 @@ -136,10 +136,13 @@ 1175 oSendEnv, oControlPath, oControlMaster, oControlPersist, 1176 oHashKnownHosts, 1177 oTunnel, oTunnelDevice, oLocalCommand, oPermitLocalCommand, 1178 oVisualHostKey, oUseRoaming, oZeroKnowledgePasswordAuthentication, 1179 oKexAlgorithms, oIPQoS, oRequestTTY, oIgnoreUnknown, 1102 diff -urp openssh-6.5p1/readconf.c openssh-6.5p1.patched/readconf.c 1103 --- openssh-6.5p1/readconf.c 2014-01-17 05:03:57.000000000 -0800 1104 +++ openssh-6.5p1.patched/readconf.c 2014-02-15 16:30:49.000000000 -0800 1105 @@ -148,6 +148,9 @@ typedef enum { 1106 oKexAlgorithms, oIPQoS, oRequestTTY, oIgnoreUnknown, oProxyUseFdpass, 1107 oCanonicalDomains, oCanonicalizeHostname, oCanonicalizeMaxDots, 1108 oCanonicalizeFallbackLocal, oCanonicalizePermittedCNAMEs, 1180 1109 +#ifdef __APPLE_KEYCHAIN__ 1181 1110 + oAskPassGUI, 1182 1111 +#endif 1183 1112 oIgnoredUnknownOption, oDeprecated, oUnsupported 1184 1113 } OpCodes; 1185 1114 1186 /* Textual representations of the tokens. */ 1187 1188 @@ -248,11 +251,13 @@ 1189 #endif 1190 { "kexalgorithms", oKexAlgorithms }, 1191 { "ipqos", oIPQoS }, 1192 { "requesttty", oRequestTTY }, 1115 @@ -267,6 +270,9 @@ static struct { 1116 { "canonicalizemaxdots", oCanonicalizeMaxDots }, 1117 { "canonicalizepermittedcnames", oCanonicalizePermittedCNAMEs }, 1193 1118 { "ignoreunknown", oIgnoreUnknown }, 1194 -1195 1119 +#ifdef __APPLE_KEYCHAIN__ 1196 1120 + { "askpassgui", oAskPassGUI }, 1197 1121 +#endif 1122 1198 1123 { NULL, oBadOption } 1199 1124 }; 1200 1201 /* 1202 * Adds a local TCP/IP port forward to options. Never returns if there is an 1203 @@ -1070,10 +1075,16 @@ 1204 1205 case oIgnoreUnknown: 1125 @@ -1332,6 +1338,12 @@ parse_int: 1206 1126 charptr = &options->ignored_unknown; 1207 1127 goto parse_string; 1208 1128 … … 1212 1132 + goto parse_flag; 1213 1133 +#endif 1214 1134 + 1215 case oDeprecated: 1216 debug("%s line %d: Deprecated option \"%s\"", 1217 filename, linenum, keyword); 1218 return 0; 1219 1220 @@ -1232,10 +1243,13 @@ 1221 options->zero_knowledge_password_authentication = -1; 1222 options->ip_qos_interactive = -1; 1223 options->ip_qos_bulk = -1; 1135 case oProxyUseFdpass: 1136 intptr = &options->proxy_use_fdpass; 1137 goto parse_flag; 1138 @@ -1555,6 +1567,9 @@ initialize_options(Options * options) 1224 1139 options->request_tty = -1; 1140 options->proxy_use_fdpass = -1; 1225 1141 options->ignored_unknown = NULL; 1226 1142 +#ifdef __APPLE_KEYCHAIN__ 1227 1143 + options->ask_pass_gui = -1; 1228 1144 +#endif 1229 } 1230 1231 /* 1232 * Called after processing other sources of option data, this fills those 1233 * options for which no value has been specified with their default values. 1234 @@ -1383,10 +1397,14 @@ 1235 options->ip_qos_interactive = IPTOS_LOWDELAY; 1236 if (options->ip_qos_bulk == -1) 1145 options->num_canonical_domains = 0; 1146 options->num_permitted_cnames = 0; 1147 options->canonicalize_max_dots = -1; 1148 @@ -1713,6 +1728,10 @@ fill_default_options(Options * options) 1237 1149 options->ip_qos_bulk = IPTOS_THROUGHPUT; 1238 1150 if (options->request_tty == -1) 1239 1151 options->request_tty = REQUEST_TTY_AUTO; … … 1241 1153 + if (options->ask_pass_gui == -1) 1242 1154 + options->ask_pass_gui = 1; 1243 1155 +#endif 1244 /* options->local_command should not be set by default */ 1245 /* options->proxy_command should not be set by default */ 1246 /* options->user will be set in the main program if appropriate */ 1247 /* options->hostname will be set in the main program if appropriate */ 1248 /* options->host_key_alias should not be set by default */ 1249 diff --git a/readconf.h b/readconf.h 1250 --- a/readconf.h 1251 +++ b/readconf.h 1252 @@ -137,10 +137,14 @@ 1253 int use_roaming; 1254 1255 int request_tty; 1156 if (options->proxy_use_fdpass == -1) 1157 options->proxy_use_fdpass = 0; 1158 if (options->canonicalize_max_dots == -1) 1159 Only in openssh-6.5p1.patched: readconf.c.orig 1160 Only in openssh-6.5p1.patched: readconf.c.rej 1161 diff -urp openssh-6.5p1/readconf.h openssh-6.5p1.patched/readconf.h 1162 --- openssh-6.5p1/readconf.h 2013-10-16 17:48:14.000000000 -0700 1163 +++ openssh-6.5p1.patched/readconf.h 2014-02-15 16:31:29.000000000 -0800 1164 @@ -155,6 +155,10 @@ typedef struct { 1165 struct allowed_cname permitted_cnames[MAX_CANON_DOMAINS]; 1256 1166 1257 1167 char *ignored_unknown; /* Pattern list of unknown tokens to ignore */ 1258 1168 + … … 1261 1171 +#endif 1262 1172 } Options; 1263 1173 1264 #define SSHCTL_MASTER_NO 0 1265 #define SSHCTL_MASTER_YES 1 1266 #define SSHCTL_MASTER_AUTO 2 1267 diff --git a/scp.1 b/scp.1 1268 --- a/scp.1 1269 +++ b/scp.1 1270 @@ -17,11 +17,11 @@ 1271 .Nm scp 1272 .Nd secure copy (remote file copy program) 1174 #define SSH_CANONICALISE_NO 0 1175 Only in openssh-6.5p1.patched: readconf.h.orig 1176 Only in openssh-6.5p1.patched: readconf.h.rej 1177 diff -urp openssh-6.5p1/scp.1 openssh-6.5p1.patched/scp.1 1178 --- openssh-6.5p1/scp.1 2013-10-22 22:30:00.000000000 -0700 1179 +++ openssh-6.5p1.patched/scp.1 2014-02-15 16:25:56.000000000 -0800 1180 @@ -19,7 +19,7 @@ 1273 1181 .Sh SYNOPSIS 1274 1182 .Nm scp 1275 1183 .Bk -words … … 1278 1186 .Op Fl c Ar cipher 1279 1187 .Op Fl F Ar ssh_config 1280 1188 .Op Fl i Ar identity_file 1281 .Op Fl l Ar limit 1282 .Op Fl o Ar ssh_option 1283 @@ -95,10 +95,12 @@ 1284 Passes the 1285 .Fl C 1189 @@ -97,6 +97,8 @@ Passes the 1286 1190 flag to 1287 1191 .Xr ssh 1 1288 1192 to enable compression. … … 1291 1195 .It Fl c Ar cipher 1292 1196 Selects the cipher to use for encrypting the data transfer. 1293 1197 This option is directly passed to 1294 .Xr ssh 1 . 1295 .It Fl F Ar ssh_config 1296 diff --git a/scp.c b/scp.c 1297 --- a/scp.c 1298 +++ b/scp.c 1299 @@ -76,10 +76,13 @@ 1300 #include <sys/types.h> 1301 #include <sys/param.h> 1198 diff -urp openssh-6.5p1/scp.c openssh-6.5p1.patched/scp.c 1199 --- openssh-6.5p1/scp.c 2013-11-20 18:56:49.000000000 -0800 1200 +++ openssh-6.5p1.patched/scp.c 2014-02-15 16:25:56.000000000 -0800 1201 @@ -78,6 +78,9 @@ 1302 1202 #ifdef HAVE_SYS_STAT_H 1303 1203 # include <sys/stat.h> 1304 1204 #endif … … 1308 1208 #ifdef HAVE_POLL_H 1309 1209 #include <poll.h> 1310 1210 #else 1311 # ifdef HAVE_SYS_POLL_H 1312 # include <sys/poll.h> 1313 @@ -112,10 +115,15 @@ 1314 #include "pathnames.h" 1315 #include "log.h" 1211 @@ -114,6 +117,11 @@ 1316 1212 #include "misc.h" 1317 1213 #include "progressmeter.h" 1318 1214 … … 1324 1220 extern char *__progname; 1325 1221 1326 1222 #define COPY_BUFLEN 16384 1327 1328 int do_cmd(char *host, char *remuser, char *cmd, int *fdin, int *fdout); 1329 @@ -148,10 +156,16 @@ 1330 char *ssh_program = _PATH_SSH_PROGRAM; 1331 1223 @@ -150,6 +158,12 @@ char *ssh_program = _PATH_SSH_PROGRAM; 1332 1224 /* This is used to store the pid of ssh_program */ 1333 1225 pid_t do_cmd_pid = -1; 1334 1226 … … 1341 1233 static void 1342 1234 killchild(int signo) 1343 1235 { 1344 if (do_cmd_pid > 1) { 1345 kill(do_cmd_pid, signo ? signo : SIGTERM); 1346 @@ -393,11 +407,15 @@ 1347 addargs(&args, "-oForwardAgent=no"); 1348 addargs(&args, "-oPermitLocalCommand=no"); 1236 @@ -395,7 +409,11 @@ main(int argc, char **argv) 1349 1237 addargs(&args, "-oClearAllForwardings=yes"); 1350 1238 1351 1239 fflag = tflag = 0; … … 1357 1245 switch (ch) { 1358 1246 /* User-visible flags. */ 1359 1247 case '1': 1360 case '2': 1361 case '4': 1362 @@ -454,10 +472,15 @@ 1363 addargs(&args, "-q"); 1364 addargs(&remote_remote_args, "-q"); 1248 @@ -456,6 +474,11 @@ main(int argc, char **argv) 1365 1249 showprogress = 0; 1366 1250 break; 1367 1251 … … 1373 1257 /* Server options. */ 1374 1258 case 'd': 1375 1259 targetshouldbedirectory = 1; 1376 break; 1377 case 'f': /* "from" */ 1378 @@ -503,11 +526,16 @@ 1379 targetshouldbedirectory = 1; 1380 1260 @@ -505,7 +528,12 @@ main(int argc, char **argv) 1381 1261 remin = remout = -1; 1382 1262 do_cmd_pid = -1; 1383 1263 /* Command to be executed on remote system using "ssh". */ … … 1390 1270 verbose_mode ? " -v" : "", 1391 1271 iamrecursive ? " -r" : "", pflag ? " -p" : "", 1392 1272 targetshouldbedirectory ? " -d" : ""); 1393 1394 (void) signal(SIGPIPE, lostconn); 1395 @@ -749,23 +777,41 @@ 1396 off_t i, statbytes; 1397 size_t amt; 1273 @@ -751,6 +779,10 @@ source(int argc, char **argv) 1398 1274 int fd = -1, haderr, indx; 1399 1275 char *last, *name, buf[2048], encname[MAXPATHLEN]; 1400 1276 int len; … … 1405 1281 1406 1282 for (indx = 0; indx < argc; ++indx) { 1407 1283 name = argv[indx]; 1408 statbytes = 0; 1284 @@ -758,12 +790,26 @@ source(int argc, char **argv) 1409 1285 len = strlen(name); 1410 1286 while (len > 1 && name[len-1] == '/') 1411 1287 name[--len] = '\0'; … … 1432 1308 if (fstat(fd, &stb) < 0) { 1433 1309 syserr: run_err("%s: %s", name, strerror(errno)); 1434 1310 goto next; 1435 } 1436 if (stb.st_size < 0) { 1437 @@ -844,10 +890,40 @@ 1438 if (!haderr) 1439 (void) atomicio(vwrite, remout, "", 1); 1311 @@ -846,6 +892,36 @@ next: if (fd != -1) { 1440 1312 else 1441 1313 run_err("%s: %s", name, strerror(haderr)); 1442 1314 (void) response(); … … 1473 1345 } 1474 1346 } 1475 1347 1476 void 1477 rsource(char *name, struct stat *statp) 1478 @@ -935,10 +1011,14 @@ 1479 1480 (void) atomicio(vwrite, remout, "", 1); 1348 @@ -937,6 +1013,10 @@ sink(int argc, char **argv) 1481 1349 if (stat(targ, &stb) == 0 && S_ISDIR(stb.st_mode)) 1482 1350 targisdir = 1; 1483 1351 for (first = 1;; first = 0) { … … 1488 1356 cp = buf; 1489 1357 if (atomicio(read, remin, cp, 1) != 1) 1490 1358 return; 1491 if (*cp++ == '\n') 1492 SCREWUP("unexpected <newline>"); 1493 @@ -1080,14 +1160,55 @@ 1494 free(vect[0]); 1495 continue; 1359 @@ -1082,10 +1162,51 @@ sink(int argc, char **argv) 1496 1360 } 1497 1361 omode = mode; 1498 1362 mode |= S_IWUSR; … … 1544 1408 (void) atomicio(vwrite, remout, "", 1); 1545 1409 if ((bp = allocbuf(&buffer, ofd, COPY_BUFLEN)) == NULL) { 1546 1410 (void) close(ofd); 1547 continue; 1548 } 1549 @@ -1168,10 +1289,33 @@ 1550 if (close(ofd) == -1) { 1551 wrerr = YES; 1411 @@ -1170,6 +1291,29 @@ bad: run_err("%s: %s", np, strerror(er 1552 1412 wrerrno = errno; 1553 1413 } 1554 1414 (void) response(); … … 1578 1438 if (setimes && wrerr == NO) { 1579 1439 setimes = 0; 1580 1440 if (utimes(np, tv) < 0) { 1581 run_err("%s: set times: %s", 1582 np, strerror(errno)); 1583 @@ -1229,11 +1373,15 @@ 1584 1585 void 1441 @@ -1231,7 +1375,11 @@ void 1586 1442 usage(void) 1587 1443 { 1588 1444 (void) fprintf(stderr, … … 1594 1450 " [-l limit] [-o ssh_option] [-P port] [-S program]\n" 1595 1451 " [[user@]host1:]file1 ... [[user@]host2:]file2\n"); 1596 1452 exit(1); 1597 } 1598 1599 diff --git a/servconf.c b/servconf.c 1600 --- a/servconf.c 1601 +++ b/servconf.c 1602 @@ -158,11 +158,11 @@ 1603 void 1604 fill_default_server_options(ServerOptions *options) 1605 { 1606 /* Portable-specific options */ 1607 if (options->use_pam == -1) 1608 - options->use_pam = 0; 1609 + options->use_pam = 1; 1610 1611 /* Standard Options */ 1612 if (options->protocol == SSH_PROTO_UNKNOWN) 1613 options->protocol = SSH_PROTO_2; 1614 if (options->num_host_key_files == 0) { 1615 @@ -241,11 +241,11 @@ 1616 if (options->gss_authentication == -1) 1617 options->gss_authentication = 0; 1453 diff -urp openssh-6.5p1/servconf.c openssh-6.5p1.patched/servconf.c 1454 --- openssh-6.5p1/servconf.c 2013-12-06 16:24:02.000000000 -0800 1455 +++ openssh-6.5p1.patched/servconf.c 2014-02-15 16:25:56.000000000 -0800 1456 @@ -248,7 +248,7 @@ fill_default_server_options(ServerOption 1618 1457 if (options->gss_cleanup_creds == -1) 1619 1458 options->gss_cleanup_creds = 1; 1620 1459 if (options->password_authentication == -1) … … 1623 1462 if (options->kbd_interactive_authentication == -1) 1624 1463 options->kbd_interactive_authentication = 0; 1625 1464 if (options->challenge_response_authentication == -1) 1626 options->challenge_response_authentication = 1; 1627 if (options->permit_empty_passwd == -1) 1628 @@ -621,11 +621,11 @@ 1629 goto out; 1630 1465 @@ -629,7 +629,7 @@ match_cfg_line_group(const char *grps, i 1631 1466 if ((pw = getpwnam(user)) == NULL) { 1632 1467 debug("Can't match group at line %d because user %.100s does " 1633 1468 "not exist", line, user); … … 1636 1471 debug("Can't Match group because user %.100s not in any group " 1637 1472 "at line %d", user, line); 1638 1473 } else if (ga_match_pattern_list(grps) != 1) { 1639 debug("user %.100s does not match group list %.100s at line %d", 1640 user, grps, line); 1641 diff --git a/session.c b/session.c 1642 --- a/session.c 1643 +++ b/session.c 1644 @@ -2081,12 +2081,14 @@ 1645 /* for SSH1 the tty modes length is not given */ 1646 if (!compat20) 1474 Only in openssh-6.5p1.patched: servconf.c.orig 1475 diff -urp openssh-6.5p1/session.c openssh-6.5p1.patched/session.c 1476 --- openssh-6.5p1/session.c 2014-01-22 19:16:10.000000000 -0800 1477 +++ openssh-6.5p1.patched/session.c 2014-02-15 16:25:56.000000000 -0800 1478 @@ -2111,8 +2111,10 @@ session_pty_req(Session *s) 1647 1479 n_bytes = packet_remaining(); 1648 1480 tty_parse_modes(s->ttyfd, &n_bytes); 1649 1481 … … 1654 1486 1655 1487 /* Set window size from the packet. */ 1656 1488 pty_change_window_size(s->ptyfd, s->row, s->col, s->xpixel, s->ypixel); 1657 1658 packet_check_eom(); 1659 @@ -2322,13 +2324,15 @@ 1660 1661 /* Record that the user has logged out. */ 1489 @@ -2352,9 +2354,11 @@ session_pty_cleanup2(Session *s) 1662 1490 if (s->pid != 0) 1663 1491 record_logout(s->pid, s->tty, s->pw->pw_name); 1664 1492 … … 1670 1498 1671 1499 /* 1672 1500 * Close the server side of the socket pairs. We must do this after 1673 * the pty cleanup, so that another process doesn't get this pty 1674 * while we're still cleaning up. 1675 diff --git a/ssh-add.0 b/ssh-add.0 1676 --- a/ssh-add.0 1677 +++ b/ssh-add.0 1678 @@ -2,11 +2,11 @@ 1679 1680 NAME 1501 Only in openssh-6.5p1.patched: session.c.orig 1502 diff -urp openssh-6.5p1/ssh-add.0 openssh-6.5p1.patched/ssh-add.0 1503 --- openssh-6.5p1/ssh-add.0 2014-01-29 17:52:47.000000000 -0800 1504 +++ openssh-6.5p1.patched/ssh-add.0 2014-02-15 16:25:56.000000000 -0800 1505 @@ -4,7 +4,7 @@ NAME 1681 1506 ssh-add - adds private key identities to the authentication agent 1682 1507 1683 1508 SYNOPSIS … … 1686 1511 ssh-add -s pkcs11 1687 1512 ssh-add -e pkcs11 1688 1513 1689 DESCRIPTION 1690 ssh-add adds private key identities to the authentication agent, 1691 @@ -53,10 +53,17 @@ 1692 represented by the agent. 1693 1514 @@ -55,6 +55,13 @@ DESCRIPTION 1694 1515 -l Lists fingerprints of all identities currently represented by the 1695 1516 agent. 1696 1517 … … 1704 1525 -s pkcs11 1705 1526 Add keys provided by the PKCS#11 shared library pkcs11. 1706 1527 1707 -t life 1708 Set a maximum lifetime when adding identities to an agent. The 1709 diff --git a/ssh-add.1 b/ssh-add.1 1710 --- a/ssh-add.1 1711 +++ b/ssh-add.1 1712 @@ -41,11 +41,11 @@ 1713 .Sh NAME 1714 .Nm ssh-add 1528 diff -urp openssh-6.5p1/ssh-add.1 openssh-6.5p1.patched/ssh-add.1 1529 --- openssh-6.5p1/ssh-add.1 2013-12-17 22:46:28.000000000 -0800 1530 +++ openssh-6.5p1.patched/ssh-add.1 2014-02-15 16:25:56.000000000 -0800 1531 @@ -43,7 +43,7 @@ 1715 1532 .Nd adds private key identities to the authentication agent 1716 1533 .Sh SYNOPSIS 1717 1534 .Nm ssh-add … … 1720 1537 .Op Fl t Ar life 1721 1538 .Op Ar 1722 1539 .Nm ssh-add 1723 .Fl s Ar pkcs11 1724 .Nm ssh-add 1725 @@ -116,10 +116,17 @@ 1726 .It Fl L 1727 Lists public key parameters of all identities currently represented 1540 @@ -119,6 +119,13 @@ Lists public key parameters of all ident 1728 1541 by the agent. 1729 1542 .It Fl l 1730 1543 Lists fingerprints of all identities currently represented by the agent. … … 1738 1551 .It Fl s Ar pkcs11 1739 1552 Add keys provided by the PKCS#11 shared library 1740 1553 .Ar pkcs11 . 1741 .It Fl t Ar life 1742 Set a maximum lifetime when adding identities to an agent. 1743 diff --git a/ssh-add.c b/ssh-add.c 1744 --- a/ssh-add.c 1745 +++ b/ssh-add.c 1746 @@ -60,10 +60,11 @@ 1747 #include "buffer.h" 1748 #include "authfd.h" 1554 Only in openssh-6.5p1.patched: ssh-add.1.orig 1555 diff -urp openssh-6.5p1/ssh-add.c openssh-6.5p1.patched/ssh-add.c 1556 --- openssh-6.5p1/ssh-add.c 2013-12-28 22:44:07.000000000 -0800 1557 +++ openssh-6.5p1.patched/ssh-add.c 2014-02-15 16:25:56.000000000 -0800 1558 @@ -62,6 +62,7 @@ 1749 1559 #include "authfile.h" 1750 1560 #include "pathnames.h" 1751 1561 #include "misc.h" … … 1753 1563 1754 1564 /* argv0 */ 1755 1565 extern char *__progname; 1756 1757 /* Default files to add */ 1758 @@ -94,16 +95,28 @@ 1759 pass = NULL; 1760 } 1566 @@ -97,12 +98,24 @@ clear_pass(void) 1761 1567 } 1762 1568 1763 1569 static int … … 1783 1589 public = key_load_public(filename, &comment); 1784 1590 if (public == NULL) { 1785 1591 printf("Bad key file %s\n", filename); 1786 return -1; 1787 } 1788 @@ -162,11 +175,11 @@ 1789 1790 return ret; 1592 @@ -165,7 +178,7 @@ delete_all(AuthenticationConnection *ac) 1791 1593 } 1792 1594 1793 1595 static int … … 1796 1598 { 1797 1599 Key *private, *cert; 1798 1600 char *comment = NULL; 1799 char msg[1024], *certpath = NULL; 1800 int fd, perms_ok, ret = -1; 1801 @@ -199,15 +212,20 @@ 1802 } 1803 close(fd); 1601 @@ -202,11 +215,16 @@ add_file(AuthenticationConnection *ac, c 1804 1602 1805 1603 /* At first, try empty passphrase */ 1806 1604 private = key_parse_private(&keyblob, filename, "", &comment); … … 1818 1616 if (private == NULL) { 1819 1617 /* clear passphrase since it did not work */ 1820 1618 clear_pass(); 1821 snprintf(msg, sizeof msg, "Enter passphrase for %.200s: ", 1822 comment); 1823 @@ -219,12 +237,15 @@ 1824 buffer_free(&keyblob); 1825 return -1; 1619 @@ -222,8 +240,11 @@ add_file(AuthenticationConnection *ac, c 1826 1620 } 1827 1621 private = key_parse_private(&keyblob, filename, pass, 1828 1622 &comment); … … 1835 1629 clear_pass(); 1836 1630 snprintf(msg, sizeof msg, 1837 1631 "Bad passphrase, try again for %.200s: ", comment); 1838 } 1839 } 1840 @@ -374,17 +395,17 @@ 1841 free(p1); 1842 return (ret); 1632 @@ -380,13 +401,13 @@ lock_agent(AuthenticationConnection *ac, 1843 1633 } 1844 1634 1845 1635 static int … … 1856 1646 return -1; 1857 1647 } 1858 1648 return 0; 1859 } 1860 1861 @@ -402,20 +423,26 @@ 1862 fprintf(stderr, " -D Delete all identities.\n"); 1863 fprintf(stderr, " -x Lock agent.\n"); 1649 @@ -408,6 +429,11 @@ usage(void) 1864 1650 fprintf(stderr, " -X Unlock agent.\n"); 1865 1651 fprintf(stderr, " -s pkcs11 Add keys from PKCS#11 provider.\n"); 1866 1652 fprintf(stderr, " -e pkcs11 Remove keys provided by PKCS#11 provider.\n"); … … 1872 1658 } 1873 1659 1874 1660 int 1875 main(int argc, char **argv) 1876 { 1877 extern char *optarg; 1878 extern int optind; 1661 @@ -418,6 +444,7 @@ main(int argc, char **argv) 1879 1662 AuthenticationConnection *ac = NULL; 1880 1663 char *pkcs11provider = NULL; 1881 1664 int i, ch, deleting = 0, ret = 0, key_only = 0; … … 1883 1666 1884 1667 /* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */ 1885 1668 sanitise_stdfd(); 1886 1887 __progname = ssh_get_progname(argv[0]); 1888 @@ -428,11 +455,11 @@ 1889 if (ac == NULL) { 1890 fprintf(stderr, 1669 @@ -434,7 +461,7 @@ main(int argc, char **argv) 1891 1670 "Could not open a connection to your authentication agent.\n"); 1892 1671 exit(2); 1893 1672 } … … 1896 1675 switch (ch) { 1897 1676 case 'k': 1898 1677 key_only = 1; 1899 break; 1900 case 'l': 1901 @@ -467,10 +494,17 @@ 1902 fprintf(stderr, "Invalid lifetime\n"); 1903 ret = 1; 1678 @@ -473,6 +500,13 @@ main(int argc, char **argv) 1904 1679 goto done; 1905 1680 } 1906 1681 break; … … 1914 1689 default: 1915 1690 usage(); 1916 1691 ret = 1; 1917 goto done; 1918 } 1919 @@ -498,20 +532,20 @@ 1920 for (i = 0; default_files[i]; i++) { 1921 snprintf(buf, sizeof(buf), "%s/%s", pw->pw_dir, 1692 @@ -504,7 +538,7 @@ main(int argc, char **argv) 1922 1693 default_files[i]); 1923 1694 if (stat(buf, &st) < 0) 1924 1695 continue; … … 1927 1698 ret = 1; 1928 1699 else 1929 1700 count++; 1930 } 1931 if (count == 0) 1701 @@ -513,7 +547,7 @@ main(int argc, char **argv) 1932 1702 ret = 1; 1933 1703 } else { 1934 1704 for (i = 0; i < argc; i++) { … … 1937 1707 ret = 1; 1938 1708 } 1939 1709 } 1940 clear_pass(); 1941 1942 diff --git a/ssh-agent.c b/ssh-agent.c 1943 --- a/ssh-agent.c 1944 +++ b/ssh-agent.c 1945 @@ -63,20 +63,25 @@ 1946 #include <stdio.h> 1947 #include <stdlib.h> 1710 Only in openssh-6.5p1.patched: ssh-add.c.orig 1711 diff -urp openssh-6.5p1/ssh-agent.c openssh-6.5p1.patched/ssh-agent.c 1712 --- openssh-6.5p1/ssh-agent.c 2013-12-28 22:45:52.000000000 -0800 1713 +++ openssh-6.5p1.patched/ssh-agent.c 2014-02-15 16:25:56.000000000 -0800 1714 @@ -65,6 +65,9 @@ 1948 1715 #include <time.h> 1949 1716 #include <string.h> 1950 1717 #include <unistd.h> … … 1954 1721 1955 1722 #include "xmalloc.h" 1956 1723 #include "ssh.h" 1957 #include "rsa.h" 1724 @@ -72,9 +75,11 @@ 1958 1725 #include "buffer.h" 1959 1726 #include "key.h" 1960 1727 #include "authfd.h" … … 1966 1733 1967 1734 #ifdef ENABLE_PKCS11 1968 1735 #include "ssh-pkcs11.h" 1969 #endif 1970 1971 @@ -788,10 +793,65 @@ 1972 buffer_put_char(&e->output, 1973 success ? SSH_AGENT_SUCCESS : SSH_AGENT_FAILURE); 1736 @@ -682,6 +687,61 @@ process_remove_smartcard_key(SocketEntry 1974 1737 } 1975 1738 #endif /* ENABLE_PKCS11 */ 1976 1739 … … 2032 1795 /* dispatch incoming messages */ 2033 1796 2034 1797 static void 2035 process_message(SocketEntry *e) 2036 { 2037 @@ -880,10 +940,13 @@ 2038 break; 2039 case SSH_AGENTC_REMOVE_SMARTCARD_KEY: 1798 @@ -774,6 +834,9 @@ process_message(SocketEntry *e) 2040 1799 process_remove_smartcard_key(e); 2041 1800 break; 2042 1801 #endif /* ENABLE_PKCS11 */ … … 2046 1805 default: 2047 1806 /* Unknown message. Respond with failure. */ 2048 1807 error("Unknown message %d", type); 2049 buffer_clear(&e->request); 2050 buffer_put_int(&e->output, 1); 2051 @@ -1120,11 +1183,15 @@ 2052 } 2053 1808 @@ -1014,7 +1077,11 @@ usage(void) 2054 1809 int 2055 1810 main(int ac, char **av) 2056 1811 { … … 2062 1817 int sock, fd, ch, result, saved_errno; 2063 1818 u_int nalloc; 2064 1819 char *shell, *format, *pidstr, *agentsocket = NULL; 2065 fd_set *readsetp = NULL, *writesetp = NULL; 2066 struct sockaddr_un sunaddr; 2067 @@ -1154,20 +1221,29 @@ 2068 OpenSSL_add_all_algorithms(); 2069 1820 @@ -1048,7 +1115,11 @@ main(int ac, char **av) 2070 1821 __progname = ssh_get_progname(av[0]); 2071 1822 seed_rng(); 2072 1823 … … 2078 1829 switch (ch) { 2079 1830 case 'c': 2080 1831 if (s_flag) 2081 usage(); 2082 c_flag++; 2083 break; 1832 @@ -1058,6 +1129,11 @@ main(int ac, char **av) 2084 1833 case 'k': 2085 1834 k_flag++; 2086 1835 break; … … 2092 1841 case 's': 2093 1842 if (c_flag) 2094 1843 usage(); 2095 s_flag++; 2096 break; 2097 @@ -1190,11 +1266,15 @@ 2098 } 2099 } 1844 @@ -1084,7 +1160,11 @@ main(int ac, char **av) 2100 1845 ac -= optind; 2101 1846 av += optind; 2102 1847 … … 2108 1853 usage(); 2109 1854 2110 1855 if (ac == 0 && !c_flag && !s_flag) { 2111 shell = getenv("SHELL"); 2112 if (shell != NULL && (len = strlen(shell)) > 2 && 2113 @@ -1246,10 +1326,57 @@ 2114 2115 /* 1856 @@ -1140,6 +1220,53 @@ main(int ac, char **av) 2116 1857 * Create socket early so it will exist before command gets run from 2117 1858 * the parent. 2118 1859 */ … … 2166 1907 sock = socket(AF_UNIX, SOCK_STREAM, 0); 2167 1908 if (sock < 0) { 2168 1909 perror("socket"); 2169 *socket_name = '\0'; /* Don't unlink any existing file */ 2170 cleanup_exit(1); 2171 @@ -1267,10 +1394,18 @@ 2172 umask(prev_mask); 2173 if (listen(sock, SSH_LISTEN_BACKLOG) < 0) { 1910 @@ -1161,6 +1288,14 @@ main(int ac, char **av) 2174 1911 perror("listen"); 2175 1912 cleanup_exit(1); 2176 1913 } … … 2185 1922 2186 1923 /* 2187 1924 * Fork, and have the parent execute the command, if any, or present 2188 * the socket data. The child continues as the authentication agent. 2189 */ 2190 @@ -1339,19 +1474,24 @@ 2191 2192 #ifdef ENABLE_PKCS11 1925 @@ -1233,6 +1368,7 @@ skip: 2193 1926 pkcs11_init(0); 2194 1927 #endif 2195 1928 new_socket(AUTH_SOCKET, sock); … … 2197 1930 if (ac > 0) 2198 1931 parent_alive_interval = 10; 2199 1932 idtab_init(); 2200 signal(SIGPIPE, SIG_IGN); 2201 signal(SIGINT, d_flag ? cleanup_handler : SIG_IGN); 2202 signal(SIGHUP, cleanup_handler); 1933 @@ -1242,6 +1378,10 @@ skip: 2203 1934 signal(SIGTERM, cleanup_handler); 2204 1935 nalloc = 0; 2205 1936 … … 2210 1941 while (1) { 2211 1942 prepare_select(&readsetp, &writesetp, &max_fd, &nalloc, &tvp); 2212 1943 result = select(max_fd + 1, readsetp, writesetp, NULL, tvp); 2213 saved_errno = errno; 2214 if (parent_alive_interval != 0) 2215 diff --git a/ssh-keysign.8 b/ssh-keysign.8 2216 --- a/ssh-keysign.8 2217 +++ b/ssh-keysign.8 2218 @@ -69,10 +69,13 @@ 2219 They should be owned by root, readable only by root, and not 2220 accessible to others. 1944 Only in openssh-6.5p1.patched: ssh-agent.c.orig 1945 diff -urp openssh-6.5p1/ssh-keysign.8 openssh-6.5p1.patched/ssh-keysign.8 1946 --- openssh-6.5p1/ssh-keysign.8 2013-12-17 22:46:28.000000000 -0800 1947 +++ openssh-6.5p1.patched/ssh-keysign.8 2014-02-15 16:25:56.000000000 -0800 1948 @@ -72,6 +72,9 @@ accessible to others. 2221 1949 Since they are readable only by root, 2222 1950 .Nm 2223 1951 must be set-uid root if host-based authentication is used. … … 2227 1955 .Pp 2228 1956 .It Pa /etc/ssh/ssh_host_dsa_key-cert.pub 2229 1957 .It Pa /etc/ssh/ssh_host_ecdsa_key-cert.pub 2230 .It Pa /etc/ssh/ssh_host_rsa_key-cert.pub 2231 If these files exist they are assumed to contain public certificate 2232 diff --git a/sshconnect1.c b/sshconnect1.c 2233 --- a/sshconnect1.c 2234 +++ b/sshconnect1.c 2235 @@ -45,10 +45,11 @@ 2236 #include "authfile.h" 2237 #include "misc.h" 1958 Only in openssh-6.5p1.patched: ssh-keysign.8.orig 1959 diff -urp openssh-6.5p1/sshconnect1.c openssh-6.5p1.patched/sshconnect1.c 1960 --- openssh-6.5p1/sshconnect1.c 2013-10-25 16:05:47.000000000 -0700 1961 +++ openssh-6.5p1.patched/sshconnect1.c 2014-02-15 16:25:56.000000000 -0800 1962 @@ -47,6 +47,7 @@ 2238 1963 #include "canohost.h" 2239 1964 #include "hostfile.h" 2240 1965 #include "auth.h" … … 2242 1967 2243 1968 /* Session id for the current session. */ 2244 1969 u_char session_id[16]; 2245 u_int supported_authentications = 0; 2246 2247 @@ -258,10 +259,14 @@ 2248 &perm_ok); 2249 if (private == NULL && !options.batch_mode && perm_ok) { 1970 @@ -260,6 +261,10 @@ try_rsa_authentication(int idx) 2250 1971 snprintf(buf, sizeof(buf), 2251 1972 "Enter passphrase for RSA key '%.100s': ", comment); 2252 1973 for (i = 0; i < options.number_of_password_prompts; i++) { … … 2257 1978 passphrase = read_passphrase(buf, 0); 2258 1979 if (strcmp(passphrase, "") != 0) { 2259 1980 private = key_load_private_type(KEY_RSA1, 2260 authfile, passphrase, NULL, NULL); 2261 quit = 0; 2262 diff --git a/sshconnect2.c b/sshconnect2.c 2263 --- a/sshconnect2.c 2264 +++ b/sshconnect2.c 2265 @@ -70,10 +70,11 @@ 2266 #include "pathnames.h" 2267 #include "uidswap.h" 1981 diff -urp openssh-6.5p1/sshconnect2.c openssh-6.5p1.patched/sshconnect2.c 1982 --- openssh-6.5p1/sshconnect2.c 2014-01-09 15:58:53.000000000 -0800 1983 +++ openssh-6.5p1.patched/sshconnect2.c 2014-02-15 16:25:56.000000000 -0800 1984 @@ -72,6 +72,7 @@ 2268 1985 #include "hostfile.h" 2269 1986 #include "schnorr.h" 2270 1987 #include "jpake.h" … … 2272 1989 2273 1990 #ifdef GSSAPI 2274 1991 #include "ssh-gss.h" 2275 #endif 2276 2277 @@ -1331,10 +1332,14 @@ 2278 if (options.batch_mode) 2279 return NULL; 1992 @@ -1335,6 +1336,10 @@ load_identity_file(char *filename, int u 2280 1993 snprintf(prompt, sizeof prompt, 2281 1994 "Enter passphrase for key '%.100s': ", filename); 2282 1995 for (i = 0; i < options.number_of_password_prompts; i++) { … … 2287 2000 passphrase = read_passphrase(prompt, 0); 2288 2001 if (strcmp(passphrase, "") != 0) { 2289 2002 private = key_load_private_type(KEY_UNSPEC, 2290 filename, passphrase, NULL, NULL); 2291 quit = 0; 2292 diff --git a/sshd.0 b/sshd.0 2293 --- a/sshd.0 2294 +++ b/sshd.0 2295 @@ -620,12 +620,12 @@ 2296 The content of this file is not sensitive; it can be world- 2297 readable. 2003 Only in openssh-6.5p1.patched: sshconnect2.c.orig 2004 diff -urp openssh-6.5p1/sshd.0 openssh-6.5p1.patched/sshd.0 2005 --- openssh-6.5p1/sshd.0 2014-01-29 17:52:47.000000000 -0800 2006 +++ openssh-6.5p1.patched/sshd.0 2014-02-15 16:25:56.000000000 -0800 2007 @@ -625,8 +625,8 @@ FILES 2298 2008 2299 2009 SEE ALSO 2300 2010 scp(1), sftp(1), ssh(1), ssh-add(1), ssh-agent(1), ssh-keygen(1), … … 2305 2015 2306 2016 AUTHORS 2307 2017 OpenSSH is a derivative of the original and free ssh 1.2.12 release by 2308 Tatu Ylonen. Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, Theo 2309 de Raadt and Dug Song removed many bugs, re-added newer features and 2310 diff --git a/sshd.8 b/sshd.8 2311 --- a/sshd.8 2312 +++ b/sshd.8 2313 @@ -954,14 +954,11 @@ 2314 .Xr ssh-agent 1 , 2315 .Xr ssh-keygen 1 , 2018 Only in openssh-6.5p1.patched: sshd.0.orig 2019 diff -urp openssh-6.5p1/sshd.8 openssh-6.5p1.patched/sshd.8 2020 --- openssh-6.5p1/sshd.8 2013-12-17 22:46:28.000000000 -0800 2021 +++ openssh-6.5p1.patched/sshd.8 2014-02-15 16:25:56.000000000 -0800 2022 @@ -961,10 +961,7 @@ The content of this file is not sensitiv 2316 2023 .Xr ssh-keyscan 1 , 2317 2024 .Xr chroot 2 , 2318 2025 .Xr hosts_access 5 , … … 2323 2030 .Xr sftp-server 8 2324 2031 .Sh AUTHORS 2325 2032 OpenSSH is a derivative of the original and free 2326 ssh 1.2.12 release by Tatu Ylonen. 2327 Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, 2328 diff --git a/sshd.c b/sshd.c 2329 --- a/sshd.c 2330 +++ b/sshd.c 2331 @@ -2106,23 +2106,23 @@ 2332 2333 #ifdef SSH_AUDIT_EVENTS 2033 Only in openssh-6.5p1.patched: sshd.8.orig 2034 diff -urp openssh-6.5p1/sshd.c openssh-6.5p1.patched/sshd.c 2035 --- openssh-6.5p1/sshd.c 2014-01-27 20:08:13.000000000 -0800 2036 +++ openssh-6.5p1.patched/sshd.c 2014-02-15 16:25:56.000000000 -0800 2037 @@ -2124,6 +2124,12 @@ main(int ac, char **av) 2334 2038 audit_event(SSH_AUTH_SUCCESS); 2335 2039 #endif 2336 2040 … … 2343 2047 #ifdef GSSAPI 2344 2048 if (options.gss_authentication) { 2345 2049 temporarily_use_uid(authctxt->pw); 2346 ssh_gssapi_storecreds(); 2050 @@ -2131,12 +2137,6 @@ main(int ac, char **av) 2347 2051 restore_uid(); 2348 2052 } 2349 2053 #endif … … 2356 2060 2357 2061 /* 2358 2062 * In privilege separation, we fork another child and prepare 2359 * file descriptor passing. 2360 */ 2361 diff --git a/sshd_config b/sshd_config 2362 --- a/sshd_config 2363 +++ b/sshd_config 2364 @@ -32,11 +32,11 @@ 2365 # Ciphers and keying 2366 #RekeyLimit default none 2063 Only in openssh-6.5p1.patched: sshd.c.orig 2064 diff -urp openssh-6.5p1/sshd_config openssh-6.5p1.patched/sshd_config 2065 --- openssh-6.5p1/sshd_config 2014-01-12 00:20:47.000000000 -0800 2066 +++ openssh-6.5p1.patched/sshd_config 2014-02-15 16:25:56.000000000 -0800 2067 @@ -35,7 +35,7 @@ 2367 2068 2368 2069 # Logging 2369 2070 # obsoletes QuietMode and FascistLogging … … 2372 2073 #LogLevel INFO 2373 2074 2374 2075 # Authentication: 2375 2376 #LoginGraceTime 2m 2377 @@ -65,12 +65,13 @@ 2378 # RhostsRSAAuthentication and HostbasedAuthentication 2379 #IgnoreUserKnownHosts no 2076 @@ -68,8 +68,9 @@ AuthorizedKeysFile .ssh/authorized_keys 2380 2077 # Don't read the user's ~/.rhosts and ~/.shosts files 2381 2078 #IgnoreRhosts yes 2382 2079 … … 2388 2085 #PermitEmptyPasswords no 2389 2086 2390 2087 # Change to no to disable s/key passwords 2391 #ChallengeResponseAuthentication yes 2392 2393 @@ -91,11 +92,14 @@ 2394 # PAM authentication via ChallengeResponseAuthentication may bypass 2395 # the setting of "PermitRootLogin without-password". 2088 @@ -94,7 +95,10 @@ AuthorizedKeysFile .ssh/authorized_keys 2396 2089 # If you just want the PAM account and session checks to run without 2397 2090 # PAM authentication, then enable this but set PasswordAuthentication 2398 2091 # and ChallengeResponseAuthentication to 'no'. … … 2404 2097 2405 2098 #AllowAgentForwarding yes 2406 2099 #AllowTcpForwarding yes 2407 #GatewayPorts no 2408 #X11Forwarding no 2409 diff --git a/sshd_config.0 b/sshd_config.0 2410 --- a/sshd_config.0 2411 +++ b/sshd_config.0 2412 @@ -505,11 +505,11 @@ 2413 increases linearly and all connection attempts are refused if the 2414 number of unauthenticated connections reaches ``full'' (60). 2100 diff -urp openssh-6.5p1/sshd_config.0 openssh-6.5p1.patched/sshd_config.0 2101 --- openssh-6.5p1/sshd_config.0 2014-01-29 17:52:48.000000000 -0800 2102 +++ openssh-6.5p1.patched/sshd_config.0 2014-02-15 16:25:56.000000000 -0800 2103 @@ -517,7 +517,7 @@ DESCRIPTION 2415 2104 2416 2105 PasswordAuthentication 2417 2106 Specifies whether password authentication is allowed. The … … 2420 2109 2421 2110 PermitEmptyPasswords 2422 2111 When password authentication is allowed, it specifies whether the 2423 server allows login to accounts with empty password strings. The 2424 default is ``no''. 2425 @@ -707,11 +707,11 @@ 2426 Because PAM challenge-response authentication usually serves an 2427 equivalent role to password authentication, you should disable 2112 @@ -723,7 +723,7 @@ DESCRIPTION 2428 2113 either PasswordAuthentication or ChallengeResponseAuthentication. 2429 2114 2430 2115 If UsePAM is enabled, you will not be able to run sshd(8) as a … … 2433 2118 2434 2119 UsePrivilegeSeparation 2435 2120 Specifies whether sshd(8) separates privileges by creating an 2436 unprivileged child process to deal with incoming network traffic. 2437 After successful authentication, another process will be created 2438 diff --git a/sshd_config.5 b/sshd_config.5 2439 --- a/sshd_config.5 2440 +++ b/sshd_config.5 2441 @@ -854,11 +854,11 @@ 2442 .Dq full 2443 (60). 2121 Only in openssh-6.5p1.patched: sshd_config.0.orig 2122 diff -urp openssh-6.5p1/sshd_config.5 openssh-6.5p1.patched/sshd_config.5 2123 --- openssh-6.5p1/sshd_config.5 2013-12-17 22:47:03.000000000 -0800 2124 +++ openssh-6.5p1.patched/sshd_config.5 2014-02-15 16:25:56.000000000 -0800 2125 @@ -871,7 +871,7 @@ are refused if the number of unauthentic 2444 2126 .It Cm PasswordAuthentication 2445 2127 Specifies whether password authentication is allowed. 2446 2128 The default is … … 2449 2131 .It Cm PermitEmptyPasswords 2450 2132 When password authentication is allowed, it specifies whether the 2451 2133 server allows login to accounts with empty password strings. 2452 The default is 2453 .Dq no . 2454 @@ -1181,11 +1181,11 @@ 2455 .Cm UsePAM 2456 is enabled, you will not be able to run 2134 @@ -1204,7 +1204,7 @@ is enabled, you will not be able to run 2457 2135 .Xr sshd 8 2458 2136 as a non-root user. 2459 2137 The default is … … 2462 2140 .It Cm UsePrivilegeSeparation 2463 2141 Specifies whether 2464 2142 .Xr sshd 8 2465 separates privileges by creating an unprivileged child process 2466 to deal with incoming network traffic. 2143 Only in openssh-6.5p1.patched: sshd_config.5.orig 2144 Only in openssh-6.5p1.patched: sshd_config.orig