Skip to content

Commit

Permalink
global: fix Windows warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
tiennou committed Jun 1, 2019
1 parent ea341bf commit efbfc6c
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/agent.c
Expand Up @@ -290,7 +290,7 @@ agent_transact_pageant(LIBSSH2_AGENT *agent, agent_transaction_ctx_t transctx)
HANDLE filemap; HANDLE filemap;
unsigned char *p; unsigned char *p;
unsigned char *p2; unsigned char *p2;
int id; LRESULT id;
COPYDATASTRUCT cds; COPYDATASTRUCT cds;


if(!transctx || 4 + transctx->request_len > PAGEANT_MAX_MSGLEN) if(!transctx || 4 + transctx->request_len > PAGEANT_MAX_MSGLEN)
Expand Down Expand Up @@ -322,7 +322,7 @@ agent_transact_pageant(LIBSSH2_AGENT *agent, agent_transaction_ctx_t transctx)
transctx->request_len); transctx->request_len);


cds.dwData = PAGEANT_COPYDATA_ID; cds.dwData = PAGEANT_COPYDATA_ID;
cds.cbData = 1 + strlen(mapname); cds.cbData = (DWORD)(1 + strlen(mapname));
cds.lpData = mapname; cds.lpData = mapname;


id = SendMessage(hwnd, WM_COPYDATA, (WPARAM) NULL, (LPARAM) &cds); id = SendMessage(hwnd, WM_COPYDATA, (WPARAM) NULL, (LPARAM) &cds);
Expand Down
2 changes: 1 addition & 1 deletion src/bcrypt_pbkdf.c
Expand Up @@ -65,7 +65,7 @@ bcrypt_hash(uint8_t *sha2pass, uint8_t *sha2salt, uint8_t *out)
uint32_t cdata[BCRYPT_BLOCKS]; uint32_t cdata[BCRYPT_BLOCKS];
int i; int i;
uint16_t j; uint16_t j;
size_t shalen = SHA512_DIGEST_LENGTH; uint16_t shalen = SHA512_DIGEST_LENGTH;


