Skip to content
Snippets Groups Projects
Commit 89e64c63 authored by Francois Perrad's avatar Francois Perrad
Browse files

Pointer parameter could be declared as pointing to const

parent 468656b4
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -81,7 +81,7 @@ static void authclear() {
 
/* Send a banner message if specified to the client. The client might
* ignore this, but possibly serves as a legal "no trespassing" sign */
void send_msg_userauth_banner(buffer *banner) {
void send_msg_userauth_banner(const buffer *banner) {
 
TRACE(("enter send_msg_userauth_banner"))
 
Loading
Loading
Loading
Loading
@@ -70,11 +70,11 @@
#define MIN_AUTHKEYS_LINE 10 /* "ssh-rsa AB" - short but doesn't matter */
#define MAX_AUTHKEYS_LINE 4200 /* max length of a line in authkeys */
 
static int checkpubkey(char* algo, unsigned int algolen,
unsigned char* keyblob, unsigned int keybloblen);
static int checkpubkey(const char* algo, unsigned int algolen,
const unsigned char* keyblob, unsigned int keybloblen);
static int checkpubkeyperms(void);
static void send_msg_userauth_pk_ok(char* algo, unsigned int algolen,
unsigned char* keyblob, unsigned int keybloblen);
static void send_msg_userauth_pk_ok(const char* algo, unsigned int algolen,
const unsigned char* keyblob, unsigned int keybloblen);
static int checkfileperm(char * filename);
 
/* process a pubkey auth request, sending success or failure message as
Loading
Loading
@@ -173,8 +173,8 @@ out:
/* Reply that the key is valid for auth, this is sent when the user sends
* a straight copy of their pubkey to test, to avoid having to perform
* expensive signing operations with a worthless key */
static void send_msg_userauth_pk_ok(char* algo, unsigned int algolen,
unsigned char* keyblob, unsigned int keybloblen) {
static void send_msg_userauth_pk_ok(const char* algo, unsigned int algolen,
const unsigned char* keyblob, unsigned int keybloblen) {
 
TRACE(("enter send_msg_userauth_pk_ok"))
CHECKCLEARTOWRITE();
Loading
Loading
@@ -188,7 +188,7 @@ static void send_msg_userauth_pk_ok(char* algo, unsigned int algolen,
 
}
 
static int checkpubkey_line(buffer* line, int line_num, char* filename,
static int checkpubkey_line(buffer* line, int line_num, const char* filename,
const char* algo, unsigned int algolen,
const unsigned char* keyblob, unsigned int keybloblen) {
buffer *options_buf = NULL;
Loading
Loading
@@ -292,8 +292,8 @@ out:
/* Checks whether a specified publickey (and associated algorithm) is an
* acceptable key for authentication */
/* Returns DROPBEAR_SUCCESS if key is ok for auth, DROPBEAR_FAILURE otherwise */
static int checkpubkey(char* algo, unsigned int algolen,
unsigned char* keyblob, unsigned int keybloblen) {
static int checkpubkey(const char* algo, unsigned int algolen,
const unsigned char* keyblob, unsigned int keybloblen) {
 
FILE * authfile = NULL;
char * filename = NULL;
Loading
Loading
Loading
Loading
@@ -43,24 +43,24 @@
static int sessioncommand(struct Channel *channel, struct ChanSess *chansess,
int iscmd, int issubsys);
static int sessionpty(struct ChanSess * chansess);
static int sessionsignal(struct ChanSess *chansess);
static int sessionsignal(const struct ChanSess *chansess);
static int noptycommand(struct Channel *channel, struct ChanSess *chansess);
static int ptycommand(struct Channel *channel, struct ChanSess *chansess);
static int sessionwinchange(struct ChanSess *chansess);
static int sessionwinchange(const struct ChanSess *chansess);
static void execchild(void *user_data_chansess);
static void addchildpid(struct ChanSess *chansess, pid_t pid);
static void sesssigchild_handler(int val);
static void closechansess(struct Channel *channel);
static int newchansess(struct Channel *channel);
static void chansessionrequest(struct Channel *channel);
static int sesscheckclose(struct Channel *channel);
static int sesscheckclose(const struct Channel *channel);
 
static void send_exitsignalstatus(struct Channel *channel);
static void send_msg_chansess_exitstatus(struct Channel * channel,
struct ChanSess * chansess);
static void send_msg_chansess_exitsignal(struct Channel * channel,
struct ChanSess * chansess);
static void get_termmodes(struct ChanSess *chansess);
static void send_exitsignalstatus(const struct Channel *channel);
static void send_msg_chansess_exitstatus(const struct Channel * channel,
const struct ChanSess * chansess);
static void send_msg_chansess_exitsignal(const struct Channel * channel,
const struct ChanSess * chansess);
static void get_termmodes(const struct ChanSess *chansess);
 
const struct ChanType svrchansess = {
0, /* sepfds */
Loading
Loading
@@ -74,7 +74,7 @@ const struct ChanType svrchansess = {
/* required to clear environment */
extern char** environ;
 
static int sesscheckclose(struct Channel *channel) {
static int sesscheckclose(const struct Channel *channel) {
struct ChanSess *chansess = (struct ChanSess*)channel->typedata;
TRACE(("sesscheckclose, pid is %d", chansess->exit.exitpid))
return chansess->exit.exitpid != -1;
Loading
Loading
@@ -159,7 +159,7 @@ static void sesssigchild_handler(int UNUSED(dummy)) {
}
 
/* send the exit status or the signal causing termination for a session */
static void send_exitsignalstatus(struct Channel *channel) {
static void send_exitsignalstatus(const struct Channel *channel) {
 
struct ChanSess *chansess = (struct ChanSess*)channel->typedata;
 
Loading
Loading
@@ -173,8 +173,8 @@ static void send_exitsignalstatus(struct Channel *channel) {
}
 
/* send the exitstatus to the client */
static void send_msg_chansess_exitstatus(struct Channel * channel,
struct ChanSess * chansess) {
static void send_msg_chansess_exitstatus(const struct Channel * channel,
const struct ChanSess * chansess) {
 
dropbear_assert(chansess->exit.exitpid != -1);
dropbear_assert(chansess->exit.exitsignal == -1);
Loading
Loading
@@ -192,8 +192,8 @@ static void send_msg_chansess_exitstatus(struct Channel * channel,
}
 
/* send the signal causing the exit to the client */
static void send_msg_chansess_exitsignal(struct Channel * channel,
struct ChanSess * chansess) {
static void send_msg_chansess_exitsignal(const struct Channel * channel,
const struct ChanSess * chansess) {
 
int i;
char* signame = NULL;
Loading
Loading
@@ -273,7 +273,7 @@ static int newchansess(struct Channel *channel) {
}
 
static struct logininfo*
chansess_login_alloc(struct ChanSess *chansess) {
chansess_login_alloc(const struct ChanSess *chansess) {
struct logininfo * li;
li = login_alloc_entry(chansess->pid, ses.authstate.username,
svr_ses.remotehost, chansess->tty);
Loading
Loading
@@ -403,7 +403,7 @@ out:
 
 
/* Send a signal to a session's process as requested by the client*/
static int sessionsignal(struct ChanSess *chansess) {
static int sessionsignal(const struct ChanSess *chansess) {
 
int sig = 0;
char* signame = NULL;
Loading
Loading
@@ -441,7 +441,7 @@ static int sessionsignal(struct ChanSess *chansess) {
 
/* Let the process know that the window size has changed, as notified from the
* client. Returns DROPBEAR_SUCCESS or DROPBEAR_FAILURE */
static int sessionwinchange(struct ChanSess *chansess) {
static int sessionwinchange(const struct ChanSess *chansess) {
 
int termc, termr, termw, termh;
 
Loading
Loading
@@ -460,7 +460,7 @@ static int sessionwinchange(struct ChanSess *chansess) {
return DROPBEAR_SUCCESS;
}
 
static void get_termmodes(struct ChanSess *chansess) {
static void get_termmodes(const struct ChanSess *chansess) {
 
struct termios termio;
unsigned char opcode;
Loading
Loading
Loading
Loading
@@ -40,7 +40,7 @@
 
static void x11accept(struct Listener* listener, int sock);
static int bindport(int fd);
static int send_msg_channel_open_x11(int fd, struct sockaddr_in* addr);
static int send_msg_channel_open_x11(int fd, const struct sockaddr_in* addr);
 
/* Check untrusted xauth strings for metacharacters */
/* Returns DROPBEAR_SUCCESS/DROPBEAR_FAILURE */
Loading
Loading
@@ -154,7 +154,7 @@ static void x11accept(struct Listener* listener, int sock) {
 
/* This is called after switching to the user, and sets up the xauth
* and environment variables. */
void x11setauth(struct ChanSess *chansess) {
void x11setauth(const struct ChanSess *chansess) {
 
char display[20]; /* space for "localhost:12345.123" */
FILE * authprog = NULL;
Loading
Loading
@@ -220,7 +220,7 @@ static const struct ChanType chan_x11 = {
};
 
 
static int send_msg_channel_open_x11(int fd, struct sockaddr_in* addr) {
static int send_msg_channel_open_x11(int fd, const struct sockaddr_in* addr) {
 
char* ipstring = NULL;
 
Loading
Loading
Loading
Loading
@@ -30,7 +30,7 @@
#include "channel.h"
 
int x11req(struct ChanSess * chansess);
void x11setauth(struct ChanSess *chansess);
void x11setauth(const struct ChanSess *chansess);
void x11cleanup(struct ChanSess *chansess);
 
#endif /* DROPBEAR_X11FWD */
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment