comparison svr-auth.c @ 761:ac2158e3e403 ecc

ecc kind of works, needs fixing/testing
author Matt Johnston <matt@ucc.asn.au>
date Sun, 07 Apr 2013 01:36:42 +0800
parents c58a15983808
children a78a38e402d1
comparison
equal deleted inserted replaced
760:f336d232fc63 761:ac2158e3e403
91 } 91 }
92 92
93 CHECKCLEARTOWRITE(); 93 CHECKCLEARTOWRITE();
94 94
95 buf_putbyte(ses.writepayload, SSH_MSG_USERAUTH_BANNER); 95 buf_putbyte(ses.writepayload, SSH_MSG_USERAUTH_BANNER);
96 buf_putstring(ses.writepayload, buf_getptr(svr_opts.banner, 96 buf_putbufstring(ses.writepayload, svr_opts.banner);
97 svr_opts.banner->len), svr_opts.banner->len);
98 buf_putstring(ses.writepayload, "en", 2); 97 buf_putstring(ses.writepayload, "en", 2);
99 98
100 encrypt_packet(); 99 encrypt_packet();
101 buf_free(svr_opts.banner); 100 buf_free(svr_opts.banner);
102 svr_opts.banner = NULL; 101 svr_opts.banner = NULL;
328 327
329 if (ses.authstate.authtypes & AUTH_TYPE_PASSWORD) { 328 if (ses.authstate.authtypes & AUTH_TYPE_PASSWORD) {
330 buf_putbytes(typebuf, AUTH_METHOD_PASSWORD, AUTH_METHOD_PASSWORD_LEN); 329 buf_putbytes(typebuf, AUTH_METHOD_PASSWORD, AUTH_METHOD_PASSWORD_LEN);
331 } 330 }
332 331
333 buf_setpos(typebuf, 0); 332 buf_putbufstring(ses.writepayload, typebuf);
334 buf_putstring(ses.writepayload, buf_getptr(typebuf, typebuf->len), 333
335 typebuf->len); 334 TRACE(("auth fail: methods %d, '%.*s'", ses.authstate.authtypes,
336 335 typebuf->len,
337 TRACE(("auth fail: methods %d, '%s'", ses.authstate.authtypes,
338 buf_getptr(typebuf, typebuf->len))); 336 buf_getptr(typebuf, typebuf->len)));
339 337
340 buf_free(typebuf); 338 buf_free(typebuf);
341 339
342 buf_putbyte(ses.writepayload, partial ? 1 : 0); 340 buf_putbyte(ses.writepayload, partial ? 1 : 0);