Commit Graph

41 Commits (99833795f21b73f7f0ba58c47e04aa2d7ceaaaa0)

Author SHA1 Message Date
Christian Beier fe10226cc9 Fix building with Visual Studio 2008
This older Microsoft compiler does not support mixing declarations and
code and misses some error defines. This commit enables building with
VS2008 by moving up some variable declarations and defining error
codes to their WinSock counterparts in case they're not defined.

Signed-off-by: Christian Beier <info@christianbeier.net>
5 years ago
Roger A. Light a4389fc9ce Fix SPDX identifiers: EDL-1.0 -> BSD-3-Clause.
The two licenses are the same.
5 years ago
Roger Light c604cf8fd0 net__write buf should be const. 5 years ago
Roger A. Light 3731535298 Add SPDX license identifiers. 5 years ago
Roger A. Light 584cf51ba7 Update to EPL-2.0 5 years ago
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.
5 years ago
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.
5 years ago
Abilio Marques d5aae3eca7 lazy init SSL
Signed-off-by: Abilio Marques <abiliojr@gmail.com>
5 years ago
Roger A. Light b0a065f790 Update changelog. Release page. Bump copyright. 6 years ago
Roger A. Light 81641df043 Expose net__print_ssl_error() prototype. 6 years ago
Roger A. Light 76865707b2 Guard ssize_t definition on Windows.
Closes #522. Thanks to trinytron.
6 years ago
Roger A. Light ea046c2405 Merge branch 'master' of git://github.com/LarsVoelker/mosquitto into LarsVoelker-master 7 years ago
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
7 years ago
Roger A. Light 2dd24449ad Fix "unused parameter" warnings. 7 years ago
Roger A. Light ce31269e05 Update changelog, bump version, bump copyright year. 7 years ago
Roger A. Light 5aabc171b0 Merge branch 'mqtt5' into develop 7 years ago
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>
7 years ago
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>
7 years ago
Roger A. Light e8320cbf19 Fix TLS connections not working over SOCKS.
Thanks to Mark Oeltjenbruns.
7 years ago
Roger A. Light 4ccc68d2df Revert incorrect change. 7 years ago
Roger A. Light 9d30625622 Build fix for Windows. 7 years ago
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>
7 years ago
Roger A. Light f4d238be18 Bump copyright years. 8 years ago
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>
8 years ago
Roger A. Light 91b308a11d Merge branch 'master' into develop 9 years ago
Roger A. Light e0e8cc9f3e [344] Fix leaks and incorrect connect call. 9 years ago
Roger A. Light e13af18ed9 Start of fix for [344]. 9 years ago
Roger A. Light 8378fe44cf Update copyrights. 9 years ago
Roger A. Light 556c629ab5 Don't use reserved names in header guards.
Closes #3.
10 years ago
Roger A. Light 9a2eb2038f Drop Windows XP support, misc fixes on Windows. 10 years ago
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
10 years ago
Roger A. Light 4195fde70b Last raft of renames for the moment. 11 years ago
Roger A. Light b598aec385 Sys -> user includes. 11 years ago
Roger A. Light 970ba58da6 Code reorganise. 11 years ago
Roger A. Light 11756d24c8 Change internal funcs _foo_bar() to foo__bar(). 11 years ago
Roger A. Light dacee786be [463000] Use own type to simplify socket handling.
Means that SOCKET is used as the socket type everywhere on Windows.
11 years ago
Roger A. Light 39ffd6fa36 Handle "error" codes from SSL_connect() correctly. 11 years ago
Roger A. Light 041f60c03e Make bridge connections non-blocking for TLS connections. 11 years ago
Roger A. Light a1f18323d1 Make bridge connections non-blocking for non-TLS connections. 11 years ago
Roger A. Light 764b7e0a91 Use hash functions to store client data. 11 years ago
Roger Light 0364bd1be7 Initial contribution. 12 years ago