-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add support for secure upgrade #11862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
41665e5
5848e45
b3fdcb4
e11fb1d
56c9fa6
f44a67b
02d126a
ea214ef
1de4175
19c4118
510c792
94baacf
e00f384
5860989
5b438b5
af9d766
25bfd26
4afa067
b0236db
3b0d157
7447541
18d1e13
f43f02d
7faa74c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -208,6 +208,14 @@ SONIC_ENABLE_IMAGE_SIGNATURE ?= n | |
| # The absolute path should be provided. | ||
| SONIC_ENABLE_SECUREBOOT_SIGNATURE ?= n | ||
|
|
||
| # following flags are used for image secure upgrade verification: | ||
| # SECURE_UPGRADE_DEV_SIGNING_KEY - path to development signing key, used for image signing during build | ||
| # SECURE_UPGRADE_DEV_SIGNING_CERT - path to development signing certificate, used for image signing during build | ||
| # SECURE_UPGRADE_MODE - enum value for secure upgrade mode, valid options are "dev", "prod" and "no_sign" | ||
| #SECURE_UPGRADE_DEV_SIGNING_KEY = | ||
| #SECURE_UPGRADE_DEV_SIGNING_CERT = | ||
| SECURE_UPGRADE_MODE = "no_sign" | ||
|
Comment on lines
+214
to
+232
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we only give two options: sign, no_sign? The dev or prod is depended on what kinds of certificates users used, and we can provide a script to generate all dev certificates. We may be not necessary to provide some options only for DEV. Suggest change as below: Do we need to distinguish the UPGRADE/NONE-UPGRADE certificate? The signed image can be used for both fresh installation or upgrade, right?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This mechanism is part of the feature architecture, as described in its HLD. Doing as your suggestion will change our architecture and we prefer not to do so in this stage. There is a serious demand from our costumers, to allow production signing with their own signing mechanisms. If someone wants to use the current flags they can take the DEV_SIGNING flags and assign it to a different variable or flag. |
||
|
|
||
| # PACKAGE_URL_PREFIX - the package url prefix | ||
| PACKAGE_URL_PREFIX ?= https://packages.trafficmanager.net/public/packages | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| sign_image_dev() | ||
ycoheNvidia marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| { | ||
| cert_file=$1 | ||
| key_file=$2 | ||
| image_to_sign=$3 | ||
| cms_sig_out=$4 | ||
| openssl cms -sign -nosmimecap -signer ${cert_file} -inkey ${key_file} -binary -in $image_to_sign -outform pem -out ${cms_sig_out} || { | ||
| echo "$?: CMS sign error" | ||
| sudo rm -rf ${cms_sig_out} | ||
| exit 1 | ||
| } | ||
| echo "CMS sign OK" | ||
ycoheNvidia marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| return 0 | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.