summaryrefslogtreecommitdiffhomepage
path: root/cli-authpasswd.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2004-07-27 16:30:46 +0000
committerMatt Johnston <matt@ucc.asn.au>2004-07-27 16:30:46 +0000
commita76b1ba06868c1743837a5267efcbf2e07c9d81d (patch)
tree52e8706431b92b98d2a86b51699635ea7f29486f /cli-authpasswd.c
parent052bf7df933634688ccfd89efeec7f29aa628510 (diff)
Progressing client support
--HG-- extra : convert_revision : 48946be1cef774d1c33b0f78689962b18720c627
Diffstat (limited to 'cli-authpasswd.c')
-rw-r--r--cli-authpasswd.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/cli-authpasswd.c b/cli-authpasswd.c
new file mode 100644
index 0000000..6185334
--- /dev/null
+++ b/cli-authpasswd.c
@@ -0,0 +1,36 @@
+#include "includes.h"
+#include "buffer.h"
+#include "dbutil.h"
+#include "session.h"
+#include "ssh.h"
+
+int cli_auth_password() {
+
+ char* password = NULL;
+ TRACE(("enter cli_auth_password"));
+
+ CHECKCLEARTOWRITE();
+ password = getpass("Password: ");
+
+ buf_putbyte(ses.writepayload, SSH_MSG_USERAUTH_REQUEST);
+
+ buf_putstring(ses.writepayload, ses.authstate.username,
+ strlen(ses.authstate.username));
+
+ buf_putstring(ses.writepayload, SSH_SERVICE_CONNECTION,
+ SSH_SERVICE_CONNECTION_LEN);
+
+ buf_putstring(ses.writepayload, AUTH_METHOD_PASSWORD,
+ AUTH_METHOD_PASSWORD_LEN);
+
+ buf_putbyte(ses.writepayload, 0); /* FALSE - so says the spec */
+
+ buf_putstring(ses.writepayload, password, strlen(password));
+
+ encrypt_packet();
+ m_burn(password, strlen(password));
+
+ TRACE(("leave cli_auth_password"));
+ return 1; /* Password auth can always be tried */
+
+}