Commit 2899d9de authored by Iustin Pop's avatar Iustin Pop
Browse files

Enable the use of shared secrets

This patch enables the use of the shared secrets for DRBD8 disks, using
(hardcoded in constants.py) the md5 digest algorithm.

For making this more flexible, either we implement a cluster parameter
(once the new model is in place), or we can make it ./configure-time
selectable.

Reviewed-by: imsnah
parent f9518d38
......@@ -1253,7 +1253,9 @@ class DRBD8(BaseDRBD):
res_r = self._AssembleNet(minor,
(self._lhost, self._lport,
self._rhost, self._rport),
"C")
"C", hmac=constants.DRBD_HMAC_ALG,
secret=self._secret
)
if res_r:
if self._MatchesNet(self._GetDevInfo(self._GetShowData(minor))):
break
......@@ -1281,7 +1283,9 @@ class DRBD8(BaseDRBD):
# local storage (i.e. one or more of the _[lr](host|port) is
# None)
if (self._AssembleNet(minor, (self._lhost, self._lport,
self._rhost, self._rport), "C") and
self._rhost, self._rport), "C",
hmac=constants.DRBD_HMAC_ALG,
secret=self._secret) and
self._MatchesNet(self._GetDevInfo(self._GetShowData(minor)))):
break
......@@ -1333,7 +1337,8 @@ class DRBD8(BaseDRBD):
result = self._AssembleNet(minor,
(self._lhost, self._lport,
self._rhost, self._rport),
"C")
"C", hmac=constants.DRBD_HMAC_ALG,
secret=self._secret)
if not result:
if need_localdev_teardown:
# we will ignore failures from this
......
......@@ -176,6 +176,9 @@ LD_LV = "lvm"
LD_DRBD8 = "drbd8"
LD_FILE = "file"
# drbd constants
DRBD_HMAC_ALG = "md5"
# file backend driver
FD_LOOP = "loop"
FD_BLKTAP = "blktap"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment