Fix some missing void * and const in existing APIs.

Several changes here that should have been in commit 7babe66a8 but I
missed them.
This commit is contained in:
Simon Tatham 2018-06-02 07:52:26 +01:00
Родитель 6ce79d8d22
Коммит 8d882756b8
5 изменённых файлов: 13 добавлений и 9 удалений

Просмотреть файл

@ -605,7 +605,7 @@ void pfd_override_throttle(struct PortForwarding *pf, int enable)
/*
* Called to send data down the raw connection.
*/
int pfd_send(struct PortForwarding *pf, char *data, int len)
int pfd_send(struct PortForwarding *pf, const void *data, int len)
{
if (pf == NULL)
return 0;

4
ssh.c
Просмотреть файл

@ -5890,7 +5890,7 @@ static void ssh1_msg_channel_close(Ssh ssh, struct Packet *pktin)
/*
* Handle incoming data on an SSH-1 or SSH-2 agent-forwarding channel.
*/
static int ssh_agent_channel_data(struct ssh_channel *c, char *data,
static int ssh_agent_channel_data(struct ssh_channel *c, const void *data,
int length)
{
bufchain_add(&c->u.a.inbuffer, data, length);
@ -5908,7 +5908,7 @@ static int ssh_agent_channel_data(struct ssh_channel *c, char *data,
}
static int ssh_channel_data(struct ssh_channel *c, int is_stderr,
char *data, int length)
const void *data, int length)
{
switch (c->type) {
case CHAN_MAINSESSION:

6
ssh.h
Просмотреть файл

@ -226,7 +226,7 @@ struct ec_key *ssh_ecdhkex_newkey(const struct ssh_kex *kex);
void ssh_ecdhkex_freekey(struct ec_key *key);
void ssh_ecdhkex_getpublic(struct ec_key *key, BinarySink *bs);
Bignum ssh_ecdhkex_getkey(struct ec_key *key,
char *remoteKey, int remoteKeyLen);
const void *remoteKey, int remoteKeyLen);
/*
* Helper function for k generation in DSA, reused in ECDSA
@ -542,7 +542,7 @@ void ssh_send_port_open(void *channel, const char *hostname, int port,
extern char *pfd_connect(struct PortForwarding **pf, char *hostname, int port,
void *c, Conf *conf, int addressfamily);
extern void pfd_close(struct PortForwarding *);
extern int pfd_send(struct PortForwarding *, char *data, int len);
extern int pfd_send(struct PortForwarding *, const void *data, int len);
extern void pfd_send_eof(struct PortForwarding *);
extern void pfd_confirm(struct PortForwarding *);
extern void pfd_unthrottle(struct PortForwarding *);
@ -622,7 +622,7 @@ void x11_free_fake_auth(struct X11FakeAuth *auth);
struct X11Connection; /* opaque outside x11fwd.c */
struct X11Connection *x11_init(tree234 *authtree, void *, const char *, int);
extern void x11_close(struct X11Connection *);
extern int x11_send(struct X11Connection *, char *, int);
extern int x11_send(struct X11Connection *, const void *, int);
extern void x11_send_eof(struct X11Connection *s);
extern void x11_unthrottle(struct X11Connection *s);
extern void x11_override_throttle(struct X11Connection *s, int enable);

Просмотреть файл

@ -2689,7 +2689,8 @@ void ssh_ecdhkex_getpublic(struct ec_key *ec, BinarySink *bs)
}
}
Bignum ssh_ecdhkex_getkey(struct ec_key *ec, char *remoteKey, int remoteKeyLen)
Bignum ssh_ecdhkex_getkey(struct ec_key *ec,
const void *remoteKey, int remoteKeyLen)
{
struct ec_point remote;
Bignum ret;
@ -2708,7 +2709,8 @@ Bignum ssh_ecdhkex_getkey(struct ec_key *ec, char *remoteKey, int remoteKeyLen)
remote.curve = ec->publicKey.curve;
remote.infinity = 0;
remote.x = bignum_from_bytes_le((unsigned char*)remoteKey, remoteKeyLen);
remote.x = bignum_from_bytes_le((const unsigned char *)remoteKey,
remoteKeyLen);
remote.y = NULL;
remote.z = NULL;
}

Просмотреть файл

@ -800,8 +800,10 @@ static int x11_parse_ip(const char *addr_string, unsigned long *ip)
/*
* Called to send data down the raw connection.
*/
int x11_send(struct X11Connection *xconn, char *data, int len)
int x11_send(struct X11Connection *xconn, const void *vdata, int len)
{
const char *data = (const char *)vdata;
if (!xconn)
return 0;