Commit Graph

37 Commits

Author SHA1 Message Date
Roger A. Light
584cf51ba7 Update to EPL-2.0 2020-11-25 17:34:21 +00:00
Roger A. Light
b816d46508 Use db as a global var instead of passing to functions.
This allows a big swath of ifdefs to be removed. It also means savings as the db var is not passed around all of the time, and makes it easier to remove the final broker call to mosquitto_time() call in packet_mosq.c. In one test this reduced the calls to mosquitto_time() from 295k to 48k.
2020-11-06 17:16:23 +00:00
Roger A. Light
88b5daee66 Try very hard not to produce "Socket error" message.
This happens when an unhandled error occurs on a socket/read write. The
message is confusing to people.
2020-10-27 10:04:22 +00:00
Abilio Marques
d5aae3eca7 lazy init SSL
Signed-off-by: Abilio Marques <abiliojr@gmail.com>
2020-07-23 17:48:56 +02:00
Roger A. Light
b0a065f790 Update changelog. Release page. Bump copyright. 2020-02-27 23:26:58 +00:00
Roger A. Light
81641df043 Expose net__print_ssl_error() prototype. 2020-01-30 15:14:52 +00:00
Roger A. Light
76865707b2 Guard ssize_t definition on Windows.
Closes #522. Thanks to trinytron.
2019-09-04 17:41:50 +01:00
Roger A. Light
ea046c2405 Merge branch 'master' of git://github.com/LarsVoelker/mosquitto into LarsVoelker-master 2019-03-26 18:36:13 +00:00
Roger A. Light
320ddc1303 Merge branch 'master'
Conflicts:
	CMakeLists.txt
	ChangeLog.txt
	client/Makefile
	config.mk
	installer/mosquitto.nsi
	installer/mosquitto64.nsi
	lib/mosquitto.h
	lib/mqtt3_protocol.h
	lib/util_mosq.c
	set-version.sh
	snap/snapcraft.yaml
	src/bridge.c
	src/database.c
	src/handle_connack.c
	src/loop.c
	src/persist.c
	test/broker/Makefile
2019-03-16 10:05:38 +00:00
Roger A. Light
2dd24449ad Fix "unused parameter" warnings. 2019-03-13 14:46:05 +00:00
Roger A. Light
ce31269e05 Update changelog, bump version, bump copyright year. 2019-02-28 16:56:15 +00:00
Roger A. Light
5aabc171b0 Merge branch 'mqtt5' into develop 2019-02-26 18:51:31 +00:00
Nicolás Pernas Maradei
20894fcbce Add engine private key password support
Some OpenSSL engines (selectable via tls_engine option) may require a
password to make use of private keys created with them in the first place.

The TPM engine for example, will require a password to access the underlying
TPM's Storage Root Key (SRK), which is the root key of a hierarchy of keys
associated with a TPM; it is generated within a TPM and is a non-migratable
key. Each owned TPM contains a SRK, generated by the TPM at the request
of the Owner. [1]

By default, the engine will prompt the user to introduce the SRK password
before any private keys created with the engine can be used. This could
be inconvenient when running on an unattended system.

Here's where the new tls_engine_kpass_sha option comes in handy. The user
can specify a SHA1 hash of its engine private key password via command
line or config file and it will be passed on to the engine directly.

This commit adds support for both clients (libmosquitto) and broker.

[1] https://goo.gl/qQoXBY

Signed-off-by: Nicolás Pernas Maradei <nicopernas@gmail.com>
2019-02-26 15:50:37 +00:00
Nicolás Pernas Maradei
f88cc06435 Add TLS engine and keyform support to libmosquitto
- Clients can now offload crypto tasks to an external crypto device through
  the OpenSSL ENGINE API.
- The keyfiles can now be treated as PEM or ENGINE keys.
- Two new functions were added to libmosquitto to set up the previously
  mentioned features.
- Both mosquitto_sub and mosquitto_pub include support to turn on the mentioned
  features through command line options.

