-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Sample program demo scripts #2698
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
Draft
gilles-peskine-arm
wants to merge
22
commits into
Mbed-TLS:development
Choose a base branch
from
gilles-peskine-arm:sample_program_demo_scripts-development
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Sample program demo scripts #2698
gilles-peskine-arm
wants to merge
22
commits into
Mbed-TLS:development
from
gilles-peskine-arm:sample_program_demo_scripts-development
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c094063 to
5704d27
Compare
Merged
4 tasks
bcdc838 to
c37aeaa
Compare
c37aeaa to
4d8fff8
Compare
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
The programs are usable as long as the requisite parts of X509 are included in the build. This can mean ECDSA but no RSA, and it can mean no bignum if asymmetric cryptography is provided by an alternate implementation that doesn't use bignum. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
4d8fff8 to
037d0b8
Compare
037d0b8 to
e73f07a
Compare
run_demos.py is the frontend to a framework for smoke-testing the
sample programs. It runs scripts called programs/*/*_demo.sh
("demo scripts") and check that they succeed. A typical demo script
runs one sample program or a combination of sample programs to
demonstrate their usage.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Show how to create a self-signed certificate. Show how to create a certificate signing request and create the corresponding certificate. Use OpenSSL if available to show the certificate contents, because we don't have a tool to do that. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Only executable programs should have the execution permission. If a file has an extension that makes it potentially executable, check whether it has a shebang line. Only files with a shebang line should be executable. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
The new file programs/demo_common.sh contains initialization code, utility functions and cleanup code meant to be used by all demo scripts written in sh. Initial features: * msg: Display a message. * run, run_bad: Run a command, visibly. * $root_dir, $programs_dir: location of the mbedtls source tree. * $files_to_clean: files that are cleaned up on exit. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Demo scripts should declare their build-time dependencies, to make them more user-friendly. If a dependency is not met, users should see an explicit message rather than an incomprehensible error. Don't rely on the dependencies of individual programs because some demo scripts use multiple programs and because some scripts might have additional requirements. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This was referenced Nov 24, 2021
Merged
Contributor
|
Note: when this is revived, programs added in the meantime will need to be included. See for example #5435 |
Contributor
|
As part of our review of historical PRs we have made the decision to convert older PRs that have not been updated in 3 months into drafts until they are worked on again. |
3 tasks
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
component-platform
Portability layer and build scripts
enhancement
historical-reviewed
Reviewed & agreed to keep legacy PR/issue
needs-work
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Kickstart a framework for demo scripts for sample programs. This has two goals: to show how to use the sample programs (for some, it isn't clear what arguments to pass or how to use them in sequence), and to run the programs on the CI.
This pull request is being split into 3 parts:
check_files.py— the functionality got in via Python upscale: pass mypy and create library directory #3953, but it needs some adaptation in Run sample program demo scripts in all.sh #7982.programs/x509/cert_write_demo.sh— TODOThere is already a demo script
programs/psa/key_ladder_demo.shand this PR adds a second one. I wrote a third one in #2472. This PR also adds instructions to run the demo scripts in a few components ofall.sh.The number of functions used potentially by all demo scripts was growing quickly so I split out some shared functions into a common script
programs/demo_common.sh.Non-goals:
Needs backports: maybe. It would be better, to keep the testing similar across supported branches.