*/
#include "includes.h"
-RCSID("$Id: packet.c,v 1.20 2000/04/30 22:24:07 damien Exp $");
+RCSID("$Id: packet.c,v 1.21 2000/05/01 11:10:33 damien Exp $");
#include "xmalloc.h"
#include "buffer.h"
void
packet_set_ssh2_format(void)
{
- debug("use_ssh2_packet_format");
+ DBG(debug("use_ssh2_packet_format"));
use_ssh2_packet_format = 1;
}
fatal("packet_send2: no KEX");
if (mac->md != NULL)
mac->enabled = 1;
- debug("cipher_set_key_iv send_context");
+ DBG(debug("cipher_set_key_iv send_context"));
cipher_set_key_iv(&send_context, enc->type,
enc->key, enc->key_len,
enc->iv, enc->iv_len);
DBG(debug("packet_send done"));
}
-void
-packet_send_and_wait()
-{
- packet_send();
- packet_write_wait();
-}
-
/*
* Waits until a packet has been received, and returns its type. Note that
* no other data is processed until this returns, so this function should not
fatal("packet_read_poll2: no KEX");
if (mac->md != NULL)
mac->enabled = 1;
- debug("cipher_set_key_iv receive_context");
+ DBG(debug("cipher_set_key_iv receive_context"));
cipher_set_key_iv(&receive_context, enc->type,
enc->key, enc->key_len,
enc->iv, enc->iv_len);
*/
#include "includes.h"
-RCSID("$Id: scp.c,v 1.20 2000/04/19 06:26:14 damien Exp $");
+RCSID("$Id: scp.c,v 1.21 2000/05/01 11:10:33 damien Exp $");
#include "ssh.h"
#include "xmalloc.h"
(void) sprintf(buf, "T%lu 0 %lu 0\n",
(unsigned long) stb.st_mtime,
(unsigned long) stb.st_atime);
- (void) write(remout, buf, strlen(buf));
+ (void) atomicio(write, remout, buf, strlen(buf));
if (response() < 0)
goto next;
}
fprintf(stderr, "Sending file modes: %s", buf);
fflush(stderr);
}
- (void) write(remout, buf, strlen(buf));
+ (void) atomicio(write, remout, buf, strlen(buf));
if (response() < 0)
goto next;
if ((bp = allocbuf(&buffer, fd, 2048)) == NULL) {
haderr = result >= 0 ? EIO : errno;
}
if (haderr)
- (void) write(remout, bp->buf, amt);
+ (void) atomicio(write, remout, bp->buf, amt);
else {
result = atomicio(write, remout, bp->buf, amt);
if (result != amt)
if (close(fd) < 0 && !haderr)
haderr = errno;
if (!haderr)
- (void) write(remout, "", 1);
+ (void) atomicio(write, remout, "", 1);
else
run_err("%s: %s", name, strerror(haderr));
(void) response();
(void) sprintf(path, "T%lu 0 %lu 0\n",
(unsigned long) statp->st_mtime,
(unsigned long) statp->st_atime);
- (void) write(remout, path, strlen(path));
+ (void) atomicio(write, remout, path, strlen(path));
if (response() < 0) {
closedir(dirp);
return;
0, last);
if (verbose_mode)
fprintf(stderr, "Entering directory: %s", path);
- (void) write(remout, path, strlen(path));
+ (void) atomicio(write, remout, path, strlen(path));
if (response() < 0) {
closedir(dirp);
return;
source(1, vect);
}
(void) closedir(dirp);
- (void) write(remout, "E\n", 2);
+ (void) atomicio(write, remout, "E\n", 2);
(void) response();
}
if (targetshouldbedirectory)
verifydir(targ);
- (void) write(remout, "", 1);
+ (void) atomicio(write, remout, "", 1);
if (stat(targ, &stb) == 0 && S_ISDIR(stb.st_mode))
targisdir = 1;
for (first = 1;; first = 0) {
if (buf[0] == '\01' || buf[0] == '\02') {
if (iamremote == 0)
- (void) write(STDERR_FILENO,
+ (void) atomicio(write, STDERR_FILENO,
buf + 1, strlen(buf + 1));
if (buf[0] == '\02')
exit(1);
continue;
}
if (buf[0] == 'E') {
- (void) write(remout, "", 1);
+ (void) atomicio(write, remout, "", 1);
return;
}
if (ch == '\n')
getnum(dummy_usec);
if (*cp++ != '\0')
SCREWUP("atime.usec not delimited");
- (void) write(remout, "", 1);
+ (void) atomicio(write, remout, "", 1);
continue;
}
if (*cp != 'C' && *cp != 'D') {
bad: run_err("%s: %s", np, strerror(errno));
continue;
}
- (void) write(remout, "", 1);
+ (void) atomicio(write, remout, "", 1);
if ((bp = allocbuf(&buffer, ofd, 4096)) == NULL) {
(void) close(ofd);
continue;
run_err("%s: %s", np, strerror(wrerrno));
break;
case NO:
- (void) write(remout, "", 1);
+ (void) atomicio(write, remout, "", 1);
break;
case DISPLAYED:
break;
} while (cp < &rbuf[sizeof(rbuf) - 1] && ch != '\n');
if (!iamremote)
- (void) write(STDERR_FILENO, rbuf, cp - rbuf);
+ (void) atomicio(write, STDERR_FILENO, rbuf, cp - rbuf);
++errs;
if (resp == 1)
return (-1);
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: scp.c,v 1.20 2000/04/19 06:26:14 damien Exp $
+ * $Id: scp.c,v 1.21 2000/05/01 11:10:33 damien Exp $
*/
char *
alarmtimer(1);
} else if (flag == 1) {
alarmtimer(0);
- write(fileno(stdout), "\n", 1);
+ atomicio(write, fileno(stdout), "\n", 1);
statbytes = 0;
}
}
.\"
.\" Created: Sat Apr 22 21:55:14 1995 ylo
.\"
-.\" $Id: sshd.8,v 1.18 2000/04/20 13:27:27 damien Exp $
+.\" $Id: sshd.8,v 1.19 2000/05/01 11:10:34 damien Exp $
.\"
.Dd September 25, 1999
.Dt SSHD 8
.Nm
(Secure Shell Daemon) is the daemon program for
.Xr ssh 1 .
-Together these programs replace rlogin and rsh programs, and
+Together these programs replace rlogin and rsh, and
provide secure encrypted communications between two untrusted hosts
over an insecure network.
The programs are intended to be as easy to
This key is normally regenerated every hour if it has been used, and
is never stored on disk.
.Pp
-Whenever a client connects the daemon, the daemon sends its host
-and server public keys to the client.
+Whenever a client connects the daemon responds with its public
+host and server keys.
The client compares the
host key against its own database to verify that it has not changed.
The client then generates a 256 bit random number.
It encrypts this
random number using both the host key and the server key, and sends
the encrypted number to the server.
-Both sides then start to use this
+Both sides then use this
random number as a session key which is used to encrypt all further
communications in the session.
The rest of the session is encrypted
-using a conventional cipher, currently Blowfish and 3DES, with 3DES
+using a conventional cipher, currently Blowfish or 3DES, with 3DES
being used by default.
The client selects the encryption algorithm
to use from those offered by the server.
.Xr rlogin 1
and
.Xr rsh 1
-into that machine).
+into the machine).
.Pp
If the client successfully authenticates itself, a dialog for
preparing the session is entered.
Do not print an error message if RSA support is missing.
.It Fl V Ar client_protocol_id
SSH2 compatibility mode.
-When this options is specified
+When this option is specified
.Nm
-assumes the client has sent the given version string
+assumes the client has sent the supplied version string
and skips the
Protocol Version Identification Exchange.
.It Fl 4