From ba197376276e2a30a60f9ff79b7c07398b16d49b Mon Sep 17 00:00:00 2001 From: TakayukiMatsuo Date: Sat, 25 Jun 2022 00:56:47 +0900 Subject: [PATCH] Add support for TLS1.3 --- .../e2studio/RX65N/GR-ROSE/README_EN.md | 170 +- .../e2studio/RX65N/GR-ROSE/README_JP.md | 157 +- .../RX65N/GR-ROSE/common/user_settings.h | 16 +- .../RX65N/GR-ROSE/common/wolfssl_dummy.c | 7 +- .../e2studio/RX65N/GR-ROSE/test/.cproject | 2 - .../RX65N/GR-ROSE/test/src/key_data.c | 66 +- .../RX65N/GR-ROSE/test/src/key_data.h | 2 + .../RX65N/GR-ROSE/test/src/test_main.c | 24 +- .../RX65N/GR-ROSE/test/src/wolf_client.c | 76 +- .../e2studio/RX65N/GR-ROSE/test/test.rcpc | 179 +- ...ctionManualForExample_RSK+RX65N-2MB_EN.pdf | Bin 2726490 -> 2725917 bytes ...ctionManualForExample_RSK+RX65N-2MB_JP.pdf | Bin 2916938 -> 2907183 bytes .../RX65N/RSK/wolfssl_demo/key_data.c | 65 +- .../RX65N/RSK/wolfssl_demo/key_data.h | 2 + .../RX65N/RSK/wolfssl_demo/user_settings.h | 11 +- .../RX65N/RSK/wolfssl_demo/wolfssl_demo.c | 91 +- ...onManualForExample_RX72N_EnvisonKit_EN.pdf | Bin 1668019 -> 1653335 bytes ...onManualForExample_RX72N_EnvisonKit_JP.pdf | Bin 1932558 -> 1902457 bytes .../RX72N/EnvisionKit/wolfssl_demo/key_data.c | 63 +- .../RX72N/EnvisionKit/wolfssl_demo/key_data.h | 2 + .../EnvisionKit/wolfssl_demo/user_settings.h | 11 +- .../EnvisionKit/wolfssl_demo/wolfssl_demo.c | 90 +- src/internal.c | 8 + src/tls.c | 16 + src/tls13.c | 104 + wolfcrypt/src/port/Renesas/renesas_common.c | 49 +- wolfcrypt/src/port/Renesas/renesas_tsip_aes.c | 416 +++- wolfcrypt/src/port/Renesas/renesas_tsip_sha.c | 250 ++- .../src/port/Renesas/renesas_tsip_util.c | 1824 ++++++++++++++++- wolfssl/internal.h | 1 + .../port/Renesas/renesas-tsip-crypt.h | 225 +- wolfssl/wolfcrypt/port/Renesas/renesas_cmn.h | 11 + 32 files changed, 3657 insertions(+), 281 deletions(-) diff --git a/IDE/Renesas/e2studio/RX65N/GR-ROSE/README_EN.md b/IDE/Renesas/e2studio/RX65N/GR-ROSE/README_EN.md index e0694024b..143a41bad 100644 --- a/IDE/Renesas/e2studio/RX65N/GR-ROSE/README_EN.md +++ b/IDE/Renesas/e2studio/RX65N/GR-ROSE/README_EN.md @@ -31,7 +31,7 @@ This sample program uses the following hardware and software libraries. If a new |Device|R5F565NEHxFP| |IDE| Renesas e2Studio Version:2022-01 | |Emulator| E1, E2 Emulator Lite | -|Toolchain|CCRX v3.03.00| +|Toolchain|CCRX v3.04.00| |TSIP| TSIP v1.15|
@@ -58,7 +58,7 @@ Note) As of April 2022, TIPS v1.15 does not seem to be able to be added as a FIT There is no need to create a new sample program. Since the project file is already prepared, please import the project from the IDE by following the steps below. -+ e2studio "File" menu> "Open project from file system ..."> "Directory (R) ..." Click the import source button and select the folder from which the project will be imported. Select the folder (Renesas/e2studio/\/\/)) where this README file exists. ++ e2studio "File" menu> "Open project from file system ..."> "Directory (R) ..." Click the import source button and select the folder from which the project will be imported. Select the folder (Renesas/e2studio/{MCU}/{board-name-folder}) where this README file exists. + Four projects that can be imported are listed, but check only the three projects "smc", "test" and "wolfssl" and click the "Finish" button. You should see the **smc**, **test**, and **wolfssl** 3 projects you imported into the project explorer. @@ -71,7 +71,7 @@ You will need to get the required FIT modules yourself. Follow the steps below t 1. Open the smc project in Project Explorer and double-click the **smc.scfg** file to open the Smart Configurator Perspective. -2. Select the "Components" tab on the software component settings pane. Then click the "Add Component" button at the top right of the pane. The software component selection dialog will pop up. Click "Download the latest version of FIT driver and middleware" at the bottom of the dialog to get the modules. You can check the dowmload destination folder by pressing "Basic settings...". +2. Select the "Components" tab on the software component settings pane. Then click the "Add Component" button at the top right of the pane. The software component selection dialog will pop up. Click "Download the latest version of FIT driver and middleware" at the bottom of the dialog to get the modules. You can check the download destination folder by pressing "Basic settings...". 3. The latest version of the TSIP component may not be automatically obtained due to the delay in Renesas' support by the method in step 2 above. In that case, you can download it manually from the Renesas website. Unzip the downloaded component and store the files contained in the FIT Modules folder in the download destination folder of step 2. @@ -135,11 +135,84 @@ Now that the test application is ready to build. ## 8. Running test application as TLS_Client -----
-### 8.1 Generate a server application +### 8.1 TLS version supported by the test application + +
+If you use TSIP v1.15 or later, you can use the TLS1.3 protocol in addition to the existing TLS1.2. The following macro is defined to {board-name-folder}/common/user_settings.h. +

