Skip to content
Permalink
Browse files

global: fix Windows warnings

  • Loading branch information...
tiennou committed Apr 18, 2019
1 parent d24ab14 commit 00cdcc2df71e2538f2ee9e43041868833cacead4
Showing with 14 additions and 15 deletions.
  1. +2 −2 src/agent.c
  2. +1 −1 src/bcrypt_pbkdf.c
  3. +1 −1 src/channel.c
  4. +2 −2 src/userauth.c
  5. +2 −2 src/userauth.h
  6. +4 −5 src/wincng.c
  7. +2 −2 src/wincng.h
@@ -290,7 +290,7 @@ agent_transact_pageant(LIBSSH2_AGENT *agent, agent_transaction_ctx_t transctx)
HANDLE filemap;
unsigned char *p;
unsigned char *p2;
int id;
LRESULT id;
COPYDATASTRUCT cds;

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

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

id = SendMessage(hwnd, WM_COPYDATA, (WPARAM) NULL, (LPARAM) &cds);
@@ -65,7 +65,7 @@ bcrypt_hash(uint8_t *sha2pass, uint8_t *sha2salt, uint8_t *out)
uint32_t cdata[BCRYPT_BLOCKS];
int i;
uint16_t j;
size_t shalen = SHA512_DIGEST_LENGTH;
uint16_t shalen = SHA512_DIGEST_LENGTH;

/* key expansion */
Blowfish_initstate(&state);
@@ -470,7 +470,7 @@ channel_forward_listen(LIBSSH2_SESSION * session, const char *host,
host = "0.0.0.0";

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)
+ port(4) */
session->fwdLstn_packet_len =
@@ -1080,9 +1080,9 @@ libssh2_userauth_hostbased_fromfile_ex(LIBSSH2_SESSION *session,
int
_libssh2_userauth_publickey(LIBSSH2_SESSION *session,
const char *username,
unsigned int username_len,
size_t username_len,
const unsigned char *pubkeydata,
unsigned long pubkeydata_len,
size_t pubkeydata_len,
LIBSSH2_USERAUTH_PUBLICKEY_SIGN_FUNC
((*sign_callback)),
void *abstract)
@@ -41,9 +41,9 @@
int
_libssh2_userauth_publickey(LIBSSH2_SESSION *session,
const char *username,
unsigned int username_len,
size_t username_len,
const unsigned char *pubkeydata,
unsigned long pubkeydata_len,
size_t pubkeydata_len,
LIBSSH2_USERAUTH_PUBLICKEY_SIGN_FUNC
((*sign_callback)),
void *abstract);
@@ -561,7 +561,7 @@ _libssh2_wincng_load_pem(LIBSSH2_SESSION *session,
}

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

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

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;

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

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

_libssh2_bn *
_libssh2_wincng_bignum_new_from_bin(unsigned long len,
const void *bin)
_libssh2_wincng_bignum_new_from_bin(size_t len, const void *bin)
{
_libssh2_bn *bn = _libssh2_bn_new();
unsigned char *bignum;
@@ -364,7 +364,7 @@ struct _libssh2_wincng_bignum {
*/

_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);

#define _libssh2_bn_new() \
@@ -553,7 +553,7 @@ _libssh2_wincng_bignum_set_word(_libssh2_bn *bn, unsigned long word);
unsigned long
_libssh2_wincng_bignum_bits(const _libssh2_bn *bn);
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);
void
_libssh2_wincng_bignum_to_bin(const _libssh2_bn *bn, unsigned char *bin);

0 comments on commit 00cdcc2

Please sign in to comment.
You can’t perform that action at this time.