/* key expansion */ /* key expansion */
Blowfish_initstate(&state); Blowfish_initstate(&state);
Expand Down
2 changes: 1 addition & 1 deletion src/channel.c
Expand Up @@ -469,7 +469,7 @@ channel_forward_listen(LIBSSH2_SESSION * session, const char *host,
host = "0.0.0.0"; host = "0.0.0.0";


if(session->fwdLstn_state == libssh2_NB_state_idle) { if(session->fwdLstn_state == libssh2_NB_state_idle) {
session->fwdLstn_host_len = strlen(host); session->fwdLstn_host_len = (uint32_t)strlen(host);
/* 14 = packet_type(1) + request_len(4) + want_replay(1) + host_len(4) /* 14 = packet_type(1) + request_len(4) + want_replay(1) + host_len(4)
+ port(4) */ + port(4) */
session->fwdLstn_packet_len = session->fwdLstn_packet_len =
Expand Down
4 changes: 2 additions & 2 deletions src/userauth.c
Expand Up @@ -1080,9 +1080,9 @@ libssh2_userauth_hostbased_fromfile_ex(LIBSSH2_SESSION *session,
int int
_libssh2_userauth_publickey(LIBSSH2_SESSION *session, _libssh2_userauth_publickey(LIBSSH2_SESSION *session,
const char *username, const char *username,
unsigned int username_len, size_t username_len,
const unsigned char *pubkeydata, const unsigned char *pubkeydata,
unsigned long pubkeydata_len, size_t pubkeydata_len,
LIBSSH2_USERAUTH_PUBLICKEY_SIGN_FUNC LIBSSH2_USERAUTH_PUBLICKEY_SIGN_FUNC
((*sign_callback)), ((*sign_callback)),
void *abstract) void *abstract)
Expand Down
4 changes: 2 additions & 2 deletions src/userauth.h
Expand Up @@ -41,9 +41,9 @@
int int
_libssh2_userauth_publickey(LIBSSH2_SESSION *session, _libssh2_userauth_publickey(LIBSSH2_SESSION *session,
const char *username, const char *username,
unsigned int username_len, size_t username_len,
const unsigned char *pubkeydata, const unsigned char *pubkeydata,
unsigned long pubkeydata_len, size_t pubkeydata_len,
LIBSSH2_USERAUTH_PUBLICKEY_SIGN_FUNC LIBSSH2_USERAUTH_PUBLICKEY_SIGN_FUNC
((*sign_callback)), ((*sign_callback)),
void *abstract); void *abstract);
Expand Down
9 changes: 4 additions & 5 deletions src/wincng.c
Expand Up @@ -561,7 +561,7 @@ _libssh2_wincng_load_pem(LIBSSH2_SESSION *session,
} }


ret = _libssh2_pem_parse(session, headerbegin, headerend, ret = _libssh2_pem_parse(session, headerbegin, headerend,
passphrase, (unsigned char *)passphrase,
fp, data, datalen); fp, data, datalen);


fclose(fp); fclose(fp);
Expand Down Expand Up @@ -1879,7 +1879,7 @@ _libssh2_wincng_bignum_new(void)
} }


static int static int
_libssh2_wincng_bignum_resize(_libssh2_bn *bn, unsigned long length) _libssh2_wincng_bignum_resize(_libssh2_bn *bn, size_t length)
{ {
unsigned char *bignum; unsigned char *bignum;


Expand Down Expand Up @@ -1909,7 +1909,7 @@ static int
_libssh2_wincng_bignum_rand(_libssh2_bn *rnd, int bits, int top, int bottom) _libssh2_wincng_bignum_rand(_libssh2_bn *rnd, int bits, int top, int bottom)
{ {
unsigned char *bignum; unsigned char *bignum;
unsigned long length; size_t length;


if(!rnd) if(!rnd)
return -1; return -1;
Expand Down Expand Up @@ -2071,8 +2071,7 @@ _libssh2_wincng_bignum_bits(const _libssh2_bn *bn)
} }


_libssh2_bn * _libssh2_bn *
_libssh2_wincng_bignum_new_from_bin(unsigned long len, _libssh2_wincng_bignum_new_from_bin(size_t len, const void *bin)
const void *bin)
{ {
_libssh2_bn *bn = _libssh2_bn_new(); _libssh2_bn *bn = _libssh2_bn_new();
unsigned char *bignum; unsigned char *bignum;
Expand Down
4 changes: 2 additions & 2 deletions src/wincng.h
Expand Up @@ -364,7 +364,7 @@ struct _libssh2_wincng_bignum {
*/ */


_libssh2_bn *_libssh2_wincng_bignum_new(void); _libssh2_bn *_libssh2_wincng_bignum_new(void);
_libssh2_bn *_libssh2_wincng_bignum_new_from_bin(unsigned long len, _libssh2_bn *_libssh2_wincng_bignum_new_from_bin(size_t len,
const void *val); const void *val);


#define _libssh2_bn_new() \ #define _libssh2_bn_new() \
Expand Down Expand Up @@ -553,7 +553,7 @@ _libssh2_wincng_bignum_set_word(_libssh2_bn *bn, unsigned long word);
unsigned long unsigned long
_libssh2_wincng_bignum_bits(const _libssh2_bn *bn); _libssh2_wincng_bignum_bits(const _libssh2_bn *bn);
void void
_libssh2_wincng_bignum_from_bin(_libssh2_bn *bn, unsigned long len, _libssh2_wincng_bignum_from_bin(_libssh2_bn *bn, size_t len,
const unsigned char *bin); const unsigned char *bin);
void void
_libssh2_wincng_bignum_to_bin(const _libssh2_bn *bn, unsigned char *bin); _libssh2_wincng_bignum_to_bin(const _libssh2_bn *bn, unsigned char *bin);
Expand Down

0 comments on commit efbfc6c

Please sign in to comment.