+ +``` +#define WOLFSSL_TLS13 +``` + +This definition sets it to use the TLS 1.3 protocol. If you use TLS1.2, comment out this macro definition and rebuild your test application. + +
+ +### 8.2 Type of certificates to use + +
+ +The test and server applications allow you to select the type of certificate (RootCA certificate, server certificate, client certificate) to use for TLS communication. You can select either an RSA certificate whose public key included in the certificate is an RSA public key or an ECDSA certificate containing an ECC public key. By default, the ECDSA certificate is used. +
+ +The following macro is defined to {board-name-folder}/common/user_settings.h by default. If you want to use the RSA certificates, comment out the above definition and rebuild the test application. + +
+ +``` +#define USE_ECC_CERT +``` +
+ +### 8.3 Cipher suites + +
+ +In the test application, the TLS version and certificate type determine the cipher suites used by the test application. The table below shows the cipher suites that can be used. +
+ +|Tls version |Certificate type|Cipher suites| +|:--|:--|:--| +|TLS1.3|RSA/ECDSA certificate| | +|||TLS_AES_128_GCM_SHA256| +|||TLS_AES_128_CCM_SHA256| +|TLS1.2|RSA certificate| +|||TLS_RSA_WITH_AES_128_CBC_SHA| +|||TLS_RSA_WITH_AES_256_CBC_SHA| +|||TLS_RSA_WITH_AES_128_CBC_SHA256| +|||TLS_RSA_WITH_AES_256_CBC_SHA256| +|||TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256| +|||TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256| +||ECDSA certificate|| +|||TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256| +|||TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256| + + +
+ +### 8.4 Build and run a server application + +
To operate as TLS_Client, an opposite application for TLS communication is required. A wolfSSL package provides a server sample application that you can use for this purpose. This program is generated by building wolfssl. You can build wolfSSL on Linux (including MacOS and WSL) with gcc installed or build using Visual Studio. The following introduces the build on WSL.

