summaryrefslogtreecommitdiffhomepage
path: root/svr-auth.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2015-06-04 22:25:28 +0800
committerMatt Johnston <matt@ucc.asn.au>2015-06-04 22:25:28 +0800
commite7ac4c1ab3eee827d781ececf6c7342c432b91d3 (patch)
tree0a2ae08f9975d50dd7d4a490f4e79ae9db764fc8 /svr-auth.c
parentecd850521816dc2a78792fc53dd9c6c80d5d1b91 (diff)
parent9fdab3ced8374b991bfadce0056cf5bdf7cfb3d6 (diff)
Merge pull request #13 from gazoo74/fix-warnings
Fix warnings
Diffstat (limited to 'svr-auth.c')
-rw-r--r--svr-auth.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/svr-auth.c b/svr-auth.c
index 89760ef..44f8f13 100644
--- a/svr-auth.c
+++ b/svr-auth.c
@@ -36,7 +36,7 @@
#include "dbrandom.h"
static void authclear();
-static int checkusername(unsigned char *username, unsigned int userlen);
+static int checkusername(char *username, unsigned int userlen);
/* initialise the first time for a session, resetting all parameters */
void svr_authinitialise() {
@@ -89,7 +89,7 @@ void send_msg_userauth_banner(buffer *banner) {
buf_putbyte(ses.writepayload, SSH_MSG_USERAUTH_BANNER);
buf_putbufstring(ses.writepayload, banner);
- buf_putstring(ses.writepayload, "en", 2);
+ buf_putstring(ses.writepayload, (const unsigned char *)"en", 2);
encrypt_packet();
@@ -100,7 +100,7 @@ void send_msg_userauth_banner(buffer *banner) {
* checking, and handle success or failure */
void recv_msg_userauth_request() {
- unsigned char *username = NULL, *servicename = NULL, *methodname = NULL;
+ char *username = NULL, *servicename = NULL, *methodname = NULL;
unsigned int userlen, servicelen, methodlen;
int valid_user = 0;
@@ -119,9 +119,9 @@ void recv_msg_userauth_request() {
svr_opts.banner = NULL;
}
- username = buf_getstring(ses.payload, &userlen);
- servicename = buf_getstring(ses.payload, &servicelen);
- methodname = buf_getstring(ses.payload, &methodlen);
+ username = (char *)buf_getstring(ses.payload, &userlen);
+ servicename = (char *)buf_getstring(ses.payload, &servicelen);
+ methodname = (char *)buf_getstring(ses.payload, &methodlen);
/* only handle 'ssh-connection' currently */
if (servicelen != SSH_SERVICE_CONNECTION_LEN
@@ -227,7 +227,7 @@ out:
/* Check that the username exists and isn't disallowed (root), and has a valid shell.
* returns DROPBEAR_SUCCESS on valid username, DROPBEAR_FAILURE on failure */
-static int checkusername(unsigned char *username, unsigned int userlen) {
+static int checkusername(char *username, unsigned int userlen) {
char* listshell = NULL;
char* usershell = NULL;
@@ -333,14 +333,14 @@ void send_msg_userauth_failure(int partial, int incrfail) {
typebuf = buf_new(30); /* long enough for PUBKEY and PASSWORD */
if (ses.authstate.authtypes & AUTH_TYPE_PUBKEY) {
- buf_putbytes(typebuf, AUTH_METHOD_PUBKEY, AUTH_METHOD_PUBKEY_LEN);
+ buf_putbytes(typebuf, (const unsigned char *)AUTH_METHOD_PUBKEY, AUTH_METHOD_PUBKEY_LEN);
if (ses.authstate.authtypes & AUTH_TYPE_PASSWORD) {
buf_putbyte(typebuf, ',');
}
}
if (ses.authstate.authtypes & AUTH_TYPE_PASSWORD) {
- buf_putbytes(typebuf, AUTH_METHOD_PASSWORD, AUTH_METHOD_PASSWORD_LEN);
+ buf_putbytes(typebuf, (const unsigned char *)AUTH_METHOD_PASSWORD, AUTH_METHOD_PASSWORD_LEN);
}
buf_putbufstring(ses.writepayload, typebuf);