Compare commits

...
1 Commits
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ func PackageMQTTMessage(configuration *Configuration, msg Message) ([]byte, erro
// At the moment we don't do the encryption part, but we'll implement it
// once the legacy methods (subscriptions are moved).
msg.Encrypted = false
if configuration.Config.Encryption.Enabled {
if configuration.Config.Encryption != nil && configuration.Config.Encryption.Enabled {
msg.Encrypted = true
}
msg.PublicKey = ""
+1 -1
View File
@@ -168,7 +168,7 @@ func MQTTListenerHandler(mqttClient mqtt.Client, hubKey string, configDirectory
// Messages might be encrypted, if so we'll
// need to decrypt them.
var payload models.Payload
if message.Encrypted {
if message.Encrypted && configuration.Config.Encryption != nil && configuration.Config.Encryption.Enabled {
encryptedValue := message.Payload.EncryptedValue
if len(encryptedValue) > 0 {
symmetricKey := configuration.Config.Encryption.SymmetricKey