+Configuration options need to be changed depending on the certificate type used. + +#### 8.4.1 Configuration when using ECDSA certificates + +
+ +``` +$ cd {wolfssl-folder} +$ ./autogen.sh +$ ./configure --enable-ecc --enable-dsa --enable-aesccm CFLAGS="-DWOLFSSL_STATIC_RSA -DHAVE_AES_CBC -DHAVE_DSA -DHAVE_ALL_CURVES -DHAVE_ECC -DNO_RSA" +$ make +``` +Note: Do not forget to specify "-DNO_RSA" + + ``` $ cd $ ./autogen.sh @@ -158,20 +231,45 @@ $ examples/server/server -b -d -i ```
-For the test application, specify the IP address assigned to the server application. +#### 8.4.2 Configuration when using RSA certificates -Open wolf_client.c to specify ip address of the server in "#define SIMPLE_TLSSEVER_IP" like as:
``` --- /test/src/wolf_client.c -- +$ cd {wolfssl-folder} +$ ./autogen.sh +$ ./configure --enable-ecc --enable-dsa --enable-aesccm CFLAGS="-DWOLFSSL_STATIC_RSA -DHAVE_AES_CBC -DHAVE_DSA -DHAVE_ALL_CURVES -DHAVE_ECC" +$ make +``` +
+ +#### 8.4.3 Run the server application + +
+ +With the above build, {wolfssl-folder}/examples/server/server +is generated. This executable program acts as a server application. If you execute it with the following options, it will be in the standby state for connection from the test application. Specify "-v4" when using TLS1.3 as the TLS version to be used, and specify "-v3" when using TLS1.2. +

+ +``` +$ examples / server / server -b -v4 -i +``` + +
+For the test application, specify the IP address assigned to the server application. + +Open {board-name-folder}/test/src/wolf_client.c to specify ip address of the server. + +
+ +``` ... #define SIMPLE_TLSSEVER_IP 192.168.53.9 ... ```
-Save the file and rebuild the test application. When you run the test application, it makes a TLS connection with the opposite application, then exchanges a simple string and displays the following on the standard output. +Save the file and rebuild the test application. When you run the test application, it makes a TLS connection with the server application, then exchanges a simple string and displays the following on the standard output. The cipher suites displayed depends on the combination of TLS version and certificate type.

``` @@ -195,41 +293,7 @@ Received: I hear you fa shizzle! ```
-### 8.2 Change server certificate (change authentication method) -
-The above is an execution example when the server certificate presented by the server application contains the RSA public key (RSA authentication). TSIP can also handle cases where the server certificate contains an ECC public key (ECDSA authentication). -
-If you want to use a cipher suite that includes ECDSA, you will need to change the settings of the test application and rebuild. Open common/ user_settings.h, enable the USE_ECC_CERT definition and rebuild. -

- -``` --- /common/user_settings.h -- - -#define USE_ECC_CERT -``` -
-This definition causes the test application to use a RootCA certificate that can validate the server certificate containing the ECC public key presented by the server. - -
-In addition, the opposite server application also needs to specify the server certificate and private key file containing the ECC public key as an option, and then execute it as shown below. -

- -``` -$ ./examples/server/server -b -d -i -c ./certs/server-ecc.pem -k ./certs/ecc-key.pem -``` -
-The following is displayed as the execution result. -

- -``` -cipher : ECDHE-ECDSA-AES128-SHA256 -Received: I hear you fa shizzle! - -cipher : ECDHE-ECDSA-AES128-GCM-SHA256 -Received: I hear you fa shizzle! -``` -
## 9. What you need to do to use the RootCA certificate prepared by the user ---- @@ -240,4 +304,24 @@ If you want to use it for purposes beyond functional evaluation, you need to pre 2. RSA key pair required for RootCA certificate validation 3. The signature generated by the RootCA certificate with the private key in 2 above. -will become necessary. Please refer to the manual provided by Renesas for how to generate them. \ No newline at end of file +will become necessary. Please refer to the manual provided by Renesas for how to generate them. +
+ +## 10. Limitations +---- +
+wolfSSL, which supports TSIPv1.15, has the following functional restrictions. +

