Граф коммитов

2292 Коммитов

Автор SHA1 Сообщение Дата
Dane Walton 971bf9a127
Merge branch 'master' into dane/mactime 2021-09-10 19:10:47 -07:00
Dane Walton 2ac851336e
change linux time to use int64_t (#557) 2021-09-10 19:10:29 -07:00
Dane Walton 1f3733ce34 real time 2021-09-10 18:48:53 -07:00
Dane Walton 71afe056d9 add faster mac time 2021-09-10 15:26:15 -07:00
Mollie Munoz 73a2039cc0
Vcpkg CURL fix for build (#555)
Update CURL find-package logic to enable Vcpkg build on linux.
2021-09-08 16:12:39 -07:00
Dane Walton 64ea7a9359
fix possible overflow warning gcc11 (#553) 2021-09-03 13:22:33 -07:00
Dane Walton 92cc8891c5
fix build break for gcc11 (#552) 2021-09-02 14:23:31 -07:00
ODugas 5d72f8adff
crt_abstractions.c: fix error management in mallocAndStrcpy (#545)
It can be demonstrated that the errno_t returned by strcpy_s
(which is described as a regular int by the signature) can
and will contain a positive error code. We therefore need to
check for non-zero returned value instead of strictly
negative integers.

See https://docs.microsoft.com/ for strcpy_s, wcscpy_s, _mbscpy_s
Zero if successful; otherwise, an error.

Co-authored-by: Olivier Dugas Ing <olivier.dugas@axceta.com>
2021-09-02 13:58:34 -07:00
Dane Walton 91789f9819
update log (#549) 2021-09-02 11:31:49 -07:00
Dane Walton c3749db4a7 update misnamed macro 2021-09-02 07:50:14 -07:00
Yulin Li 449a3e3de0
fix #443, a dead loop in read chunk (#444) 2021-09-01 15:30:17 -07:00
Adam Ling (MSFT) b959732483
fix mem leak in tlsio_schannel.c (#540)
Co-authored-by: Dane Walton <dane.walton@microsoft.com>
2021-08-31 17:35:49 -07:00
Mollie Munoz e4d74dce9a
Revert all c-utility install location changes (#543) 2021-08-17 18:19:09 -07:00
Mollie Munoz 5edd3547f7
Fix for vcpkg build (#542) 2021-08-17 11:29:36 -07:00
Eric Wolz eb958fb5b6
Move to devops hosted agent (#539)
* Test windows hosted agent

* Update CMakeLists.txt

* Update CMakeLists.txt

* generate c++ wrappers

* added generate_c_wrapper

* supress 4505

* fix 4505 warning

* vsprintf_wchar_with_empty_string_succeeds test

* fixed warnings and x64 build

* fix unix build

* fix guid tests

* fix win32 unit test

* putback compile_c_test_artifacts_as directive

* added back compile_c_test_artifacts_as

* fixed uniqueid_ut_test_file

* default use_cppunittest to off

x64 build will enable it to test both c and cpp unit tests

* fix cmake warnings

* move to cmake v3.5

* update to use our 1es agents

* pr feedback

* remove guid comment

* fixed EOF
2021-08-12 18:25:51 -07:00
ewertons 74f8c80917
Merge pull request #541 from Azure/ewertons/fix_blob_upload_fail_mbedtls_1995
Fail to upload long Blob using mbedtls+compact(Issue #1995)
2021-08-09 13:31:52 -07:00
ewertons e87f421227
Update adapters/tlsio_mbedtls.c
Co-authored-by: Dane Walton <dane.walton@microsoft.com>
2021-08-09 12:16:42 -07:00
ewertons 77926c0995
Update adapters/httpapi_compact.c
Co-authored-by: Dane Walton <dane.walton@microsoft.com>
2021-08-09 12:16:34 -07:00
Ewerton Scaboro da Silva 026dac6b82 Merge branch 'master' into SE/fix_blob_upload_fail_mbedtls_1995 2021-08-03 16:54:01 -07:00
Francesco Giancane 3a7997af72
hmac.c: fix mismatching function prototype (#537)
The reported function raises a warning when compilers assert the flag
`-Warray-parameter=`, signaling that an array-type argument was promoted
to a pointer-type argument.

While in practice in most C implementations this is correct, fixing the
warning (and, in this case, indicating the maximum size for the array)
would represent a best-practice for finding out-of-bound accesses or
identifying wrongly-sized arrays passed in the function.

Signed-off-by: Francesco Giancane <francesco.giancane@accenture.com>
2021-07-02 11:47:38 -07:00
hatem.maalla 4e65fb0907 fix unit test fail 2021-06-30 04:49:25 +01:00
hatem.maalla 54c387b1cc fix memory leak 2021-06-25 15:02:03 +01:00
Hatem Maalla 010576d74e take in account review pull request remark 2021-06-22 17:04:11 +01:00
Hatem Maalla 7ab493cbb6 Fail to upload long Blob using mbedtls+compact(Issue #1995) 2021-06-17 18:10:33 +01:00
Pierrick Arsenault ff06a49746
Fix HTTPAPIEX_ExecuteRequest failing with HTTPAPI_REQUEST_HEAD (#528)
The HTTPAPI_REQUEST_TYPE enum is defined using the MU_DEFINE_ENUM
macro, which implicitely adds HTTPAPI_REQUEST_TYPE_INVALID as the first
value. This makes checking the validity of requestType with MU_COUNT_ARG
incorrect: HTTPAPI_REQUEST_TYPE_INVALID is accepted and
HTTPAPI_REQUEST_HEAD is rejected.

Unit tests:
- Change all uses of HTTPAPI_REQUEST_PATCH (the previous last value in the
  enum) to HTTPAPI_REQUEST_HEAD (the current last value in the enum) to test
  that it is accepted.
- Change HTTPAPIEX_ExecuteRequest_fails_with_invalid_request_type to use
  a request type outside of the enum.
- Add HTTPAPIEX_ExecuteRequest_fails_with_invalid_request_type_2, which
  explicitely tests that HTTPAPIEX_INVALID_ARG is rejected.

Co-authored-by: Pierrick Arsenault <pierrick.arsenault@stello.ca>
Co-authored-by: Eric Wolz <ericwol@microsoft.com>
2021-05-11 11:22:04 -07:00
ewertons fb2c745c3e
Merge pull request #533 from Azure/ewertons/fixoptionscrash2
Fix websocket xio options clonning
2021-05-11 08:25:42 -07:00
Ewerton Scaboro da Silva 307af34c3b Fix remaining tlsio adapters against underlying options crash 2021-05-11 06:35:23 +00:00
Ewerton Scaboro da Silva 890a8ad8f4 Fix websocket xio options clonning 2021-05-10 17:17:53 -07:00
Eric Wolz 545646f453
Fix uuid memcpy length (#532) 2021-05-10 15:04:51 -07:00
Fanzhe Lyu 97db881593
[Azure Sphere] Add UUID adapter layer for Azure Sphere (#519) 2021-05-10 14:22:18 -07:00
maallahatem 74094f9b83
Add support of tls renegotiation option (#521)
Co-authored-by: hatem.maalla <hatem.maalla@non.se.com>
2021-05-10 08:46:14 -07:00
ewertons 43d0d9edef
Merge pull request #529 from Azure/ewertons/optionscrashfix
Fix for crash in case AddOptionInternal fails adding xio CONCRETE_OPTIONS
2021-05-07 15:41:47 -07:00
ewertons 9beea5fe80
Merge branch 'master' into ewertons/optionscrashfix 2021-05-07 15:35:30 -07:00
Ewerton Scaboro da Silva 12260df4eb Fix xio_ut for changes done in xio (crash with AddOption failure) 2021-05-07 15:34:39 -07:00
Dane Walton ead467b2ee
update install location of cutility headers (#531) 2021-05-07 11:21:25 -07:00
Ewerton Scaboro da Silva 93f02cbc8c [ACR] Fix for crash in case AddOptionInternal fails adding xio CONCRETE_OPTIONS 2021-05-06 15:30:14 -07:00
Ewerton Scaboro da Silva c97d59ad33 Fix for crash in case AddOptionInternal fails adding xio CONCRETE_OPTIONS
This crash occurs for the following callstack:

==31911== Invalid read of size 8
==31911==    at 0x144C04: DestroyInternal (optionhandler.c:111)
==31911==    by 0x14517F: OptionHandler_Destroy (optionhandler.c:278)
==31911==    by 0x144958: xio_retrieveoptions (xio.c:288)
==31911==    by 0x140395: tlsio_openssl_retrieveoptions (tlsio_openssl.c:335)
==31911==    by 0x14488B: xio_retrieveoptions (xio.c:276)
==31911==    by 0x14F12C: ResetConnectionIfNecessary (iothubtransport_mqtt_common.c:1977)
==31911==    by 0x15074B: UpdateMqttConnectionStateIfNeeded (iothubtransport_mqtt_common.c:2585)
==31911==    by 0x15290C: IoTHubTransport_MQTT_Common_DoWork (iothubtransport_mqtt_common.c:3474)
==31911==    by 0x14AD63: IoTHubTransportMqtt_DoWork (iothubtransportmqtt.c:121)
==31911==    by 0x11DD46: IoTHubClientCore_LL_DoWork (iothub_client_core_ll.c:2123)
==31911==    by 0x128F92: ScheduleWork_Thread (iothub_client_core.c:813)
==31911==    by 0x1397D0: ThreadWrapper (threadapi_pthreads.c:35)
==31911==  Address 0x6097008 is 24 bytes inside a block of size 32 free'd
==31911==    at 0x48369AB: free (vg_replace_malloc.c:530)
==31911==    by 0x144C98: DestroyInternal (optionhandler.c:123)
==31911==    by 0x14517F: OptionHandler_Destroy (optionhandler.c:278)
==31911==    by 0x14473A: xio_DestroyOption (xio.c:246)
==31911==    by 0x144BD0: AddOptionInternal (optionhandler.c:91)
==31911==    by 0x144FA6: OptionHandler_AddOption (optionhandler.c:219)
==31911==    by 0x144907: xio_retrieveoptions (xio.c:285)
==31911==    by 0x140395: tlsio_openssl_retrieveoptions (tlsio_openssl.c:335)
==31911==    by 0x14488B: xio_retrieveoptions (xio.c:276)
==31911==    by 0x14F12C: ResetConnectionIfNecessary (iothubtransport_mqtt_common.c:1977)
==31911==    by 0x15074B: UpdateMqttConnectionStateIfNeeded (iothubtransport_mqtt_common.c:2585)
==31911==    by 0x15290C: IoTHubTransport_MQTT_Common_DoWork (iothubtransport_mqtt_common.c:3474)
==31911==  Block was alloc'd at
==31911==    at 0x483577F: malloc (vg_replace_malloc.c:299)
==31911==    by 0x144990: CreateInternal (optionhandler.c:28)
==31911==    by 0x144D37: OptionHandler_Create (optionhandler.c:142)
==31911==    by 0x14543E: socketio_retrieveoptions (socketio_berkeley.c:178)
==31911==    by 0x14488B: xio_retrieveoptions (xio.c:276)
==31911==    by 0x140395: tlsio_openssl_retrieveoptions (tlsio_openssl.c:335)
==31911==    by 0x14488B: xio_retrieveoptions (xio.c:276)
==31911==    by 0x14F12C: ResetConnectionIfNecessary (iothubtransport_mqtt_common.c:1977)
==31911==    by 0x15074B: UpdateMqttConnectionStateIfNeeded (iothubtransport_mqtt_common.c:2585)
==31911==    by 0x15290C: IoTHubTransport_MQTT_Common_DoWork (iothubtransport_mqtt_common.c:3474)
==31911==    by 0x14AD63: IoTHubTransportMqtt_DoWork (iothubtransportmqtt.c:121)
==31911==    by 0x11DD46: IoTHubClientCore_LL_DoWork (iothub_client_core_ll.c:2123)
2021-05-06 11:50:44 -07:00
Darren b6a92c4ceb
Minor fix to root README.md (#523) 2021-05-03 12:19:04 -07:00
Eric Wolz b9fe252e09
clang static code analyzer issues (#527) 2021-05-03 10:34:26 -07:00
Eric Wolz 341c40b8ce
Added framework for running longhaul tests under valgrind (#524)
* enable valgrind on longhaul tests

* enable both valgrind and helgrind

* fixed set_tests_properties

* added valgrind drd

* fixed _exe tag

* fixed locks error message to info message

* added gen-suppressions

* remove helgrind

* disable the valgrind longhaul runs

* reverting "Locks already initialized"
2021-04-20 17:14:17 -07:00
Cristian Pop f223f909db
OpenSSL IP Address SAN validation support (#522)
* Adding OpenSSL validation for SANs containing IP addresses.

* Adding WolfSSL init call and debug logging (requires WolfSSL debug build)

* Fixing WolfSSL UT

* Adding wolfssl UT

* Logic bug fix.

* Adding WolfSSL version check, verifying return values.

* Only enable logging if the option is set to true.

* Adding WolfSSL version check for UTs.
2021-04-08 11:33:52 -07:00
rajaggrawal 51555845f4
fileupload through specific network interface (#516)
* fileupload through specific network interface

* changed the name of option as per existing naming convention

* updated error log

* added error logs CURLOPT_INTERFACE

Co-authored-by: Aggrawal, Raj Kumar <rajkumar.aggrawal@barco.com>
Co-authored-by: ewertons <ewertons@microsoft.com>
2021-03-25 14:00:57 -06:00
ewertons 6f528467af
Merge pull request #518 from Azure/LogLockResult
Log the results of pthread Lock and Unlock in case of error
2021-03-24 15:37:37 -07:00
Ewerton Scaboro da Silva 8f0fe2babb Log the results of pthread Lock and Unlock in case of error 2021-03-24 14:26:10 -07:00
Eric Wolz 071f479548
fix memory leak in win32 socketio (#515)
* fix memory leak in win32 socketio
2021-03-18 11:45:00 -07:00
John Spaith 98c734c212
Add deprecation messages (#514)
Deprecate httpapi.h for applications to invoke directly into (though it's fine to build adapters against it since httpapiex.h does right things when apps use httpapiex layer).
2021-03-12 20:44:57 -07:00
Eric Wolz fe841e6e67
Do not set tcp_socket_connection NULL when the socket is closed (#511)
* Do not set tcp_socket_connection NULL when the socket is closed

Co-authored-by: Mollie Munoz <mollie.munoz@microsoft.com>
2021-02-08 17:38:11 -08:00
Dane Walton b38adefd7d
fix printing data not in buffer (#509) 2021-02-04 11:06:38 -08:00
Mollie Munoz 45e22d6343
Proxy use-case fixed for wolfSSL (#504) 2021-02-04 10:16:11 -08:00
Mollie Munoz 0d084016f7
ARM update (#507)
Co-authored-by: Mollie Munoz <momuno@microsoft.com>
2021-02-04 09:42:28 -08:00