summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/sshconnect.c
diff options
context:
space:
mode:
authormarkus <markus@openbsd.org>2001-02-15 23:19:59 +0000
committermarkus <markus@openbsd.org>2001-02-15 23:19:59 +0000
commit5a588a898ab777be1642ba137d3b559ceebc0fc4 (patch)
tree67308bcce4d0b566da42ce813f61498f7a0240f8 /usr.bin/ssh/sshconnect.c
parentfix change from previous commit that didn't get the ports correctly (diff)
downloadwireguard-openbsd-5a588a898ab777be1642ba137d3b559ceebc0fc4.tar.xz
wireguard-openbsd-5a588a898ab777be1642ba137d3b559ceebc0fc4.zip
genericize password padding function for SSH1 and SSH2.
add stylized echo to 2, too.
Diffstat (limited to 'usr.bin/ssh/sshconnect.c')
-rw-r--r--usr.bin/ssh/sshconnect.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/usr.bin/ssh/sshconnect.c b/usr.bin/ssh/sshconnect.c
index ff21ba3346c..b068d0bc6cb 100644
--- a/usr.bin/ssh/sshconnect.c
+++ b/usr.bin/ssh/sshconnect.c
@@ -13,7 +13,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: sshconnect.c,v 1.96 2001/02/08 22:35:30 markus Exp $");
+RCSID("$OpenBSD: sshconnect.c,v 1.97 2001/02/15 23:19:59 markus Exp $");
#include <openssl/bn.h>
@@ -762,3 +762,18 @@ ssh_login(int host_key_valid, RSA *own_host_key, const char *orighost,
ssh_userauth(local_user, server_user, host, host_key_valid, own_host_key);
}
}
+
+void
+ssh_put_password(char *password)
+{
+ int size;
+ char *padded;
+
+ size = roundup(strlen(password) + 1, 32);
+ padded = xmalloc(size);
+ memset(padded, 0, size);
+ strlcpy(padded, password, size);
+ packet_put_string(padded, size);
+ memset(padded, 0, size);
+ xfree(padded);
+}