+ +1. Handshake message packets exchanged with the server during the TLS handshake are stored in plaintext in memory. This is used to calculate the hash of handshake messages. The content will be deleted at the end of the session. + +1. TLS1.2 does not support the client authentication function using TSIP. +Use wolfSSL_CTX_use_certificate_buffer or wolfSSL_CTX_use_certificate_chain_buffer_format to load the client certificate and wolfSSL_CTX_use_PrivateKey_buffer to load the private key. It is processed by software. + +1. In TLS 1.3, the client authentication function using TSIP is supported only for ECDSA client certificates. In the case of RSA certificates, it will be processed by software. + +1. In TLS1.3, among the server authentication functions using TSIP, "Certificate Verify" message is processed by software. + +1. Session resumption and early data using TSIP are not supported. + +The above limitations 1 through 4 are expected to be improved by TSIP from the next version onwards. \ No newline at end of file diff --git a/IDE/Renesas/e2studio/RX65N/GR-ROSE/README_JP.md b/IDE/Renesas/e2studio/RX65N/GR-ROSE/README_JP.md index 80292ccbc..099d4e342 100644 --- a/IDE/Renesas/e2studio/RX65N/GR-ROSE/README_JP.md +++ b/IDE/Renesas/e2studio/RX65N/GR-ROSE/README_JP.md @@ -32,7 +32,7 @@ Renesas社製MCU RX65Nを搭載した評価ボードGR-ROSEをターゲットと |Device|R5F565NEHxFP| |IDE| Renesas e2Studio Version:2022-01 | |エミュレーター| E1, E2エミュレーターLite | -|Toolchain|CCRX v3.03.00| +|Toolchain|CCRX v3.04.00| |TSIP| TSIP v1.15|
@@ -63,7 +63,7 @@ Renesas社製MCU RX65Nを搭載した評価ボードGR-ROSEをターゲットと サンプルプログラムは新規作成する必要はありません。すでにプロジェクトファイルが用意されていますからIDEから以下の手順でプロジェクトをインポートしてください。 -+ 1.e2studioの"ファイル"メニュー > "ファイル・システムからプロジェクトを開く..." > "ディレクトリ(R)..."インポート元ボタンを押して、プロジェクトのインポート元となるフォルダーを選択します。本READMEファイルが存在するフォルダ(Renesas/e2studio/\/\/))を選択してください。 ++ 1.e2studioの"ファイル"メニュー > "ファイル・システムからプロジェクトを開く..." > "ディレクトリ(R)..."インポート元ボタンを押して、プロジェクトのインポート元となるフォルダーを選択します。本READMEファイルが存在するフォルダ(Renesas/e2studio/{MCU}/{board-name-folder})を選択してください。 + インポートできるプロジェクトが4つリストアップされますが、"smc", "test" と"wolfssl"の3プロジェクトにのみチェックを入れて”終了”ボタンを押してください。 @@ -143,26 +143,110 @@ testアプリケーションのビルドの準備が整ったので、ビルド -----
-### 8.1 TLS対向アプリケーションの生成と実行 +### 8.1 testアプリケーションのサポートするTLSバージョン +
+TSIPv1.15以降を使用する場合には、これまでのTLS1.2に加えてTLS1.3プロトコルが使用できます。{board-name-folder}/common/user_settings.hに既定で以下のマクロ定義が設定されています。 +

+ +``` +#define WOLFSSL_TLS13 +``` +この定義によりTLS1.3プロトコルを使用する設定となります。TLS1.2を使用する場合には、このマクロ定義をコメントアウトしてして、testアプリケーションを再ビルドしてください。 + +
+ +### 8.2 使用する証明書のタイプ + +
+ +testアプリケーションとサーバーアプリケーションではTLS通信時に使用する証明書(RootCA証明書、サーバー証明書、クライアント証明書)のタイプが選択できます。証明書に含まれている公開鍵がRSA公開鍵であるRSA証明書とECC公開鍵を含むECDSA証明書が選択できます。既定ではECDSA証明書を使用するようになっています。 + +
+{board-name-folder}/common/user_settings.h に既定で以下のマクロ定義が設定されています。RSA証明書を使用する場合には上記定義をコメントアウトして、testアプリケーションを再ビルドしてください。 +