Signed-off-by: Nicolás Pernas Maradei <nicopernas@gmail.com>
2019-02-26 15:48:00 +00:00
Roger A. Light
e8320cbf19 Fix TLS connections not working over SOCKS.
Thanks to Mark Oeltjenbruns.
2019-02-08 13:01:07 +00:00
Roger A. Light
4ccc68d2df Revert incorrect change. 2018-08-16 11:33:06 +01:00
Roger A. Light
9d30625622 Build fix for Windows. 2018-08-16 11:16:16 +01:00
Roger A. Light
e185d18917 Better fix for #851.
Ensure all sockets that are closed are set to INVALID_SOCKET.

Signed-off-by: Roger A. Light <roger@atchoo.org>
2018-08-08 15:23:03 +01:00
Roger A. Light
f4d238be18 Bump copyright years. 2018-04-11 15:24:29 +01:00
Dr. Lars Voelker
74adb43cc1 Adding OCSP Stapling support to mosquitto
Adding OCSP Stapling support to mosquitto, so that the TLS client side
requests the certificate status and checks it.
This code uses the OpenSSL-based OCSP implementation and is somewhat
based on the libcurl code for OCSP stapling.

Signed-off-by: Dr. Lars Voelker <lars.voelker@bmw.de>
2017-07-07 13:05:17 +02:00
Roger A. Light
91b308a11d Merge branch 'master' into develop 2017-03-06 21:19:53 +00:00
Roger A. Light
e0e8cc9f3e [344] Fix leaks and incorrect connect call. 2017-02-20 23:48:30 +00:00
Roger A. Light
e13af18ed9 Start of fix for [344]. 2017-02-20 23:48:30 +00:00
Roger A. Light
8378fe44cf Update copyrights. 2016-07-08 09:42:24 +01:00
Roger A. Light
556c629ab5 Don't use reserved names in header guards.
Closes #3.
2016-03-13 18:43:13 +00:00
Roger A. Light
9a2eb2038f Drop Windows XP support, misc fixes on Windows. 2015-09-22 10:03:57 +01:00
Roger Light
e2324ff9bb Merge remote-tracking branch 'remotes/origin/master' into develop
Conflicts:
	CMakeLists.txt
	ChangeLog.txt
	THANKS.txt
	appveyor.yml
	config.mk
	installer/mosquitto-cygwin.nsi
	installer/mosquitto.nsi
	lib/messages_mosq.c
	lib/messages_mosq.h
	lib/mosquitto.c
	lib/mosquitto.h
	lib/net_mosq.c
	lib/net_mosq.h
	lib/send_client_mosq.c
	lib/send_mosq.c
	lib/socks_mosq.c
	lib/will_mosq.c
	src/bridge.c
	src/conf.c
	src/context.c
	src/database.c
	src/loop.c
	src/mosquitto.c
	src/mosquitto_broker.h
	src/net.c
	src/read_handle.c
	src/read_handle_server.c
	src/subs.c
2015-09-09 22:02:46 +01:00
Roger A. Light
4195fde70b Last raft of renames for the moment. 2015-05-18 09:29:22 +01:00
Roger A. Light
b598aec385 Sys -> user includes. 2015-04-29 21:37:47 +01:00
Roger A. Light
970ba58da6 Code reorganise. 2015-04-29 21:23:59 +01:00
Roger A. Light
11756d24c8 Change internal funcs _foo_bar() to foo__bar(). 2015-04-19 22:10:59 +01:00
Roger A. Light
dacee786be [463000] Use own type to simplify socket handling.
Means that SOCKET is used as the socket type everywhere on Windows.
2015-03-29 10:43:08 +01:00
Roger A. Light
39ffd6fa36 Handle "error" codes from SSL_connect() correctly. 2015-01-27 23:33:36 +00:00
Roger A. Light
041f60c03e Make bridge connections non-blocking for TLS connections. 2014-10-24 22:39:09 +01:00
Roger A. Light
a1f18323d1 Make bridge connections non-blocking for non-TLS connections. 2014-10-24 21:28:24 +01:00
Roger A. Light
764b7e0a91 Use hash functions to store client data. 2014-06-23 17:57:35 +01:00
Roger Light
0364bd1be7 Initial contribution. 2014-05-07 23:27:00 +01:00