Skip to content

Commit e98011f

Browse files
authored
Revert "Secure upgrade (#2337)" (#2675)
This reverts commit 6fe8599.
1 parent eda4e91 commit e98011f

12 files changed

+2
-408
lines changed

scripts/verify_image_sign.sh

-75
This file was deleted.

scripts/verify_image_sign_common.sh

-34
This file was deleted.

setup.py

-2
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,6 @@
154154
'scripts/memory_threshold_check_handler.py',
155155
'scripts/techsupport_cleanup.py',
156156
'scripts/storm_control.py',
157-
'scripts/verify_image_sign.sh',
158-
'scripts/verify_image_sign_common.sh',
159157
'scripts/check_db_integrity.py',
160158
'scripts/sysreadyshow'
161159
],

sonic_installer/bootloader/grub.py

-11
Original file line numberDiff line numberDiff line change
@@ -153,17 +153,6 @@ def verify_image_platform(self, image_path):
153153
# Check if platform is inside image's target platforms
154154
return self.platform_in_platforms_asic(platform, image_path)
155155

156-
def verify_image_sign(self, image_path):
157-
click.echo('Verifying image signature')
158-
verification_script_name = 'verify_image_sign.sh'
159-
script_path = os.path.join('/usr', 'local', 'bin', verification_script_name)
160-
if not os.path.exists(script_path):
161-
click.echo("Unable to find verification script in path " + script_path)
162-
return False
163-
verification_result = subprocess.run([script_path, image_path], capture_output=True)
164-
click.echo(str(verification_result.stdout) + " " + str(verification_result.stderr))
165-
return verification_result.returncode == 0
166-
167156
@classmethod
168157
def detect(cls):
169158
return os.path.isfile(os.path.join(HOST_PATH, 'grub/grub.cfg'))

sonic_installer/main.py

+1-11
Original file line numberDiff line numberDiff line change
@@ -511,8 +511,7 @@ def sonic_installer():
511511
@click.option('-y', '--yes', is_flag=True, callback=abort_if_false,
512512
expose_value=False, prompt='New image will be installed, continue?')
513513
@click.option('-f', '--force', '--skip-secure-check', is_flag=True,
514-
help="Force installation of an image of a non-secure type than secure running " +
515-
" image, this flag does not affect secure upgrade image verification")
514+
help="Force installation of an image of a non-secure type than secure running image")
516515
@click.option('--skip-platform-check', is_flag=True,
517516
help="Force installation of an image of a type which is not of the same platform")
518517
@click.option('--skip_migration', is_flag=True,
@@ -577,14 +576,6 @@ def install(url, force, skip_platform_check=False, skip_migration=False, skip_pa
577576
"Aborting...", LOG_ERR)
578577
raise click.Abort()
579578

580-
# Calling verification script by default - signature will be checked if enabled in bios
581-
echo_and_log("Verifing image {} signature...".format(binary_image_version))
582-
if not bootloader.verify_image_sign(image_path):
583-
echo_and_log('Error: Failed verify image signature', LOG_ERR)
584-
raise click.Abort()
585-
else:
586-
echo_and_log('Verification successful')
587-
588579
echo_and_log("Installing image {} and setting it as default...".format(binary_image_version))
589580
with SWAPAllocator(not skip_setup_swap, swap_mem_size, total_mem_threshold, available_mem_threshold):
590581
bootloader.install_image(image_path)
@@ -967,6 +958,5 @@ def verify_next_image():
967958
sys.exit(1)
968959
click.echo('Image successfully verified')
969960

970-
971961
if __name__ == '__main__':
972962
sonic_installer()

tests/installer_bootloader_grub_test.py

-8
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,3 @@ def test_set_fips_grub():
5353

5454
# Cleanup the _tmp_host folder
5555
shutil.rmtree(tmp_host_path)
56-
57-
def test_verify_image():
58-
59-
bootloader = grub.GrubBootloader()
60-
image = f'{grub.IMAGE_PREFIX}expeliarmus-{grub.IMAGE_PREFIX}abcde'
61-
62-
# command should fail
63-
assert not bootloader.verify_image_sign(image)

tests/scripts/create_mock_image.sh

-40
This file was deleted.

tests/scripts/create_sign_and_verify_test_files.sh

-91
This file was deleted.

tests/scripts/verify_image_sign_test.sh

-29
This file was deleted.

0 commit comments

Comments
 (0)