Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into edge
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasbardino committed Jan 20, 2025
2 parents 1b571ea + 89ab9fb commit 097ec12
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions mig/shared/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -1953,13 +1953,13 @@ def _generate_confs_prepare(
raw_sha256 = openssl_proc.stdout.read().strip()
# NOTE: openssl outputs something like 'SHA256 Fingerprint=BLA'
# but algo part case may vary - split and take last part.
daemon_keycert_sha256 = raw_sha256.split(" Fingerprint=", 1)[-1]
cur_keycert_sha256 = raw_sha256.split(" Fingerprint=", 1)[-1]
except Exception as exc:
print("ERROR: failed to extract sha256 fingerprint of %s: %s" %
(key_path, exc))
daemon_keycert_sha256 = ''
cur_keycert_sha256 = ''
if daemon_keycert_sha256 == keyword_auto:
user_dict['__DAEMON_KEYCERT_SHA256__'] = daemon_keycert_sha256
user_dict['__DAEMON_KEYCERT_SHA256__'] = cur_keycert_sha256
if user_dict['__DAEMON_PUBKEY__']:
if not os.path.isfile(os.path.expanduser("%(__DAEMON_PUBKEY__)s" %
user_dict)):
Expand All @@ -1983,19 +1983,19 @@ def _generate_confs_prepare(
pubkey.strip().split()[1].encode('ascii'))
raw_md5 = make_simple_hash(b64_key)
# reformat into colon-spearated octets
daemon_pubkey_md5 = ':'.join(a + b for a, b in zip(raw_md5[::2],
raw_md5[1::2]))
cur_pubkey_md5 = ':'.join(a + b for a, b in zip(raw_md5[::2],
raw_md5[1::2]))
raw_sha256 = make_safe_hash(b64_key, False)
daemon_pubkey_sha256 = base64.b64encode(raw_sha256).rstrip('=')
cur_pubkey_sha256 = base64.b64encode(raw_sha256).rstrip('=')
except Exception as exc:
print("ERROR: failed to extract fingerprints of %s : %s" %
(pubkey_path, exc))
daemon_pubkey_md5 = ''
daemon_pubkey_sha256 = ''
cur_pubkey_md5 = ''
cur_pubkey_sha256 = ''
if daemon_pubkey_md5 == keyword_auto:
user_dict['__DAEMON_PUBKEY_MD5__'] = daemon_pubkey_md5
user_dict['__DAEMON_PUBKEY_MD5__'] = cur_pubkey_md5
if daemon_pubkey_sha256 == keyword_auto:
user_dict['__DAEMON_PUBKEY_SHA256__'] = daemon_pubkey_sha256
user_dict['__DAEMON_PUBKEY_SHA256__'] = cur_pubkey_sha256

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

0 comments on commit 097ec12

Please sign in to comment.