Commit Graph

1149 Commits

Author SHA1 Message Date
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
d5f039ec7c Add TLS engine and keyform support to mosquitto
Add same OpenSSL engine support to mosquitto (server side) previously added to
client side only.

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
098a1c8ecf Fix subscribe_multiple datatypes. 2018-11-13 14:05:03 +00:00
Roger A. Light
353990e856 Tidy up test directory. 2018-11-13 12:14:28 +00:00
Roger A. Light
beb96c6b8b Merge branch 'master' into develop 2018-11-11 21:41:44 +00:00
Roger A. Light
8960b1fe29 Update 1.5 docker image. 2018-11-08 21:14:09 +00:00
Roger A. Light
b2fda04e1c Update website for 1.5.4. 2018-11-08 21:13:24 +00:00
Roger A. Light
265a3dd0b1 Merge branch 'fixes' 2018-11-08 14:52:06 +00:00
Roger A. Light
e81db23ce4 Bump version number. 2018-11-08 12:12:27 +00:00
Roger A. Light
b54e379fba Fix websockets listeners not verifying client certs.
When using a TLS enabled websockets listener with "require_certificate"
enabled, the mosquitto broker does not correctly verify client certificates.
This is now fixed. All other security measures operate as expected, and in
particular non-websockets listeners are not affected by this. Closes #996.

Thanks to creising.
2018-11-08 12:10:28 +00:00
Roger A. Light
71b8c4d892 Fix TLS connections when using an external event loop.
Affects the use of mosquitto_loop_read() and mosquitto_write().
Closes #990.
2018-11-07 21:08:10 +00:00
Roger A. Light
b803b40a22 Update changelog. 2018-11-07 18:32:17 +00:00
Roger A. Light
ba67e1ffe5 Don't use gnu-specific strerror_r. 2018-11-07 18:27:15 +00:00
Roger A. Light
34c752a0d0 Give better error message if a client sends a password without a username.
Closes #1015. Thanks to TabascoEye.
2018-11-07 17:29:39 +00:00
Roger A. Light
9f7577aab6 $SYS/broker/clients/disconnected should never be negative.
Closes #287. Thanks to Lovisa Johansson.

Bug: https://github.com/eclipse/mosquitto/issues/287
2018-11-07 17:23:43 +00:00
Roger A. Light
feb303a919 Fix whitespace in Dockerfile. 2018-11-07 14:34:43 +00:00
Roger A. Light
1582117147 Build own libwebsockets in Docker image. 2018-11-07 14:34:43 +00:00
Iblis Lin
0368a8c01d add socket headers for FreeBSD
Signed-off-by: Iblis Lin <iblis@hs.ntnu.edu.tw>
2018-11-07 10:28:26 +00:00
Roger A. Light
d7bcec4878 Don't disconnect clients when a plugin denies SUBSCRIBE.
Thanks to Ibrahim Koujar.

Bug: https://github.com/eclipse/mosquitto/issues/1016
2018-11-07 10:06:32 +00:00
Abilio Marques
a4a5236568 fix bug where bridge doesn't honor restart_timeout setting
Signed-off-by: Abilio Marques <abiliojr@gmail.com>
2018-11-06 23:28:40 +00:00
Bernd Kuhls
80f3bc4812 _GNU_SOURCE needed for EAI_INPROGRESS
Define of _GNU_SOURCE is needed to be able to use EAI_INPROGRESS in
loop.c.

This patch fixes a build error

