View | Details | Raw Unified | Return to bug 44518 | Differences between
and this patch

Collapse All | Expand All

(-)debian/changelog (+7 lines)
 Lines 1-3    Link Here 
1
univention-ad-connector (11.0.6-8) UNRELEASED; urgency=medium
2
3
  * Bug #44518: Generate a strong password which fulfill the password
4
    complexity settings (Backport of Bug #34478)
5
6
 -- Arvid Requate <requate@univention.de>  Thu, 04 May 2017 14:10:53 +0200
7
1
univention-ad-connector (11.0.6-7) unstable; urgency=low
8
univention-ad-connector (11.0.6-7) unstable; urgency=low
2
9
3
  * Bug #43470: Handle UCRV */autostart through systemd
10
  * Bug #43470: Handle UCRV */autostart through systemd
(-)modules/univention/connector/__init__.py (-1 / +18 lines)
 Lines 75-85    Link Here 
75
	return mlValue
75
	return mlValue
76
76
77
77
78
password_charsets = [
79
	'abcdefghijklmnopqrstuvwxyz',
80
	'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
81
	'0123456789',
82
	'^!\$%&/()=?{[]}+~#-_.:,;<>|\\',
83
]
84
85
86
def generate_strong_password(length=24):
87
	pwd = []
88
	charset = random.choice(password_charsets)
89
	while len(pwd) < length:
90
		pwd.append(random.choice(charset))
91
		charset = random.choice(list(set(password_charsets) - set([charset])))
92
	return "".join(pwd)
93
94
78
def set_ucs_passwd_user(connector, key, ucs_object):
95
def set_ucs_passwd_user(connector, key, ucs_object):
79
	'''
96
	'''
80
	set random password to fulfill required values
97
	set random password to fulfill required values
81
	'''
98
	'''
82
	ucs_object['password'] = str(int(random.random() * 100000000)) * 20  # at least 20 characters
99
	ucs_object['password'] = generate_strong_password()
83
100
84
101
85
def check_ucs_lastname_user(connector, key, ucs_object):
102
def check_ucs_lastname_user(connector, key, ucs_object):

Return to bug 44518