diff options
| author | Stanislav Laznicka <slaznick@redhat.com> | 2016-12-06 09:05:42 +0100 |
|---|---|---|
| committer | Martin Basti <mbasti@redhat.com> | 2017-01-06 09:26:56 +0100 |
| commit | 8db5b277a079fdfe5efbd7d49311f14489cee0e8 (patch) | |
| tree | e70fd61ab3bb90151ebc6d05761cf8f8d50ac9e7 /ipaserver/install/httpinstance.py | |
| parent | be7865bf4f9b6774a17f31380e96b76d0473f982 (diff) | |
| download | freeipa-8db5b277a079fdfe5efbd7d49311f14489cee0e8.tar.gz freeipa-8db5b277a079fdfe5efbd7d49311f14489cee0e8.tar.xz freeipa-8db5b277a079fdfe5efbd7d49311f14489cee0e8.zip | |
Unify password generation across FreeIPA
Also had to recalculate entropy of the passwords as originally,
probability of generating each character was 1/256, however the
default probability of each character in the ipa_generate_password
is 1/95 (1/94 for first and last character).
https://fedorahosted.org/freeipa/ticket/5695
Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: Petr Spacek <pspacek@redhat.com>
Diffstat (limited to 'ipaserver/install/httpinstance.py')
| -rw-r--r-- | ipaserver/install/httpinstance.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/ipaserver/install/httpinstance.py b/ipaserver/install/httpinstance.py index b7ce857ed..e8c706e7a 100644 --- a/ipaserver/install/httpinstance.py +++ b/ipaserver/install/httpinstance.py @@ -19,7 +19,6 @@ from __future__ import print_function -import binascii import os import os.path import pwd @@ -314,9 +313,9 @@ class HTTPInstance(service.Service): ipautil.backup_file(nss_path) # Create the password file for this db - hex_str = binascii.hexlify(os.urandom(10)) + password = ipautil.ipa_generate_password(pwd_len=15) f = os.open(pwd_file, os.O_CREAT | os.O_RDWR) - os.write(f, hex_str) + os.write(f, password) os.close(f) ipautil.run([paths.CERTUTIL, "-d", database, "-f", pwd_file, "-N"]) |
