Skip to content

Commit 1b8d82d

Browse files
committed
Manually merge PR179 to fix a regression in PR171 to get automatic filling of pubkey+cert fingerprints in MiGserver.conf functional again. We recommend checking out the new automation using fingerprint files with update bound to certificate renewal in the migcheckssl cron job instead now, but this should make the default static fill work again. Please refer to the comments in migrid issue 167 for details on the current fingerprint possibilities.
git-svn-id: svn+ssh://svn.code.sf.net/p/migrid/code/trunk@6196 b75ad72c-e7d7-11dd-a971-7dbc132099af
1 parent d038562 commit 1b8d82d

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

mig/shared/install.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1958,13 +1958,13 @@ def _generate_confs_prepare(
19581958
raw_sha256 = force_native_str(openssl_proc.stdout.read()).strip()
19591959
# NOTE: openssl outputs something like 'SHA256 Fingerprint=BLA'
19601960
# but algo part case may vary - split and take last part.
1961-
daemon_keycert_sha256 = raw_sha256.split(" Fingerprint=", 1)[-1]
1961+
cur_keycert_sha256 = raw_sha256.split(" Fingerprint=", 1)[-1]
19621962
except Exception as exc:
19631963
print("ERROR: failed to extract sha256 fingerprint of %s: %s" %
19641964
(key_path, exc))
1965-
daemon_keycert_sha256 = ''
1965+
cur_keycert_sha256 = ''
19661966
if daemon_keycert_sha256 == keyword_auto:
1967-
user_dict['__DAEMON_KEYCERT_SHA256__'] = daemon_keycert_sha256
1967+
user_dict['__DAEMON_KEYCERT_SHA256__'] = cur_keycert_sha256
19681968
if user_dict['__DAEMON_PUBKEY__']:
19691969
if not os.path.isfile(os.path.expanduser("%(__DAEMON_PUBKEY__)s" %
19701970
user_dict)):
@@ -1988,21 +1988,21 @@ def _generate_confs_prepare(
19881988
b64_key = base64.b64decode(pubkey.strip().split()[1])
19891989
raw_md5 = make_simple_hash(b64_key)
19901990
# reformat into colon-spearated octets
1991-
daemon_pubkey_md5 = ':'.join(a + b for a, b in zip(raw_md5[::2],
1992-
raw_md5[1::2]))
1991+
cur_pubkey_md5 = ':'.join(a + b for a, b in zip(raw_md5[::2],
1992+
raw_md5[1::2]))
19931993
raw_sha256 = make_safe_hash(b64_key, False)
19941994
# NOTE: b64encode takes bytes and returns bytes
1995-
daemon_pubkey_sha256 = force_native_str(
1995+
cur_pubkey_sha256 = force_native_str(
19961996
base64.b64encode(raw_sha256)).rstrip('=')
19971997
except Exception as exc:
19981998
print("ERROR: failed to extract fingerprints of %s : %s" %
19991999
(pubkey_path, exc))
2000-
daemon_pubkey_md5 = ''
2001-
daemon_pubkey_sha256 = ''
2000+
cur_pubkey_md5 = ''
2001+
cur_pubkey_sha256 = ''
20022002
if daemon_pubkey_md5 == keyword_auto:
2003-
user_dict['__DAEMON_PUBKEY_MD5__'] = daemon_pubkey_md5
2003+
user_dict['__DAEMON_PUBKEY_MD5__'] = cur_pubkey_md5
20042004
if daemon_pubkey_sha256 == keyword_auto:
2005-
user_dict['__DAEMON_PUBKEY_SHA256__'] = daemon_pubkey_sha256
2005+
user_dict['__DAEMON_PUBKEY_SHA256__'] = cur_pubkey_sha256
20062006

20072007
# Enable Debian/Ubuntu specific lines only there
20082008
if user_dict['__DISTRO__'].lower() in ('ubuntu', 'debian'):

0 commit comments

Comments
 (0)