summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2002-10-04 11:10:04 +1000
committerDamien Miller <djm@mindrot.org>2002-10-04 11:10:04 +1000
commit901119beab6622a263d9d0ccf4eb494bd33d3c77 (patch)
tree585e06a2ea8da9a9155f4f2a8e7a874e2533cf79
parent7e659de6f981aaf1059720e5e198aa652834e414 (diff)
- (djm) Bug #406: s/msg_send/ssh_msg_send/ for Mac OS X 1.2
-rw-r--r--ChangeLog3
-rw-r--r--msg.c18
-rw-r--r--msg.h4
-rw-r--r--ssh-keysign.c6
-rw-r--r--sshconnect2.c4
5 files changed, 18 insertions, 17 deletions
diff --git a/ChangeLog b/ChangeLog
index 6e956f8c3..9662ebcc8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,7 @@
7 [version.h] 7 [version.h]
8 OpenSSH 3.5 8 OpenSSH 3.5
9 - (djm) Bump RPM spec version numbers 9 - (djm) Bump RPM spec version numbers
10 - (djm) Bug #406: s/msg_send/ssh_msg_send/ for Mac OS X 1.2
10 11
1120020930 1220020930
12 - (djm) Tidy contrib/, add Makefile for GNOME passphrase dialogs, 13 - (djm) Tidy contrib/, add Makefile for GNOME passphrase dialogs,
@@ -756,4 +757,4 @@
756 save auth method before monitor_reset_key_state(); bugzilla bug #284; 757 save auth method before monitor_reset_key_state(); bugzilla bug #284;
757 ok provos@ 758 ok provos@
758 759
759$Id: ChangeLog,v 1.2491 2002/10/03 01:56:58 djm Exp $ 760$Id: ChangeLog,v 1.2492 2002/10/04 01:10:04 djm Exp $
diff --git a/msg.c b/msg.c
index de19b057f..107a37691 100644
--- a/msg.c
+++ b/msg.c
@@ -31,43 +31,43 @@ RCSID("$OpenBSD: msg.c,v 1.4 2002/07/01 16:15:25 deraadt Exp $");
31#include "msg.h" 31#include "msg.h"
32 32
33void 33void
34msg_send(int fd, u_char type, Buffer *m) 34ssh_msg_send(int fd, u_char type, Buffer *m)
35{ 35{
36 u_char buf[5]; 36 u_char buf[5];
37 u_int mlen = buffer_len(m); 37 u_int mlen = buffer_len(m);
38 38
39 debug3("msg_send: type %u", (unsigned int)type & 0xff); 39 debug3("ssh_msg_send: type %u", (unsigned int)type & 0xff);
40 40
41 PUT_32BIT(buf, mlen + 1); 41 PUT_32BIT(buf, mlen + 1);
42 buf[4] = type; /* 1st byte of payload is mesg-type */ 42 buf[4] = type; /* 1st byte of payload is mesg-type */
43 if (atomicio(write, fd, buf, sizeof(buf)) != sizeof(buf)) 43 if (atomicio(write, fd, buf, sizeof(buf)) != sizeof(buf))
44 fatal("msg_send: write"); 44 fatal("ssh_msg_send: write");
45 if (atomicio(write, fd, buffer_ptr(m), mlen) != mlen) 45 if (atomicio(write, fd, buffer_ptr(m), mlen) != mlen)
46 fatal("msg_send: write"); 46 fatal("ssh_msg_send: write");
47} 47}
48 48
49int 49int
50msg_recv(int fd, Buffer *m) 50ssh_msg_recv(int fd, Buffer *m)
51{ 51{
52 u_char buf[4]; 52 u_char buf[4];
53 ssize_t res; 53 ssize_t res;
54 u_int msg_len; 54 u_int msg_len;
55 55
56 debug3("msg_recv entering"); 56 debug3("ssh_msg_recv entering");
57 57
58 res = atomicio(read, fd, buf, sizeof(buf)); 58 res = atomicio(read, fd, buf, sizeof(buf));
59 if (res != sizeof(buf)) { 59 if (res != sizeof(buf)) {
60 if (res == 0) 60 if (res == 0)
61 return -1; 61 return -1;
62 fatal("msg_recv: read: header %ld", (long)res); 62 fatal("ssh_msg_recv: read: header %ld", (long)res);
63 } 63 }
64 msg_len = GET_32BIT(buf); 64 msg_len = GET_32BIT(buf);
65 if (msg_len > 256 * 1024) 65 if (msg_len > 256 * 1024)
66 fatal("msg_recv: read: bad msg_len %u", msg_len); 66 fatal("ssh_msg_recv: read: bad msg_len %u", msg_len);
67 buffer_clear(m); 67 buffer_clear(m);
68 buffer_append_space(m, msg_len); 68 buffer_append_space(m, msg_len);
69 res = atomicio(read, fd, buffer_ptr(m), msg_len); 69 res = atomicio(read, fd, buffer_ptr(m), msg_len);
70 if (res != msg_len) 70 if (res != msg_len)
71 fatal("msg_recv: read: %ld != msg_len", (long)res); 71 fatal("ssh_msg_recv: read: %ld != msg_len", (long)res);
72 return 0; 72 return 0;
73} 73}
diff --git a/msg.h b/msg.h
index 13fa95b27..8980e254e 100644
--- a/msg.h
+++ b/msg.h
@@ -25,7 +25,7 @@
25#ifndef SSH_MSG_H 25#ifndef SSH_MSG_H
26#define SSH_MSG_H 26#define SSH_MSG_H
27 27
28void msg_send(int, u_char, Buffer *); 28void ssh_msg_send(int, u_char, Buffer *);
29int msg_recv(int, Buffer *); 29int ssh_msg_recv(int, Buffer *);
30 30
31#endif 31#endif
diff --git a/ssh-keysign.c b/ssh-keysign.c
index 06d28efa8..79aee17c0 100644
--- a/ssh-keysign.c
+++ b/ssh-keysign.c
@@ -206,8 +206,8 @@ main(int argc, char **argv)
206 fatal("no hostkey found"); 206 fatal("no hostkey found");
207 207
208 buffer_init(&b); 208 buffer_init(&b);
209 if (msg_recv(STDIN_FILENO, &b) < 0) 209 if (ssh_msg_recv(STDIN_FILENO, &b) < 0)
210 fatal("msg_recv failed"); 210 fatal("ssh_msg_recv failed");
211 if (buffer_get_char(&b) != version) 211 if (buffer_get_char(&b) != version)
212 fatal("bad version"); 212 fatal("bad version");
213 fd = buffer_get_int(&b); 213 fd = buffer_get_int(&b);
@@ -239,7 +239,7 @@ main(int argc, char **argv)
239 /* send reply */ 239 /* send reply */
240 buffer_clear(&b); 240 buffer_clear(&b);
241 buffer_put_string(&b, signature, slen); 241 buffer_put_string(&b, signature, slen);
242 msg_send(STDOUT_FILENO, version, &b); 242 ssh_msg_send(STDOUT_FILENO, version, &b);
243 243
244 return (0); 244 return (0);
245} 245}
diff --git a/sshconnect2.c b/sshconnect2.c
index 0e93496b6..703d0721f 100644
--- a/sshconnect2.c
+++ b/sshconnect2.c
@@ -947,9 +947,9 @@ ssh_keysign(Key *key, u_char **sigp, u_int *lenp,
947 buffer_init(&b); 947 buffer_init(&b);
948 buffer_put_int(&b, packet_get_connection_in()); /* send # of socket */ 948 buffer_put_int(&b, packet_get_connection_in()); /* send # of socket */
949 buffer_put_string(&b, data, datalen); 949 buffer_put_string(&b, data, datalen);
950 msg_send(to[1], version, &b); 950 ssh_msg_send(to[1], version, &b);
951 951
952 if (msg_recv(from[0], &b) < 0) { 952 if (ssh_msg_recv(from[0], &b) < 0) {
953 error("ssh_keysign: no reply"); 953 error("ssh_keysign: no reply");
954 buffer_clear(&b); 954 buffer_clear(&b);
955 return -1; 955 return -1;