+ +``` +#define USE_ECC_CERT +``` + +
+この定義により、testアプリケーションはサーバーの提示するECC公開鍵を含んだサーバー証明書を検証できるRootCA証明書を使うようになります。また、クライアント認証に用いるクライアント証明書もECDSA証明書が使われます。 +

+ + +### 8.3 暗号化スイートの選択 + +
+testアプリケーションでは、TLSバージョンと証明書のタイプにより、testアプリケーションで使用する暗号化スイートを決定します。下表に使用できる暗号化スイートを示します。 + +
+ + +|バージョン|証明書|暗号化スイート| +|:--|:--|:--| +|TLS1.3|RSA/ECDSA証明書| | +|||TLS_AES_128_GCM_SHA256| +|||TLS_AES_128_CCM_SHA256| +|TLS1.2|RSA証明書| +|||TLS_RSA_WITH_AES_128_CBC_SHA| +|||TLS_RSA_WITH_AES_256_CBC_SHA| +|||TLS_RSA_WITH_AES_128_CBC_SHA256| +|||TLS_RSA_WITH_AES_256_CBC_SHA256| +|||TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256| +|||TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256| +||ECDSA証明書|| +|||TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256| +|||TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256| + + +
+ +### 8.4 TLS対向アプリケーションのビルドと実行 +
testアプリケーションをTLS_Clientとしての動作を行わせる場合には、TLS通信の相手方となる対向アプリケーションが必要となります。wolfSSLパッケージにはこの用途に使用できるTLSserverサンプルアプリケーションが用意されています。このプログラムはwolfsslをビルドすることで生成されます。wolfSSLのビルドにはgccがインストールされているLinux(MacOS, WSLも含む)でのビルドとVisualStudioを使ってのビルドが可能です。以下ではWSL上でのビルドを紹介します。

+コンフィギュレーションオプションは使用する証明書タイプによって変更する必要があります。 + +
+ +#### 8.4.1 ECDSA証明書を使用する場合のコンフィギュレーション + +
+ ``` -$ cd +$ cd {wolfssl-folder} $ ./autogen.sh -$ ./configure CFLAGS="-DWOLFSSL_STATIC_RSA -DHAVEAES_CBC" +$ ./configure --enable-ecc --enable-dsa --enable-aesccm CFLAGS="-DWOLFSSL_STATIC_RSA -DHAVE_AES_CBC -DHAVE_DSA -DHAVE_ALL_CURVES -DHAVE_ECC -DNO_RSA" +$ make +``` +(注意)"-DNO_RSA"の指定をわすれないこと + +
+ +#### 8.4.2 RSA証明書を使用する場合のコンフィギュレーション + +
+ +``` +$ cd {wolfssl-folder} +$ ./autogen.sh +$ ./configure --enable-ecc --enable-dsa --enable-aesccm CFLAGS="-DWOLFSSL_STATIC_RSA -DHAVE_AES_CBC -DHAVE_DSA -DHAVE_ALL_CURVES -DHAVE_ECC" $ make ```
-上記のビルドによって、/examples/server/server -が生成されます。この実行プログラムがサーバーアプリケーションとして機能します。以下のオプションを与えて実行させるとTLS_Clientからの接続を待ち受け状態になります。 + +#### 8.4.3 サーバーアプリケーションの実行 +
+上記のビルドによって、{wolfssl-folder}/examples/server/server +が生成されます。この実行プログラムがサーバーアプリケーションとして機能します。以下のオプションを与えて実行させるとtestアプリケーションからの接続を待ち受け状態になります。 使用するTLSバージョンとして TLS1.3を使用する場合には "-v4"を指定し、TLS1.2を使用する場合には"-v3"を指定してください。

