summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2001-06-09 01:42:01 +0000
committerBen Lindstrom <mouring@eviladmin.org>2001-06-09 01:42:01 +0000
commit664408d2a794806722aa3f321b92c7bdd667c42e (patch)
tree0dbce8250bc4d6325ed2f2b6950221a24d62dc2a
parent9d0c06667eb4ca616ffa690e88b9dd7c438e3103 (diff)
- markus@cvs.openbsd.org 2001/06/07 20:23:05
[authfd.c authfile.c channels.c kexdh.c kexgex.c packet.c ssh.c sshconnect.c sshconnect1.c] use xxx_put_cstring()
-rw-r--r--ChangeLog7
-rw-r--r--authfd.c4
-rw-r--r--authfile.c4
-rw-r--r--channels.c4
-rw-r--r--kexdh.c6
-rw-r--r--kexgex.c6
-rw-r--r--packet.c6
-rw-r--r--ssh.c4
-rw-r--r--sshconnect.c4
-rw-r--r--sshconnect1.c12
10 files changed, 30 insertions, 27 deletions
diff --git a/ChangeLog b/ChangeLog
index a00010ee0..b343a6d91 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -66,7 +66,10 @@
66 [auth2.c] 66 [auth2.c]
67 style is used for bsdauth. 67 style is used for bsdauth.
68 disconnect on user/service change (ietf-drafts) 68 disconnect on user/service change (ietf-drafts)
69 69 - markus@cvs.openbsd.org 2001/06/07 20:23:05
70 [authfd.c authfile.c channels.c kexdh.c kexgex.c packet.c ssh.c
71 sshconnect.c sshconnect1.c]
72 use xxx_put_cstring()
7020010606 7320010606
71 - OpenBSD CVS Sync 74 - OpenBSD CVS Sync
72 - markus@cvs.openbsd.org 2001/05/17 21:34:15 75 - markus@cvs.openbsd.org 2001/05/17 21:34:15
@@ -5577,4 +5580,4 @@
5577 - Wrote replacements for strlcpy and mkdtemp 5580 - Wrote replacements for strlcpy and mkdtemp
5578 - Released 1.0pre1 5581 - Released 1.0pre1
5579 5582
5580$Id: ChangeLog,v 1.1266 2001/06/09 01:40:00 mouring Exp $ 5583$Id: ChangeLog,v 1.1267 2001/06/09 01:42:01 mouring Exp $
diff --git a/authfd.c b/authfd.c
index 3e1ef8182..9f47b0ae8 100644
--- a/authfd.c
+++ b/authfd.c
@@ -35,7 +35,7 @@
35 */ 35 */
36 36
37#include "includes.h" 37#include "includes.h"
38RCSID("$OpenBSD: authfd.c,v 1.39 2001/04/05 10:42:48 markus Exp $"); 38RCSID("$OpenBSD: authfd.c,v 1.40 2001/06/07 20:23:03 markus Exp $");
39 39
40#include <openssl/evp.h> 40#include <openssl/evp.h>
41 41
@@ -432,7 +432,7 @@ ssh_encode_identity_rsa1(Buffer *b, RSA *key, const char *comment)
432 buffer_put_bignum(b, key->iqmp); /* ssh key->u */ 432 buffer_put_bignum(b, key->iqmp); /* ssh key->u */
433 buffer_put_bignum(b, key->q); /* ssh key->p, SSL key->q */ 433 buffer_put_bignum(b, key->q); /* ssh key->p, SSL key->q */
434 buffer_put_bignum(b, key->p); /* ssh key->q, SSL key->p */ 434 buffer_put_bignum(b, key->p); /* ssh key->q, SSL key->p */
435 buffer_put_string(b, comment, strlen(comment)); 435 buffer_put_cstring(b, comment);
436} 436}
437 437
438void 438void
diff --git a/authfile.c b/authfile.c
index db6aed83e..c4da9aad3 100644
--- a/authfile.c
+++ b/authfile.c
@@ -36,7 +36,7 @@
36 */ 36 */
37 37
38#include "includes.h" 38#include "includes.h"
39RCSID("$OpenBSD: authfile.c,v 1.35 2001/05/29 12:31:27 markus Exp $"); 39RCSID("$OpenBSD: authfile.c,v 1.36 2001/06/07 20:23:03 markus Exp $");
40 40
41#include <openssl/err.h> 41#include <openssl/err.h>
42#include <openssl/evp.h> 42#include <openssl/evp.h>
@@ -125,7 +125,7 @@ key_save_private_rsa1(Key *key, const char *filename, const char *passphrase,
125 buffer_put_int(&encrypted, BN_num_bits(key->rsa->n)); 125 buffer_put_int(&encrypted, BN_num_bits(key->rsa->n));
126 buffer_put_bignum(&encrypted, key->rsa->n); 126 buffer_put_bignum(&encrypted, key->rsa->n);
127 buffer_put_bignum(&encrypted, key->rsa->e); 127 buffer_put_bignum(&encrypted, key->rsa->e);
128 buffer_put_string(&encrypted, comment, strlen(comment)); 128 buffer_put_cstring(&encrypted, comment);
129 129
130 /* Allocate space for the private part of the key in the buffer. */ 130 /* Allocate space for the private part of the key in the buffer. */
131 buffer_append_space(&encrypted, &cp, buffer_len(&buffer)); 131 buffer_append_space(&encrypted, &cp, buffer_len(&buffer));
diff --git a/channels.c b/channels.c
index 2664726a2..283a70323 100644
--- a/channels.c
+++ b/channels.c
@@ -40,7 +40,7 @@
40 */ 40 */
41 41
42#include "includes.h" 42#include "includes.h"
43RCSID("$OpenBSD: channels.c,v 1.124 2001/06/05 10:24:32 markus Exp $"); 43RCSID("$OpenBSD: channels.c,v 1.125 2001/06/07 20:23:04 markus Exp $");
44 44
45#include "ssh.h" 45#include "ssh.h"
46#include "ssh1.h" 46#include "ssh1.h"
@@ -1019,7 +1019,7 @@ channel_post_x11_listener(Channel *c, fd_set * readset, fd_set * writeset)
1019 packet_put_int(nc->self); 1019 packet_put_int(nc->self);
1020 if (packet_get_protocol_flags() & 1020 if (packet_get_protocol_flags() &
1021 SSH_PROTOFLAG_HOST_IN_FWD_OPEN) 1021 SSH_PROTOFLAG_HOST_IN_FWD_OPEN)
1022 packet_put_string(buf, strlen(buf)); 1022 packet_put_cstring(buf);
1023 packet_send(); 1023 packet_send();
1024 } 1024 }
1025 xfree(remote_ipaddr); 1025 xfree(remote_ipaddr);
diff --git a/kexdh.c b/kexdh.c
index 7b6a22040..40eccf6c2 100644
--- a/kexdh.c
+++ b/kexdh.c
@@ -23,7 +23,7 @@
23 */ 23 */
24 24
25#include "includes.h" 25#include "includes.h"
26RCSID("$OpenBSD: kexdh.c,v 1.3 2001/04/04 09:48:34 markus Exp $"); 26RCSID("$OpenBSD: kexdh.c,v 1.4 2001/06/07 20:23:04 markus Exp $");
27 27
28#include <openssl/crypto.h> 28#include <openssl/crypto.h>
29#include <openssl/bn.h> 29#include <openssl/bn.h>
@@ -55,8 +55,8 @@ kex_dh_hash(
55 EVP_MD_CTX md; 55 EVP_MD_CTX md;
56 56
57 buffer_init(&b); 57 buffer_init(&b);
58 buffer_put_string(&b, client_version_string, strlen(client_version_string)); 58 buffer_put_cstring(&b, client_version_string);
59 buffer_put_string(&b, server_version_string, strlen(server_version_string)); 59 buffer_put_cstring(&b, server_version_string);
60 60
61 /* kexinit messages: fake header: len+SSH2_MSG_KEXINIT */ 61 /* kexinit messages: fake header: len+SSH2_MSG_KEXINIT */
62 buffer_put_int(&b, ckexinitlen+1); 62 buffer_put_int(&b, ckexinitlen+1);
diff --git a/kexgex.c b/kexgex.c
index 44f2f5c95..f21f310ee 100644
--- a/kexgex.c
+++ b/kexgex.c
@@ -24,7 +24,7 @@
24 */ 24 */
25 25
26#include "includes.h" 26#include "includes.h"
27RCSID("$OpenBSD: kexgex.c,v 1.5 2001/04/05 10:42:50 markus Exp $"); 27RCSID("$OpenBSD: kexgex.c,v 1.6 2001/06/07 20:23:04 markus Exp $");
28 28
29#include <openssl/bn.h> 29#include <openssl/bn.h>
30 30
@@ -57,8 +57,8 @@ kexgex_hash(
57 EVP_MD_CTX md; 57 EVP_MD_CTX md;
58 58
59 buffer_init(&b); 59 buffer_init(&b);
60 buffer_put_string(&b, client_version_string, strlen(client_version_string)); 60 buffer_put_cstring(&b, client_version_string);
61 buffer_put_string(&b, server_version_string, strlen(server_version_string)); 61 buffer_put_cstring(&b, server_version_string);
62 62
63 /* kexinit messages: fake header: len+SSH2_MSG_KEXINIT */ 63 /* kexinit messages: fake header: len+SSH2_MSG_KEXINIT */
64 buffer_put_int(&b, ckexinitlen+1); 64 buffer_put_int(&b, ckexinitlen+1);
diff --git a/packet.c b/packet.c
index 402259a99..d3a43609b 100644
--- a/packet.c
+++ b/packet.c
@@ -37,7 +37,7 @@
37 */ 37 */
38 38
39#include "includes.h" 39#include "includes.h"
40RCSID("$OpenBSD: packet.c,v 1.64 2001/05/31 10:30:16 markus Exp $"); 40RCSID("$OpenBSD: packet.c,v 1.65 2001/06/07 20:23:04 markus Exp $");
41 41
42#include "xmalloc.h" 42#include "xmalloc.h"
43#include "buffer.h" 43#include "buffer.h"
@@ -333,7 +333,7 @@ packet_put_string(const char *buf, u_int len)
333void 333void
334packet_put_cstring(const char *str) 334packet_put_cstring(const char *str)
335{ 335{
336 buffer_put_string(&outgoing_packet, str, strlen(str)); 336 buffer_put_cstring(&outgoing_packet, str);
337} 337}
338void 338void
339packet_put_raw(const char *buf, u_int len) 339packet_put_raw(const char *buf, u_int len)
@@ -1079,7 +1079,7 @@ packet_disconnect(const char *fmt,...)
1079 packet_put_cstring(""); 1079 packet_put_cstring("");
1080 } else { 1080 } else {
1081 packet_start(SSH_MSG_DISCONNECT); 1081 packet_start(SSH_MSG_DISCONNECT);
1082 packet_put_string(buf, strlen(buf)); 1082 packet_put_cstring(buf);
1083 } 1083 }
1084 packet_send(); 1084 packet_send();
1085 packet_write_wait(); 1085 packet_write_wait();
diff --git a/ssh.c b/ssh.c
index 07947dc6a..4859c5bed 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.123 2001/05/31 10:30:17 markus Exp $"); 42RCSID("$OpenBSD: ssh.c,v 1.124 2001/06/07 20:23:05 markus Exp $");
43 43
44#include <openssl/evp.h> 44#include <openssl/evp.h>
45#include <openssl/err.h> 45#include <openssl/err.h>
@@ -868,7 +868,7 @@ ssh_session(void)
868 cp = getenv("TERM"); 868 cp = getenv("TERM");
869 if (!cp) 869 if (!cp)
870 cp = ""; 870 cp = "";
871 packet_put_string(cp, strlen(cp)); 871 packet_put_cstring(cp);
872 872
873 /* Store window size in the packet. */ 873 /* Store window size in the packet. */
874 if (ioctl(fileno(stdin), TIOCGWINSZ, &ws) < 0) 874 if (ioctl(fileno(stdin), TIOCGWINSZ, &ws) < 0)
diff --git a/sshconnect.c b/sshconnect.c
index fc7920ee8..bafdec95a 100644
--- a/sshconnect.c
+++ b/sshconnect.c
@@ -13,7 +13,7 @@
13 */ 13 */
14 14
15#include "includes.h" 15#include "includes.h"
16RCSID("$OpenBSD: sshconnect.c,v 1.106 2001/05/28 23:58:35 markus Exp $"); 16RCSID("$OpenBSD: sshconnect.c,v 1.107 2001/06/07 20:23:05 markus Exp $");
17 17
18#include <openssl/bn.h> 18#include <openssl/bn.h>
19 19
@@ -799,7 +799,7 @@ ssh_put_password(char *password)
799 char *padded; 799 char *padded;
800 800
801 if (datafellows & SSH_BUG_PASSWORDPAD) { 801 if (datafellows & SSH_BUG_PASSWORDPAD) {
802 packet_put_string(password, strlen(password)); 802 packet_put_cstring(password);
803 return; 803 return;
804 } 804 }
805 size = roundup(strlen(password) + 1, 32); 805 size = roundup(strlen(password) + 1, 32);
diff --git a/sshconnect1.c b/sshconnect1.c
index c0fe86293..c20613571 100644
--- a/sshconnect1.c
+++ b/sshconnect1.c
@@ -13,7 +13,7 @@
13 */ 13 */
14 14
15#include "includes.h" 15#include "includes.h"
16RCSID("$OpenBSD: sshconnect1.c,v 1.32 2001/05/18 14:13:29 markus Exp $"); 16RCSID("$OpenBSD: sshconnect1.c,v 1.33 2001/06/07 20:23:05 markus Exp $");
17 17
18#include <openssl/bn.h> 18#include <openssl/bn.h>
19#include <openssl/evp.h> 19#include <openssl/evp.h>
@@ -332,7 +332,7 @@ try_rhosts_rsa_authentication(const char *local_user, Key * host_key)
332 332
333 /* Tell the server that we are willing to authenticate using this key. */ 333 /* Tell the server that we are willing to authenticate using this key. */
334 packet_start(SSH_CMSG_AUTH_RHOSTS_RSA); 334 packet_start(SSH_CMSG_AUTH_RHOSTS_RSA);
335 packet_put_string(local_user, strlen(local_user)); 335 packet_put_cstring(local_user);
336 packet_put_int(BN_num_bits(host_key->rsa->n)); 336 packet_put_int(BN_num_bits(host_key->rsa->n));
337 packet_put_bignum(host_key->rsa->e); 337 packet_put_bignum(host_key->rsa->e);
338 packet_put_bignum(host_key->rsa->n); 338 packet_put_bignum(host_key->rsa->n);
@@ -527,7 +527,7 @@ send_kerberos_tgt(void)
527 xfree(creds); 527 xfree(creds);
528 528
529 packet_start(SSH_CMSG_HAVE_KERBEROS_TGT); 529 packet_start(SSH_CMSG_HAVE_KERBEROS_TGT);
530 packet_put_string(buffer, strlen(buffer)); 530 packet_put_cstring(buffer);
531 packet_send(); 531 packet_send();
532 packet_write_wait(); 532 packet_write_wait();
533 533
@@ -594,7 +594,7 @@ send_afs_tokens(void)
594 if (creds_to_radix(&creds, (u_char *) buffer, sizeof buffer) <= 0) 594 if (creds_to_radix(&creds, (u_char *) buffer, sizeof buffer) <= 0)
595 break; 595 break;
596 packet_start(SSH_CMSG_HAVE_AFS_TOKEN); 596 packet_start(SSH_CMSG_HAVE_AFS_TOKEN);
597 packet_put_string(buffer, strlen(buffer)); 597 packet_put_cstring(buffer);
598 packet_send(); 598 packet_send();
599 packet_write_wait(); 599 packet_write_wait();
600 600
@@ -922,7 +922,7 @@ ssh_userauth1(const char *local_user, const char *server_user, char *host,
922 922
923 /* Send the name of the user to log in as on the server. */ 923 /* Send the name of the user to log in as on the server. */
924 packet_start(SSH_CMSG_USER); 924 packet_start(SSH_CMSG_USER);
925 packet_put_string(server_user, strlen(server_user)); 925 packet_put_cstring(server_user);
926 packet_send(); 926 packet_send();
927 packet_write_wait(); 927 packet_write_wait();
928 928
@@ -980,7 +980,7 @@ ssh_userauth1(const char *local_user, const char *server_user, char *host,
980 options.rhosts_authentication) { 980 options.rhosts_authentication) {
981 debug("Trying rhosts authentication."); 981 debug("Trying rhosts authentication.");
982 packet_start(SSH_CMSG_AUTH_RHOSTS); 982 packet_start(SSH_CMSG_AUTH_RHOSTS);
983 packet_put_string(local_user, strlen(local_user)); 983 packet_put_cstring(local_user);
984 packet_send(); 984 packet_send();
985 packet_write_wait(); 985 packet_write_wait();
986 986