• Tuong Lien's avatar
    tipc: add automatic rekeying for encryption key · 23700da2
    Tuong Lien authored
    Rekeying is required for security since a key is less secure when using
    for a long time. Also, key will be detached when its nonce value (or
    seqno ...) is exhausted. We now make the rekeying process automatic and
    configurable by user.
    
    Basically, TIPC will at a specific interval generate a new key by using
    the kernel 'Random Number Generator' cipher, then attach it as the node
    TX key and securely distribute to others in the cluster as RX keys (-
    the key exchange). The automatic key switching will then take over, and
    make the new key active shortly. Afterwards, the traffic from this node
    will be encrypted with the new session key. The same can happen in peer
    nodes but not necessarily at the same time.
    
    For simplicity, the automatically generated key will be initiated as a
    per node key. It is not too hard to also support a cluster key rekeying
    (e.g. a given node will generate a unique cluster key and update to the
    others in the cluster...), but that doesn't bring much benefit, while a
    per-node key is even more secure.
    
    We also enable user to force a rekeying or change the rekeying interval
    via netlink, the new 'set key' command option: 'TIPC_NLA_NODE_REKEYING'
    is added for these purposes as follows:
    - A value >= 1 will be set as the rekeying interval (in minutes);
    - A value of 0 will disable the rekeying;
    - A value of 'TIPC_REKEYING_NOW' (~0) will force an immediate rekeying;
    
    The default rekeying interval is (60 * 24) minutes i.e. done every day.
    There isn't any restriction for the value but user shouldn't set it too
    small or too large which results in an "ineffective" rekeying (thats ok
    for testing though).
    Acked-by: default avatarJon Maloy <jmaloy@redhat.com>
    Signed-off-by: default avatarTuong Lien <tuong.t.lien@dektech.com.au>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    23700da2
node.c 77.1 KB