mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Allow PKCS#12 files with empty password in install tools.
https://fedorahosted.org/freeipa/ticket/3897
This commit is contained in:
committed by
Petr Viktorin
parent
c123264ac7
commit
194556beb0
@@ -274,11 +274,11 @@ def parse_options():
|
||||
"PKCS#12 options are used.")
|
||||
|
||||
if options.unattended:
|
||||
if options.dirsrv_pkcs12 and not options.dirsrv_pin:
|
||||
if options.dirsrv_pkcs12 and options.dirsrv_pin is None:
|
||||
parser.error("You must specify --dirsrv_pin with --dirsrv_pkcs12")
|
||||
if options.http_pkcs12 and not options.http_pin:
|
||||
if options.http_pkcs12 and options.http_pin is None:
|
||||
parser.error("You must specify --http_pin with --http_pkcs12")
|
||||
if options.pkinit_pkcs12 and not options.pkinit_pin:
|
||||
if options.pkinit_pkcs12 and options.pkinit_pin is None:
|
||||
parser.error("You must specify --pkinit_pin with --pkinit_pkcs12")
|
||||
|
||||
if options.dirsrv_pkcs12 and not options.root_ca_file:
|
||||
@@ -876,7 +876,7 @@ def main():
|
||||
ca_file = options.root_ca_file
|
||||
|
||||
if options.http_pkcs12:
|
||||
if not options.http_pin:
|
||||
if options.http_pin is None:
|
||||
options.http_pin = installutils.read_password(
|
||||
"Enter %s unlock" % options.http_pkcs12,
|
||||
confirm=False, validate=False)
|
||||
@@ -887,7 +887,7 @@ def main():
|
||||
http_pkcs12_info, ca_file, host_name)
|
||||
|
||||
if options.dirsrv_pkcs12:
|
||||
if not options.dirsrv_pin:
|
||||
if options.dirsrv_pin is None:
|
||||
options.dirsrv_pin = installutils.read_password(
|
||||
"Enter %s unlock" % options.dirsrv_pkcs12,
|
||||
confirm=False, validate=False)
|
||||
@@ -898,7 +898,7 @@ def main():
|
||||
dirsrv_pkcs12_info, ca_file, host_name)
|
||||
|
||||
if options.pkinit_pkcs12:
|
||||
if not options.pkinit_pin:
|
||||
if options.pkinit_pin is None:
|
||||
options.pkinit_pin = installutils.read_password(
|
||||
"Enter %s unlock" % options.pkinit_pkcs12,
|
||||
confirm=False, validate=False)
|
||||
|
||||
@@ -209,7 +209,7 @@ class ReplicaPrepare(admintool.AdminTool):
|
||||
raise admintool.ScriptError("Invalid reverse zone")
|
||||
|
||||
if options.http_pkcs12:
|
||||
if not options.http_pin:
|
||||
if options.http_pin is None:
|
||||
options.http_pin = installutils.read_password(
|
||||
"Enter %s unlock" % options.http_pkcs12,
|
||||
confirm=False, validate=False)
|
||||
@@ -219,7 +219,7 @@ class ReplicaPrepare(admintool.AdminTool):
|
||||
self.check_pkcs12(options.http_pkcs12, options.http_pin)
|
||||
|
||||
if options.dirsrv_pkcs12:
|
||||
if not options.dirsrv_pin:
|
||||
if options.dirsrv_pin is None:
|
||||
options.dirsrv_pin = installutils.read_password(
|
||||
"Enter %s unlock" % options.dirsrv_pkcs12,
|
||||
confirm=False, validate=False)
|
||||
@@ -229,7 +229,7 @@ class ReplicaPrepare(admintool.AdminTool):
|
||||
self.check_pkcs12(options.dirsrv_pkcs12, options.dirsrv_pin)
|
||||
|
||||
if options.pkinit_pkcs12:
|
||||
if not options.pkinit_pin:
|
||||
if options.pkinit_pin is None:
|
||||
options.pkinit_pin = installutils.read_password(
|
||||
"Enter %s unlock" % options.pkinit_pkcs12,
|
||||
confirm=False, validate=False)
|
||||
@@ -239,7 +239,7 @@ class ReplicaPrepare(admintool.AdminTool):
|
||||
|
||||
if (not ipautil.file_exists(
|
||||
dogtag.configured_constants().CS_CFG_PATH) and
|
||||
not options.dirsrv_pin):
|
||||
options.dirsrv_pin is None):
|
||||
self.log.info("If you installed IPA with your own certificates "
|
||||
"using PKCS#12 files you must provide PKCS#12 files for any "
|
||||
"replicas you create as well.")
|
||||
|
||||
@@ -87,7 +87,7 @@ class ServerCertInstall(admintool.AdminTool):
|
||||
raise admintool.ScriptError(
|
||||
"Directory Manager password required")
|
||||
|
||||
if not self.options.pin:
|
||||
if self.options.pin is None:
|
||||
self.options.pin = installutils.read_password(
|
||||
"Enter %s unlock" % self.args[0], confirm=False, validate=False)
|
||||
if self.options.pin is None:
|
||||
|
||||
Reference in New Issue
Block a user