diff --git a/ChangeLog.md b/ChangeLog.md index a5c45c6..cc67c04 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,6 +1,18 @@ ## Release Notes +### v1.7 (08/21/2020) + +* Fix for publish with short topic name and example. (PR #169) +Add MqttProps_ShutDown(). Fix MqttProp leaks(PR #167) +* Multithread fixes. (PR #166) +* Fix buffer overrun in strcpy(). Fix logic around getaddrinfo(). (PR #165) +* Fix MqttClient_WaitType for nonblock mode. (PR #164) +* Change anon union for ARMv6 error. (PR #163) +* Fix for publish large payload. (PR #162) +* Fixing LWT prop and allow null LWT. (PR #161) +* Fix for receive timeout in mqttsimple example. (PR #158) + ### v1.6 (04/24/2020) * Fixes to improve buffer size checking when using a small tx or rx buffer. (PR #137) diff --git a/README.md b/README.md index 4b378a8..72b325c 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Notes: For building wolfMQTT with TLS support in Visual Studio: -1. Open the `wolfssl-root>/wolfssl64.sln`. +1. Open the `/wolfssl64.sln`. 2. Re-target for your Visual Studio version (right-click on solution and choose `Retarget solution`). 3. Make sure the `Debug DLL` or `Release DLL` configuration is selected. Make note if you are building 32-bit `x86` or 64-bit `x64`. 4. Build the wolfSSL solution. @@ -173,6 +173,9 @@ The wolfMQTT client supports connecting to v5 enabled brokers when configured wi * Topic Alias The v5 enabled wolfMQTT client was tested with the following MQTT v5 brokers: +* Mosquitto +** Runs locally. +** `./examples/mqttclient/mqttclient -h localhost` * Flespi ** Requires an account tied token that is regenerated hourly. ** `./examples/mqttclient/mqttclient -h "mqtt.flespi.io" -u ""` diff --git a/configure.ac b/configure.ac index 749cf55..af56960 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ # All right reserved. AC_COPYRIGHT([Copyright (C) 2014-2020 wolfSSL Inc.]) -AC_INIT([wolfmqtt],[1.6.0],[https://github.com/wolfssl/wolfMQTT/issues],[wolfmqtt],[http://www.wolfssl.com]) +AC_INIT([wolfmqtt],[1.7.0],[https://github.com/wolfssl/wolfMQTT/issues],[wolfmqtt],[http://www.wolfssl.com]) AC_PREREQ([2.63]) AC_CONFIG_AUX_DIR([build-aux]) @@ -23,7 +23,7 @@ AC_ARG_PROGRAM AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_HEADERS([src/config.h]) -WOLFMQTT_LIBRARY_VERSION=6:0:0 +WOLFMQTT_LIBRARY_VERSION=7:0:0 # | | | # +------+ | +---+ # | | | diff --git a/examples/aws/awsiot.c b/examples/aws/awsiot.c index a4153fa..d71e116 100644 --- a/examples/aws/awsiot.c +++ b/examples/aws/awsiot.c @@ -76,8 +76,8 @@ static int mStopRead = 0; #define AWSIOT_KEEP_ALIVE_SEC DEFAULT_KEEP_ALIVE_SEC #define AWSIOT_CMD_TIMEOUT_MS DEFAULT_CMD_TIMEOUT_MS -#define AWSIOT_SUBSCRIBE_TOPIC "$aws/things/"AWSIOT_DEVICE_ID"/shadow/update/delta" -#define AWSIOT_PUBLISH_TOPIC "$aws/things/"AWSIOT_DEVICE_ID"/shadow/update" +#define AWSIOT_SUBSCRIBE_TOPIC "$aws/things/" AWSIOT_DEVICE_ID "/shadow/update/delta" +#define AWSIOT_PUBLISH_TOPIC "$aws/things/" AWSIOT_DEVICE_ID "/shadow/update" #define AWSIOT_PUBLISH_MSG_SZ 400 diff --git a/examples/aws/awsiot.vcxproj b/examples/aws/awsiot.vcxproj index 5d9475a..41b997c 100755 --- a/examples/aws/awsiot.vcxproj +++ b/examples/aws/awsiot.vcxproj @@ -92,7 +92,7 @@ Level3 Disabled true - ..\..\;..\..\..\wolfssl;%(AdditionalIncludeDirectories) + ..\..\;..\..\..\wolfssl;../../../wolfssl/IDE/WIN/;%(AdditionalIncludeDirectories) WOLFSSL_USER_SETTINGS; _MBCS;%(PreprocessorDefinitions) diff --git a/examples/azure/azureiothub.c b/examples/azure/azureiothub.c index 22b2c25..e8bb54d 100644 --- a/examples/azure/azureiothub.c +++ b/examples/azure/azureiothub.c @@ -86,8 +86,8 @@ static int mStopRead = 0; #define AZURE_TOKEN_EXPIRY_SEC (60 * 60 * 1) /* 1 hour */ #define AZURE_TOKEN_SIZE 400 -#define AZURE_DEVICE_NAME AZURE_HOST"/devices/"AZURE_DEVICE_ID -#define AZURE_USERNAME AZURE_HOST"/"AZURE_DEVICE_ID"/"AZURE_API_VERSION +#define AZURE_DEVICE_NAME AZURE_HOST "/devices/" AZURE_DEVICE_ID +#define AZURE_USERNAME AZURE_HOST "/" AZURE_DEVICE_ID "/" AZURE_API_VERSION #define AZURE_SIG_FMT "%s\n%ld" /* [device name (URL Encoded)]\n[Expiration sec UTC] */ #define AZURE_PASSWORD_FMT "SharedAccessSignature sr=%s&sig=%s&se=%ld" @@ -95,8 +95,8 @@ static int mStopRead = 0; sig=[HMAC-SHA256 of AZURE_SIG_FMT using AZURE_KEY (URL Encoded)] se=[Expiration sec UTC] */ -#define AZURE_MSGS_TOPIC_NAME "devices/"AZURE_DEVICE_ID"/messages/devicebound/#" /* subscribe */ -#define AZURE_EVENT_TOPIC "devices/"AZURE_DEVICE_ID"/messages/events/" /* publish */ +#define AZURE_MSGS_TOPIC_NAME "devices/" AZURE_DEVICE_ID "/messages/devicebound/#" /* subscribe */ +#define AZURE_EVENT_TOPIC "devices/" AZURE_DEVICE_ID "/messages/events/" /* publish */ /* Encoding Support */ diff --git a/examples/azure/azureiothub.vcxproj b/examples/azure/azureiothub.vcxproj index 01a7222..4409adb 100755 --- a/examples/azure/azureiothub.vcxproj +++ b/examples/azure/azureiothub.vcxproj @@ -92,7 +92,7 @@ Level3 Disabled true - ..\..\;..\..\..\wolfssl;%(AdditionalIncludeDirectories) + ..\..\;..\..\..\wolfssl;../../../wolfssl/IDE/WIN/;%(AdditionalIncludeDirectories) WOLFSSL_USER_SETTINGS; _MBCS;%(PreprocessorDefinitions) diff --git a/examples/firmware/fwclient.vcxproj b/examples/firmware/fwclient.vcxproj index 0c6cc20..d53971c 100755 --- a/examples/firmware/fwclient.vcxproj +++ b/examples/firmware/fwclient.vcxproj @@ -92,7 +92,7 @@ Level3 Disabled true - ..\..\;..\..\..\wolfssl;%(AdditionalIncludeDirectories) + ..\..\;..\..\..\wolfssl;../../../wolfssl/IDE/WIN/;%(AdditionalIncludeDirectories) WOLFSSL_USER_SETTINGS; _MBCS;%(PreprocessorDefinitions) diff --git a/examples/firmware/fwpush.vcxproj b/examples/firmware/fwpush.vcxproj index dffad6e..8e2abff 100755 --- a/examples/firmware/fwpush.vcxproj +++ b/examples/firmware/fwpush.vcxproj @@ -92,7 +92,7 @@ Level3 Disabled true - ..\..\;..\..\..\wolfssl;%(AdditionalIncludeDirectories) + ..\..\;..\..\..\wolfssl;../../../wolfssl/IDE/WIN/;%(AdditionalIncludeDirectories) WOLFSSL_USER_SETTINGS; _MBCS;%(PreprocessorDefinitions) diff --git a/examples/mqttclient/mqttclient.vcxproj b/examples/mqttclient/mqttclient.vcxproj index 7ad3153..de967c1 100755 --- a/examples/mqttclient/mqttclient.vcxproj +++ b/examples/mqttclient/mqttclient.vcxproj @@ -92,7 +92,7 @@ Level3 Disabled true - ..\..\;..\..\..\wolfssl;%(AdditionalIncludeDirectories) + ..\..\;..\..\..\wolfssl;../../../wolfssl/IDE/WIN/;%(AdditionalIncludeDirectories) WOLFSSL_USER_SETTINGS; _MBCS;%(PreprocessorDefinitions) diff --git a/examples/mqttnet.c b/examples/mqttnet.c index afd49d0..98476a4 100644 --- a/examples/mqttnet.c +++ b/examples/mqttnet.c @@ -62,7 +62,9 @@ #define SOCKET_T SOCKET #define SOERROR_T char #define SELECT_FD(fd) (fd) - #define SOCKET_INVALID ((SOCKET_T)INVALID_SOCKET) + #ifndef SOCKET_INVALID /* Do not redefine from wolfssl */ + #define SOCKET_INVALID ((SOCKET_T)INVALID_SOCKET) + #endif #define SOCK_CLOSE closesocket #define SOCK_SEND(s,b,l,f) send((s), (const char*)(b), (size_t)(l), (f)) #define SOCK_RECV(s,b,l,f) recv((s), (char*)(b), (size_t)(l), (f)) diff --git a/examples/multithread/multithread.c b/examples/multithread/multithread.c index 5517809..f2bb6d0 100755 --- a/examples/multithread/multithread.c +++ b/examples/multithread/multithread.c @@ -55,7 +55,7 @@ static int mNumMsgsRecvd; #include typedef HANDLE THREAD_T; #define THREAD_CREATE(h, f, c) *h = CreateThread(NULL, 0, f, c, 0, NULL) - #define THREAD_JOIN(h, c) WaitForMultipleObjects(c, h, TRUE, INFINITE); + #define THREAD_JOIN(h, c) WaitForMultipleObjects(c, h, TRUE, INFINITE) #define THREAD_EXIT(e) return e; #else /* Posix (Linux/Mac) */ diff --git a/examples/multithread/multithread.vcxproj b/examples/multithread/multithread.vcxproj index b30cdf7..bd4beb5 100755 --- a/examples/multithread/multithread.vcxproj +++ b/examples/multithread/multithread.vcxproj @@ -92,7 +92,7 @@ Level3 Disabled true - ..\..\;..\..\..\wolfssl;%(AdditionalIncludeDirectories) + ..\..\;..\..\..\wolfssl;../../../wolfssl/IDE/WIN/;%(AdditionalIncludeDirectories) WOLFSSL_USER_SETTINGS; _MBCS;%(PreprocessorDefinitions) diff --git a/examples/nbclient/nbclient.vcxproj b/examples/nbclient/nbclient.vcxproj index 45b35f3..94cb04e 100644 --- a/examples/nbclient/nbclient.vcxproj +++ b/examples/nbclient/nbclient.vcxproj @@ -82,7 +82,7 @@ true true WOLFSSL_USER_SETTINGS; _MBCS;%(PreprocessorDefinitions) - ..\..\;..\..\..\wolfssl;%(AdditionalIncludeDirectories) + ..\..\;..\..\..\wolfssl;../../../wolfssl/IDE/WIN/;%(AdditionalIncludeDirectories) Ws2_32.lib;$(SolutionDir)wolfssl.lib;%(AdditionalDependencies) diff --git a/examples/sn-client/sn-client.vcxproj b/examples/sn-client/sn-client.vcxproj index bc73b95..81116e4 100644 --- a/examples/sn-client/sn-client.vcxproj +++ b/examples/sn-client/sn-client.vcxproj @@ -82,7 +82,7 @@ true true WOLFSSL_USER_SETTINGS; _MBCS;%(PreprocessorDefinitions) - ..\..\;..\..\..\wolfssl;%(AdditionalIncludeDirectories) + ..\..\;..\..\..\wolfssl;../../../wolfssl/IDE/WIN/;%(AdditionalIncludeDirectories) Ws2_32.lib;$(SolutionDir)wolfssl.lib;%(AdditionalDependencies) diff --git a/examples/wiot/wiot.vcxproj b/examples/wiot/wiot.vcxproj index 0cb3107..d7cabd0 100755 --- a/examples/wiot/wiot.vcxproj +++ b/examples/wiot/wiot.vcxproj @@ -92,7 +92,7 @@ Level3 Disabled true - ..\..\;..\..\..\wolfssl;%(AdditionalIncludeDirectories) + ..\..\;..\..\..\wolfssl;../../../wolfssl/IDE/WIN/;%(AdditionalIncludeDirectories) WOLFSSL_USER_SETTINGS; _MBCS;%(PreprocessorDefinitions) diff --git a/scripts/nbclient.test b/scripts/nbclient.test index 10bfa7b..48ae6c5 100755 --- a/scripts/nbclient.test +++ b/scripts/nbclient.test @@ -2,6 +2,9 @@ # Non-blocking Client test +# Wait 3 secs for other tests to conclude +sleep 3 + # Check for application [ ! -x ./examples/nbclient/nbclient ] && echo -e "\n\nNon-blocking Client doesn't exist" && exit 1 diff --git a/src/mqtt_packet.c b/src/mqtt_packet.c index e77d214..447bd8b 100755 --- a/src/mqtt_packet.c +++ b/src/mqtt_packet.c @@ -132,7 +132,7 @@ static const struct MqttPropMatrix gPropMatrix[] = { /* Property structure allocation array. Property type equal to zero indicates unused element. */ -static MqttProp clientPropStack[MQTT_MAX_PROPS] = {}; +static MqttProp clientPropStack[MQTT_MAX_PROPS]; #ifdef WOLFMQTT_MULTITHREAD static wm_Sem clientPropStack_lock; #endif @@ -344,7 +344,7 @@ int MqttEncode_Data(byte *buf, const byte *data, word16 data_len) { int len = MqttEncode_Num(buf, data_len); - if (buf != NULL) { + if ((buf != NULL) && (data != NULL)) { buf += len; XMEMCPY(buf, data, data_len); } diff --git a/wolfmqtt/version.h b/wolfmqtt/version.h index 3f7d982..b1b7bc3 100644 --- a/wolfmqtt/version.h +++ b/wolfmqtt/version.h @@ -34,8 +34,8 @@ extern "C" { #endif -#define LIBWOLFMQTT_VERSION_STRING "1.6.0" -#define LIBWOLFMQTT_VERSION_HEX 0x01006000 +#define LIBWOLFMQTT_VERSION_STRING "1.7.0" +#define LIBWOLFMQTT_VERSION_HEX 0x01007000 #ifdef __cplusplus }