``` -$ examples/server/server -b -d -i +$ examples/server/server -b -v4 -i ```
testアプリケーションには、サーバーアプリケーションに割り当てられたIPアドレスを指定します。 @@ -177,7 +261,8 @@ wolf_client.cを開き、#define SIMPLE_TLSSEVER_IPにアドレスを指定し ... ```
-ファイルをセーブしてtestアプリケーションを再ビルドしてください。testアプリケーションを実行すると、対向アプリケーションとの間でTLS接続が行われ、その後簡単な文字列を交換して標準出力に以下のような表示を行います。 +ファイルをセーブしてtestアプリケーションを再ビルドしてください。testアプリケーションを実行すると、対向アプリケーションとの間でTLS接続が行われ、その後簡単な文字列を交換して標準出力に以下のような表示を行います。表示される暗号化スイートはTLSバージョンと証明書タイプの組み合わせによって異なります。 +

``` @@ -201,41 +286,6 @@ Received: I hear you fa shizzle! ```
-### 8.2 サーバー証明書の変更(認証方式の変更) - -
-上記はサーバーアプリケーションが提示すサーバー証明書にRSA公開鍵が含まれている(RSA認証)場合の実行例です。TSIPにはこのほかにサーバー証明書にECC公開鍵を含む場合(ECDSA認証)も扱えます。 - -
-ECDSAを含む暗号化スイートを使用したい場合には、testアプリケーションの設定を変更して再ビルドが必要となります。\/common/user_settings.h を開き、USE_ECC_CERT定義を有効化して再ビルドしてください。 -

- -``` -#define USE_ECC_CERT -``` - -
-この定義により、testアプリケーションはサーバーの提示するECC公開鍵を含んだサーバー証明書を検証できるRootCA証明書を使うようになります。 -

- -さらに対向するサーバーアプリケーションの方でも以下のようにECC公開鍵を含んだサーバー証明書と秘密鍵ファイルをオプションで指定して実行する必要があります。 -

- -``` -$ ./examples/server/server -b -d -i -c ./certs/server-ecc.pem -k ./certs/ecc-key.pem -``` -
-実行結果として以下が表示されます。 -

