forked from wolfSSL/wolfssl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request wolfSSL#7994 from miyazakh/renesas_ra6m4_update
Update FSP version to v5.4.0 for RA6M4
- Loading branch information
Showing
10 changed files
with
210 additions
and
71 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Create/Update Signed CA | ||
This document describes how to create/update Signed CA data that is used at an example program. | ||
|
||
## Signed CA Creatation | ||
### Generate RSA Key pair | ||
``` | ||
2048 bit RSA key pair | ||
$ openssl genrsa 2048 2> /dev/null > rsa_private.pem | ||
$ openssl rsa -in rsa_private.pem -pubout -out rsa_public.pem 2> /dev/null | ||
``` | ||
|
||
### Sign to CA certificate | ||
``` | ||
Signed by 2048-bit RSA | ||
$ openssl dgst -sha256 -sign rsa_private.pem -sigopt rsa_padding_mode:pss -sigopt rsa_pss_saltlen:-1-out <signed-CA>.sign <CA-file-for-Signed> | ||
For an example program, it assumes that wolfSSL example CA cert is to be signed. | ||
e.g. | ||
$ openssl dgst -sha256 -sign rsa_private.pem -sigopt rsa_padding_mode:pss -sigopt rsa_pss_saltlen:-1-out Signed-CA.sign /path/for/wolfssl/certs/ca-cert.der | ||
``` | ||
|
||
### Convert Signed CA to C source | ||
It is able to use `dertoc.pl` to generate c-source data from signed-ca binary data. | ||
|
||
``` | ||
$ /path/to/wolfssl/scripts/dertoc.pl ./ca-cert.der.sign ca_cert_der_sig example.c | ||
``` | ||
|
||
|
||
## Appendix | ||
### Example Keys | ||
There are multiple example keys for testing in the `example_keys` folder. | ||
``` | ||
<example_keys> | ||
| | ||
+----+ rsa_private.pem an example 2048-bit rsa private key for signing CA cert | ||
+ rsa_public.pem an example 2048-bit rsa public key for verifying CA cert | ||
+ generate_signCA.sh an example script to genearte signed-certificate data for the example program | ||
``` |
44 changes: 44 additions & 0 deletions
44
IDE/Renesas/e2studio/RA6M4/tools/example_keys/generate_SignedCA.sh
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/bash | ||
|
||
# example usage | ||
# ./generate_SignedCA.sh rsa_private.pem rsa_public.pem ../../../../../../../wolfssl/certs/ca-cert.der ../../../../../../../wolfssl | ||
# ./generate_SignedCA.sh rsa_private.pem rsa_public.pem ../../../../../../../wolfssl/certs/ca-ecc-cert.der ../../../../../../../wolfssl | ||
# | ||
SIGOPT=rsa_padding_mode:pss | ||
SIGOPT2=rsa_pss_saltlen:-1 | ||
CURRENT=$(cd $(dirname $0);pwd) | ||
|
||
function usage() { | ||
cat <<- _EOT_ | ||
Usage: | ||
$0 private-key public-key file-name wolfssl-dir | ||
Options: | ||
private-key : private key for sign/verify | ||
public-key : public key for verify | ||
file-name : file name to be signed | ||
wolfssl-dir : wolfssl folder path | ||
_EOT_ | ||
exit 1 | ||
} | ||
|
||
if [ $# -ne 4 ]; then | ||
usage | ||
fi | ||
|
||
# $1 private key for sign/verify | ||
# $2 public key for verify | ||
# $3 file for sign/verify | ||
signed_file=$(basename $3) | ||
wolf_dir=$4 | ||
|
||
openssl dgst -sha256 -sign $1 -sigopt $SIGOPT -sigopt $SIGOPT2 -out ${CURRENT}/${signed_file}.sign $3 | ||
|
||
echo Verify by private key | ||
openssl dgst -sha256 -prverify $1 -sigopt $SIGOPT -sigopt $SIGOPT2 -signature ${CURRENT}/${signed_file}.sign $3 | ||
echo Verifiy by public key | ||
openssl dgst -sha256 -verify $2 -sigopt $SIGOPT -sigopt $SIGOPT2 -signature ${CURRENT}/${signed_file}.sign $3 | ||
|
||
# Convert Signed CA to c source | ||
${wolf_dir}/scripts/dertoc.pl ${CURRENT}/${signed_file}.sign XXXXXXX ${signed_file}.c |
27 changes: 27 additions & 0 deletions
27
IDE/Renesas/e2studio/RA6M4/tools/example_keys/rsa_private.pem
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
-----BEGIN RSA PRIVATE KEY----- | ||
MIIEpAIBAAKCAQEA1m5BL7AjTKZidSHuz0dvqKWrhY3/eD5swV8FBe2y6L1u2ulR | ||
FAmyHUmMnmy3YMIx+Zhi+Qc4Ra27t/3/ffFhTBwx2Snr5oqryxfB2rj1+Cc6kDQL | ||
aUIVY1z2y9s9E4NJIQAzSlzQ5e7oGiXH3cLjOTlEI8xKDGLJEhah58Lh18am4Dqp | ||
DilrkL+p0H+HQJPC6eJs3urEn7ueeqQaKCv1OOsrmQfeCfkjxSqbyrR/+F5VV4H6 | ||
PjyXHCW0lbNhxSmF9wVK8+t4DRARU5ONoECY7dIkPMqFHdzGdRmOrfEsGl++wjPH | ||
CvvUOLJ7/Pt0h6c7yazZngt1kqKYmKWJR7+FLQIDAQABAoIBAQCdfIqJwL6cPBNR | ||
3eMr/1ZlsY+A3mKD6K0tdGEXEpX007RIOVXf9qMHWY5aiJRCDz5vB1mhdokAu/GD | ||
15u+3vpL0OVXjq+AOdakqcUpo/CbGgyr/l1nKC7XNF7aKCH6Y9Dg2OnSssqGJWn4 | ||
UkkxeUIzM/j0pcS4xhDRJSgyNHJ0a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+0GYd8KZCgxITcE0SccsNl6yROBquA/pQ== | ||
-----END RSA PRIVATE KEY----- |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
-----BEGIN PUBLIC KEY----- | ||
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1m5BL7AjTKZidSHuz0dv | ||
qKWrhY3/eD5swV8FBe2y6L1u2ulRFAmyHUmMnmy3YMIx+Zhi+Qc4Ra27t/3/ffFh | ||
TBwx2Snr5oqryxfB2rj1+Cc6kDQLaUIVY1z2y9s9E4NJIQAzSlzQ5e7oGiXH3cLj | ||
OTlEI8xKDGLJEhah58Lh18am4DqpDilrkL+p0H+HQJPC6eJs3urEn7ueeqQaKCv1 | ||
OOsrmQfeCfkjxSqbyrR/+F5VV4H6PjyXHCW0lbNhxSmF9wVK8+t4DRARU5ONoECY | ||
7dIkPMqFHdzGdRmOrfEsGl++wjPHCvvUOLJ7/Pt0h6c7yazZngt1kqKYmKWJR7+F | ||
LQIDAQAB | ||
-----END PUBLIC KEY----- |
Oops, something went wrong.