|
@@ -12,6 +12,10 @@ import (
|
|
|
)
|
|
|
|
|
|
func decryptMsgWithHost(host *models.Host, msg []byte) ([]byte, error) {
|
|
|
+ if host.OS == models.OS_Types.IoT { // just pass along IoT messages
|
|
|
+ return msg, nil
|
|
|
+ }
|
|
|
+
|
|
|
trafficKey, trafficErr := logic.RetrievePrivateTrafficKey() // get server private key
|
|
|
if trafficErr != nil {
|
|
|
return nil, trafficErr
|
|
@@ -41,6 +45,10 @@ func decryptMsg(node *models.Node, msg []byte) ([]byte, error) {
|
|
|
}
|
|
|
|
|
|
func encryptMsg(host *models.Host, msg []byte) ([]byte, error) {
|
|
|
+ if host.OS == models.OS_Types.IoT {
|
|
|
+ return msg, nil
|
|
|
+ }
|
|
|
+
|
|
|
// fetch server public key to be certain hasn't changed in transit
|
|
|
trafficKey, trafficErr := logic.RetrievePrivateTrafficKey()
|
|
|
if trafficErr != nil {
|