- -``` -cipher : ECDHE-ECDSA-AES128-SHA256 -Received: I hear you fa shizzle! - -cipher : ECDHE-ECDSA-AES128-GCM-SHA256 -Received: I hear you fa shizzle! -``` -
## 9. ユーザーが用意したRootCA証明書を利用する際に必要なこと ----- @@ -247,3 +297,22 @@ Received: I hear you fa shizzle! 3. RootCA証明書を上記2の秘密鍵で生成した署名 が必要になります。それらの生成方法はRenesas社提供のマニュアルを参照してください。 + +
+ +## 10. 制限事項 + +TSIPv1.15をサポートしたwolfSSLでは以下の機能制限があります。 + +1. TLSハンドシェーク中にサーバーと交換したメッセージパケットが平文でメモリ上に蓄積されています。これはハンドシェークメッセージのハッシュ計算に使用されます。内容はセッション終了時に削除されます。 + +1. TLS1.2ではTSIPを使ったクライアント認証機能をサポートしていません。 +wolfSSL_CTX_use_certificate_buffer あるいはwolfSSL_CTX_use_certificate_chain_buffer_format を使ってクライアント証明書をロードし、wolfSSL_CTX_use_PrivateKey_bufferを使って秘密鍵をロードしてください。ソフトウエアで処理を行います。 + +1. TLS1.3ではTSIPを使ったクライアント認証機能はECDSAクライアント証明書の場合にのみサポートされます。RSA証明書の場合はソフトウエアでの処理となります。 + +1. TLS1.3ではTSIPを使ったサーバー認証機能のうち、CertificateVerifyメッセージの検証はソフトウエアでの処理となります。 + +1. TSIPを使ってのセッション再開およびearly dataはサポートされません。 + +上記制限1 ~ 4は次版以降のTSIPによって改善が見込まれています。 \ No newline at end of file diff --git a/IDE/Renesas/e2studio/RX65N/GR-ROSE/common/user_settings.h b/IDE/Renesas/e2studio/RX65N/GR-ROSE/common/user_settings.h index ac85878e7..135733936 100644 --- a/IDE/Renesas/e2studio/RX65N/GR-ROSE/common/user_settings.h +++ b/IDE/Renesas/e2studio/RX65N/GR-ROSE/common/user_settings.h @@ -1,6 +1,6 @@ /* user_settings.h * - * Copyright (C) 2006-2021 wolfSSL Inc. + * Copyright (C) 2006-2022 wolfSSL Inc. * * This file is part of wolfSSL. * @@ -49,7 +49,7 @@ * TLSv1.3, uncomment line below. * *----------------------------------------------------------------------------*/ -/*#define WOLFSSL_TLS13*/ +#define WOLFSSL_TLS13 /*-- Operating System related definitions -------------------------------------- @@ -68,11 +68,12 @@ *----------------------------------------------------------------------------*/ #define NO_DEV_RANDOM - + #define NO_MD4 #define WOLFSSL_DH_CONST #define HAVE_TLS_EXTENSIONS #define HAVE_AESGCM + #define HAVE_AESCCM #define HAVE_AES_CBC #define WOLFSSL_SHA512 @@ -104,7 +105,7 @@ * - TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA256 * */ - /*#define USE_ECC_CERT*/ + #define USE_ECC_CERT /* In this example application, Root CA cert buffer named * "ca_ecc_cert_der_256" is used under the following macro definition @@ -133,9 +134,6 @@ #endif /* WOLFSSL_STATIC_MEMORY */ -#if !defined(min) - #define min(data1, data2) _builtin_min(data1, data2) -#endif /* * -- "NO_ASN_TIME" macro is to avoid certificate expiration validation -- @@ -159,8 +157,10 @@ #define WOLFSSL_USER_IO #define WOLFSSL_USER_CURRTIME /* for benchmark */ - #define USER_TIME + #define TIME_OVERRIDES #define XTIME time + #define WOLFSSL_GMTIME + #define XGMTIME(c,t) gmtime(c) #define USE_WOLF_SUSECONDS_T #define USE_WOLF_TIMEVAL_T diff --git a/IDE/Renesas/e2studio/RX65N/GR-ROSE/common/wolfssl_dummy.c b/IDE/Renesas/e2studio/RX65N/GR-ROSE/common/wolfssl_dummy.c index 7c51a4afd..a8d2d63aa 100644 --- a/IDE/Renesas/e2studio/RX65N/GR-ROSE/common/wolfssl_dummy.c +++ b/IDE/Renesas/e2studio/RX65N/GR-ROSE/common/wolfssl_dummy.c @@ -1,6 +1,6 @@ /* wolfssl_dummy.c * - * Copyright (C) 2006-2021 wolfSSL Inc. + * Copyright (C) 2006-2022 wolfSSL Inc. * * This file is part of wolfSSL. * @@ -19,15 +19,16 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -typedef unsigned long time_t; +#include #define YEAR 2022 -#define MON 5 +#define MON 6 static int tick = 0; time_t time(time_t *t) { + (void)t; return ((YEAR-1970)*365+30*MON)*24*60*60 + tick++; } diff --git a/IDE/Renesas/e2studio/RX65N/GR-ROSE/test/.cproject b/IDE/Renesas/e2studio/RX65N/GR-ROSE/test/.cproject index 9bff172de..000de19dc 100644 --- a/IDE/Renesas/e2studio/RX65N/GR-ROSE/test/.cproject +++ b/IDE/Renesas/e2studio/RX65N/GR-ROSE/test/.cproject @@ -49,7 +49,6 @@ - @@ -62,7 +61,6 @@ -