Mercurial > dropbear
annotate cli-authpasswd.c @ 72:9597c2e3b9d4
Some doc changes
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Fri, 13 Aug 2004 10:58:51 +0000 |
parents | eee77ac31ccc |
children | e3adf4cf5465 |
rev | line source |
---|---|
33 | 1 #include "includes.h" |
2 #include "buffer.h" | |
3 #include "dbutil.h" | |
4 #include "session.h" | |
5 #include "ssh.h" | |
35
0ad5fb979f42
set the isserver flag (oops)
Matt Johnston <matt@ucc.asn.au>
parents:
33
diff
changeset
|
6 #include "runopts.h" |
33 | 7 |
68
eee77ac31ccc
cleaning up the pubkey defines
Matt Johnston <matt@ucc.asn.au>
parents:
35
diff
changeset
|
8 #ifdef ENABLE_CLI_PASSWORD_AUTH |
33 | 9 int cli_auth_password() { |
10 | |
11 char* password = NULL; | |
12 TRACE(("enter cli_auth_password")); | |
13 | |
14 CHECKCLEARTOWRITE(); | |
15 password = getpass("Password: "); | |
16 | |
17 buf_putbyte(ses.writepayload, SSH_MSG_USERAUTH_REQUEST); | |
18 | |
35
0ad5fb979f42
set the isserver flag (oops)
Matt Johnston <matt@ucc.asn.au>
parents:
33
diff
changeset
|
19 buf_putstring(ses.writepayload, cli_opts.username, |
0ad5fb979f42
set the isserver flag (oops)
Matt Johnston <matt@ucc.asn.au>
parents:
33
diff
changeset
|
20 strlen(cli_opts.username)); |
33 | 21 |
22 buf_putstring(ses.writepayload, SSH_SERVICE_CONNECTION, | |
23 SSH_SERVICE_CONNECTION_LEN); | |
24 | |
25 buf_putstring(ses.writepayload, AUTH_METHOD_PASSWORD, | |
26 AUTH_METHOD_PASSWORD_LEN); | |
27 | |
28 buf_putbyte(ses.writepayload, 0); /* FALSE - so says the spec */ | |
29 | |
30 buf_putstring(ses.writepayload, password, strlen(password)); | |
31 | |
32 encrypt_packet(); | |
33 m_burn(password, strlen(password)); | |
34 | |
35 TRACE(("leave cli_auth_password")); | |
36 return 1; /* Password auth can always be tried */ | |
37 | |
38 } | |
68
eee77ac31ccc
cleaning up the pubkey defines
Matt Johnston <matt@ucc.asn.au>
parents:
35
diff
changeset
|
39 #endif |