loop.c:334:17: error: ‘EAI_INPROGRESS’ undeclared (first use in this function)
        if(rc == EAI_INPROGRESS){

occuring with a glibc-2.27-based buildroot toolchain for sparc64

Target: sparc64-buildroot-linux-gnu
[...]
gcc version 6.4.0 (Buildroot 2018.05)

Source:
http://autobuild.buildroot.org/toolchains/tarballs/br-sparc64-full-2018.05.tar.bz2
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
2018-11-06 23:16:29 +00:00
Bartosz Taczała
e86b27a2da Adding support for QNX7.0.0
Change-Id: Id01e2880aa5cadc0e93a46b95fe675e1938051fa
Signed-off-by: Bartosz Taczała <bartosz.taczala@mobica.com>
2018-11-06 23:11:09 +00:00
Roger A. Light
eff8fab1b4 Only process network errors for clients that have nothing to read.
Closes #7.
2018-11-06 23:02:33 +00:00
Roger A. Light
c26892244c Test x509 generation script requires no interaction now. 2018-11-06 23:02:33 +00:00
Roger A. Light
93f9e965a8 Only remove context from hash if there is a client id.
This should never happen, but just in case.
2018-11-06 23:01:06 +00:00
Roger A. Light
da2879c33b Docker fixes.
- Don't remove apk database, closes #1011.
- Install mosquitto_passwd, closes #1009.
2018-11-03 08:57:06 +00:00
Roger A. Light
d5aaeee1fb Use https for all downloads. 2018-10-29 16:27:04 +00:00
Roger A. Light
1853bfc678 Docker fixes as per review.
https://github.com/docker-library/official-images/pull/4987#issuecomment-433570818

Revert to stderr logging.
Use wget instead of curl.
Don't redownload libuuid or libwebsockets.
2018-10-27 08:14:57 +01:00
Roger A. Light
26e5766182 Docker volume/mount point fixes per review.
https://github.com/docker-library/official-images/pull/4987#issuecomment-433185843
2018-10-26 07:31:44 +01:00
Roger A. Light
064d94581c Remove renamed files, fix readme. 2018-10-26 07:31:22 +01:00
Roger A. Light
d60b9d4e5d Rewrite docker files for 1.5 support.
Builds from source.
Carries out security checks on downloads.
2018-10-24 17:00:15 +01:00
majekw
7f1419e4de Fix mosquitto_pub -l if compiled using cmake.
Since dde005ef92 mosquito_pub is throwing error
that 'threading support has not been compiled' when compiled using cmake.
It looks like WITH_THREADING flag is not set at top level Makefile and used
only in lib/ directory, so library is correctly compiled with threading.
But for client this flag is undefined, so it gives error on '-l' option.

This commit moves part related to WITH_THREADING flag out of lib/CMakeLists.txt
to top levele CMakeLists.txt, so it could be accessible to all subdirectories.

Signed-off-by: Marek Wodzinski <majek@w7i.pl>
2018-10-23 18:56:00 +01:00
Jonathan Hanson
976edc6165 Add a new dockerfile and associated files, to build from a source tarball, instead of installing a built and published Alpine APK package.
Signed-off-by: Jonathan Hanson <jonathan@jonathan-hanson.org>
2018-10-23 14:45:30 +01:00
Roger A. Light
0a9ee5b4cf Fix memory leak when reconnecting with TLS errors.
Fix memory leak that occurred if mosquitto_reconnect() was used when TLS
errors were present.

Closes #592. Thanks to smartdabao and aaronovz1.
2018-10-23 10:46:55 +01:00
Roger A. Light
35dea07dcd Merge branch 'master' 2018-10-23 10:39:20 +01:00
Roger A. Light
e5eb03b2e6 Allow building without shared library. 2018-10-07 00:56:42 +01:00
Roger A. Light
07d59d20e2 Add missing line. 2018-10-03 08:11:46 +01:00
Roger A. Light
f6c19b773a Bump snap version. 2018-10-02 23:58:11 +01:00
Roger A. Light
1690f760e4 Add header files to snap. 2018-10-02 23:56:19 +01:00
Roger A. Light
3be1badef0 Include mosquitto_passwd in snap. 2018-10-02 23:54:24 +01:00
Roger A. Light
1867f30785 Merge branch 'master'
Conflicts:
	ChangeLog.txt
2018-10-02 08:31:54 +01:00
Vinod Kumar
e492a61cd8 return MOSQ_ERR_INVAL if config has invalid boolean value
Signed-off-by: Vinod Kumar <kumar003vinod@gmail.com>
2018-09-29 07:51:12 +01:00
Vinod Kumar
5898cc9aee update links for signing ECA, fix indentation
Signed-off-by: Vinod Kumar <kumar003vinod@gmail.com>
2018-09-29 07:49:20 +01:00
Roger A. Light
0e76bed50e Add -E option to mosquitto_sub.
This causes the client to exit immediately after its subscriptions are
acknowledged by the broker, and can be used to create a durable client
session without requiring messages to be delivered.

Closes #952.
2018-09-27 22:21:42 +01:00
Roger A. Light
8b66a323cd Add mosquitto_subscribe_multiple()
For sending subscriptions to multiple topics in one command.
2018-09-27 22:06:54 +01:00
Roger A. Light
cf9a72d8db Add mosquitto_subscribe_multiple. 2018-09-27 22:05:15 +01:00
Roger A. Light
46b943b077 Add website post and update downloads/security. 2018-09-27 10:48:03 +01:00
Roger A. Light
1684feabe9 Merge branch 'fixes' 2018-09-25 16:26:49 +01:00
Roger A. Light
c78003cacf Bump version number, add CVE details. 2018-09-25 16:26:28 +01:00