mirror of
https://github.com/gravitl/netmaker.git
synced 2025-09-28 16:07:02 +08:00
added compatibility with 0.10.0 clients
This commit is contained in:
parent
96e17c9b17
commit
d9e6338912
1 changed files with 9 additions and 0 deletions
|
@ -2,6 +2,7 @@ package mq
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/gravitl/netmaker/logic"
|
||||
"github.com/gravitl/netmaker/models"
|
||||
|
@ -26,6 +27,10 @@ func decryptMsg(node *models.Node, msg []byte) ([]byte, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
if strings.Contains(node.Version, "0.10.0") {
|
||||
return ncutils.BoxDecrypt(msg, nodePubTKey, serverPrivTKey)
|
||||
}
|
||||
|
||||
return ncutils.DeChunk(msg, nodePubTKey, serverPrivTKey)
|
||||
}
|
||||
|
||||
|
@ -46,6 +51,10 @@ func encryptMsg(node *models.Node, msg []byte) ([]byte, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
if strings.Contains(node.Version, "0.10.0") {
|
||||
return ncutils.BoxEncrypt(msg, nodePubKey, serverPrivKey)
|
||||
}
|
||||
|
||||
return ncutils.Chunk(msg, nodePubKey, serverPrivKey)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue