Commit 38c0d67d authored by Helga Velroyen's avatar Helga Velroyen

Noded: make "bootstrap" a constant

Noded uses the constant "bootstrap" when starting
without client certificates. This patch moves the
constant to Constants.hs.
Signed-off-by: default avatarHelga Velroyen <helgav@google.com>
Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
parent 8195f50d
......@@ -1266,7 +1266,6 @@ def SSLVerifyPeer(conn, cert, errnum, errdepth, ok):
"""
# some parameters are unused, but this is the API
# pylint: disable=W0613
_BOOTSTRAP = "bootstrap"
sstore = ssconf.SimpleStore()
try:
candidate_certs = sstore.GetMasterCandidatesCertMap()
......@@ -1276,7 +1275,7 @@ def SSLVerifyPeer(conn, cert, errnum, errdepth, ok):
candidate_certs = None
if not candidate_certs:
candidate_certs = {
_BOOTSTRAP: utils.GetCertificateDigest(
constants.CRYPTO_BOOTSTRAP: utils.GetCertificateDigest(
cert_filename=pathutils.NODED_CERT_FILE)}
return cert.digest("sha1") in candidate_certs.values()
# pylint: enable=W0613
......
......@@ -4385,6 +4385,11 @@ cryptoActionGet = "get"
cryptoActions :: FrozenSet String
cryptoActions = ConstantUtils.mkSet [cryptoActionGet]
-- Key word for master candidate cert list for bootstrapping.
cryptoBootstrap :: String
cryptoBootstrap = "bootstrap"
-- * Options for CryptoActions
-- Filename of the certificate
......
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