comparison svr-service.c @ 1111:848dac90c923

Turn send_msg_service_accept()'s name argument into char *
author Gaël PORTAY <gael.portay@gmail.com>
date Sat, 02 May 2015 23:24:23 +0200
parents a98a2138364a
children aaf576b27a10
comparison
equal deleted inserted replaced
1110:83025b7063ec 1111:848dac90c923
28 #include "session.h" 28 #include "session.h"
29 #include "packet.h" 29 #include "packet.h"
30 #include "ssh.h" 30 #include "ssh.h"
31 #include "auth.h" 31 #include "auth.h"
32 32
33 static void send_msg_service_accept(unsigned char *name, int len); 33 static void send_msg_service_accept(char *name, int len);
34 34
35 /* processes a SSH_MSG_SERVICE_REQUEST, returning 0 if finished, 35 /* processes a SSH_MSG_SERVICE_REQUEST, returning 0 if finished,
36 * 1 if not */ 36 * 1 if not */
37 void recv_msg_service_request() { 37 void recv_msg_service_request() {
38 38
39 unsigned char * name; 39 char * name;
40 unsigned int len; 40 unsigned int len;
41 41
42 TRACE(("enter recv_msg_service_request")) 42 TRACE(("enter recv_msg_service_request"))
43 43
44 name = buf_getstring(ses.payload, &len); 44 name = (char *) buf_getstring(ses.payload, &len);
45 45
46 /* ssh-userauth */ 46 /* ssh-userauth */
47 if (len == SSH_SERVICE_USERAUTH_LEN && 47 if (len == SSH_SERVICE_USERAUTH_LEN &&
48 strncmp(SSH_SERVICE_USERAUTH, name, len) == 0) { 48 strncmp(SSH_SERVICE_USERAUTH, name, len) == 0) {
49 49
71 dropbear_exit("Unrecognised SSH_MSG_SERVICE_REQUEST"); 71 dropbear_exit("Unrecognised SSH_MSG_SERVICE_REQUEST");
72 72
73 73
74 } 74 }
75 75
76 static void send_msg_service_accept(unsigned char *name, int len) { 76 static void send_msg_service_accept(char *name, int len) {
77 77
78 TRACE(("accepting service %s", name)) 78 TRACE(("accepting service %s", name))
79 79
80 CHECKCLEARTOWRITE(); 80 CHECKCLEARTOWRITE();
81 81
82 buf_putbyte(ses.writepayload, SSH_MSG_SERVICE_ACCEPT); 82 buf_putbyte(ses.writepayload, SSH_MSG_SERVICE_ACCEPT);
83 buf_putstring(ses.writepayload, name, len); 83 buf_putstring(ses.writepayload, (const unsigned char *) name, len);
84 84
85 encrypt_packet(); 85 encrypt_packet();
86 86
87 } 87 }