diff svr-auth.c @ 844:68facbc41273

merge again
author Matt Johnston <matt@ucc.asn.au>
date Fri, 01 Nov 2013 00:19:25 +0800
parents 4095b6d7c9fc
children 7540c0822374
line wrap: on
line diff
--- a/svr-auth.c	Wed Oct 16 22:55:03 2013 +0800
+++ b/svr-auth.c	Fri Nov 01 00:19:25 2013 +0800
@@ -88,8 +88,7 @@
 	CHECKCLEARTOWRITE();
 
 	buf_putbyte(ses.writepayload, SSH_MSG_USERAUTH_BANNER);
-	buf_putstring(ses.writepayload, buf_getptr(banner, banner->len),
-			banner->len);
+	buf_putbufstring(ses.writepayload, banner);
 	buf_putstring(ses.writepayload, "en", 2);
 
 	encrypt_packet();
@@ -344,12 +343,10 @@
 		buf_putbytes(typebuf, AUTH_METHOD_PASSWORD, AUTH_METHOD_PASSWORD_LEN);
 	}
 
-	buf_setpos(typebuf, 0);
-	buf_putstring(ses.writepayload, buf_getptr(typebuf, typebuf->len),
-			typebuf->len);
+	buf_putbufstring(ses.writepayload, typebuf);
 
-	TRACE(("auth fail: methods %d, '%s'", ses.authstate.authtypes,
-				buf_getptr(typebuf, typebuf->len)));
+	TRACE(("auth fail: methods %d, '%.*s'", ses.authstate.authtypes,
+				typebuf->len, typebuf->data))
 
 	buf_free(typebuf);