Merge pull request #197 from ejohnstown/maintenance

Maintenance
pull/200/head
JacobBarthelmeh 2019-09-19 22:36:48 -06:00 committed by GitHub
commit 4a246abc76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 19 additions and 11 deletions

View File

@ -1026,7 +1026,7 @@ THREAD_RETURN WOLFSSH_THREAD echoserver_test(void* args)
WMEMCPY(ipaddr, &sock.ip_num, MAX_ADDRESS_SIZE);
NU_Inet_NTOP(NU_FAMILY_IP, &ipaddr[0], buf, 16);
fprintf(stdout, "Listing on %s:%d\r\n", buf, port);
fprintf(stdout, "Listening on %s:%d\r\n", buf, port);
}
#endif

View File

@ -53,7 +53,8 @@ static void myStatusCb(WOLFSSH* sshIn, word32* bytes, char* name)
{
char buf[80];
word64 longBytes = ((word64)bytes[1] << 32) | bytes[0];
WSNPRINTF(buf, sizeof(buf), "Processed %8ld\t bytes \r", longBytes);
WSNPRINTF(buf, sizeof(buf), "Processed %8llu\t bytes \r",
(unsigned long long)longBytes);
WFPUTS(buf, fout);
(void)name;
(void)sshIn;
@ -1229,7 +1230,7 @@ THREAD_RETURN WOLFSSH_THREAD sftpclient_test(void* args)
(word32)WSTRLEN(hanselPublicEcc),
(byte*)userPublicKey, &userPublicKeySz);
strncpy((char*)userPublicKeyType, "ecdsa-sha2-nistp256",
WSTRNCPY((char*)userPublicKeyType, "ecdsa-sha2-nistp256",
sizeof(userPublicKeyType));
userPrivateKey = hanselPrivateEcc;
userPrivateKeySz = hanselPrivateEccSz;
@ -1240,7 +1241,7 @@ THREAD_RETURN WOLFSSH_THREAD sftpclient_test(void* args)
(word32)WSTRLEN(hanselPublicRsa),
(byte*)userPublicKey, &userPublicKeySz);
strncpy((char*)userPublicKeyType, "ssh-rsa",
WSTRNCPY((char*)userPublicKeyType, "ssh-rsa",
sizeof(userPublicKeyType));
userPrivateKey = hanselPrivateRsa;
userPrivateKeySz = hanselPrivateRsaSz;

View File

@ -5091,8 +5091,8 @@ int DoReceive(WOLFSSH* ssh)
ssh->curSz + LENGTH_SZ - peerBlockSz);
}
else {
WLOG(WS_LOG_INFO,
"Not trying to decrypt short message.");
/* Entire packet fit in one block, don't need
* to decrypt any more data this packet. */
}
/* Verify the buffer is big enough for the data and mac.
@ -5149,8 +5149,8 @@ int DoReceive(WOLFSSH* ssh)
ssh->error = ret;
return WS_FATAL_ERROR;
}
WLOG(WS_LOG_DEBUG, "PR3: peerMacSz = %u", ssh->peerMacSz);
ssh->inputBuffer.idx += ssh->peerMacSz;
WLOG(WS_LOG_DEBUG, "PR3: peerMacSz = %u", peerMacSz);
ssh->inputBuffer.idx += peerMacSz;
break;
default:

View File

@ -1046,6 +1046,12 @@ int wolfSSH_SendIgnore(WOLFSSH* ssh, const byte* buf, word32 bufSz)
}
int wolfSSH_SendDisconnect(WOLFSSH* ssh, word32 reason)
{
return SendDisconnect(ssh, reason);
}
void wolfSSH_SetUserAuth(WOLFSSH_CTX* ctx, WS_CallbackUserAuth cb)
{
if (ctx != NULL) {

View File

@ -1259,7 +1259,7 @@ int ReceiveScpMessage(WOLFSSH* ssh)
return sz;
/* null-terminate request, replace newline */
buf[sz-1] = '\0';
buf[sz] = '\0';
switch (buf[0]) {
case 'C':

View File

@ -7287,7 +7287,7 @@ int wolfSSH_SFTP_Put(WOLFSSH* ssh, char* from, char* to, byte resume,
if (resume) {
WMEMSET(&state->offset, 0, sizeof(OVERLAPPED));
state->offset.OffsetHigh = 0;
state->offset.Offset = (DWORD)state->pOfst;
state->offset.Offset = state->pOfst[0];
}
#endif /* USE_WINDOWS_API */
state->rSz = 0;
@ -7342,7 +7342,7 @@ int wolfSSH_SFTP_Put(WOLFSSH* ssh, char* from, char* to, byte resume,
AddAssign64(state->pOfst, sz);
#ifdef USE_WINDOWS_API
state->offset.OffsetHigh = 0;
state->offset.Offset = (DWORD)state->pOfst;
state->offset.Offset = state->pOfst[0];
#endif /* USE_WINDOWS_API */
state->rSz -= sz;
if (statusCb != NULL) {

View File

@ -188,6 +188,7 @@ WOLFSSH_API int wolfSSH_stream_exit(WOLFSSH*, int);
WOLFSSH_API int wolfSSH_extended_data_read(WOLFSSH*, byte*, word32);
WOLFSSH_API int wolfSSH_TriggerKeyExchange(WOLFSSH*);
WOLFSSH_API int wolfSSH_SendIgnore(WOLFSSH*, const byte*, word32);
WOLFSSH_API int wolfSSH_SendDisconnect(WOLFSSH*, word32);
WOLFSSH_API int wolfSSH_global_request(WOLFSSH*, const unsigned char*, word32, int);
WOLFSSH_API void wolfSSH_GetStats(WOLFSSH*,