!16 add SM2 engine test script

From: @wangyoukang 
Reviewed-by: @mailofzxf 
Signed-off-by: @mailofzxf
This commit is contained in:
openeuler-ci-bot 2023-08-01 12:58:14 +00:00 committed by Gitee
commit 13f0f133db
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 38 additions and 1 deletions

View File

@ -0,0 +1,31 @@
From 245c758b9a1311529d20b4c9f93ffb1b63b70f2b Mon Sep 17 00:00:00 2001
From: guowentao <guowentao@xfusion.com>
Date: Fri, 16 Jun 2023 11:43:54 +0800
Subject: [PATCH] add SM2 engine test script
Signed-off-by: guowentao <guowentao@xfusion.com>
---
test/sm2-sign-test.sh | 11 +++++++++++
1 file changed, 11 insertions(+)
create mode 100755 test/sm2-sign-test.sh
diff --git a/test/sm2-sign-test.sh b/test/sm2-sign-test.sh
new file mode 100755
index 0000000..b658be0
--- /dev/null
+++ b/test/sm2-sign-test.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+echo -n "abcde12345abcde12345123456789012">mydata
+tpm2tss-genkey -a sm2 mykey
+openssl ec -engine tpm2tss -inform engine -in mykey -pubout -outform pem -out mykey.pub
+openssl pkeyutl -engine tpm2tss -keyform engine -inkey mykey -sign -in mydata -out mysig
+openssl pkeyutl -engine tpm2tss -keyform engine -inkey mykey -verify -in mydata -sigfile mysig
+openssl pkeyutl --keyform pem -inkey mykey.pub -pubin -verify -in mydata -sigfile mysig
+
+rm -f mykey mydata mykey.pub mysig
+
--
2.27.0

View File

@ -1,6 +1,6 @@
Name: tpm2-tss-engine
Version: 1.1.0
Release: 1.u3
Release: 1.u4
Summary: OpenSSL Engine for TPM2 devices using the tpm2-tss software stack
License: BSD
@ -10,6 +10,7 @@ Source0: https://github.com/tpm2-software/tpm2-tss-engine/releases/downlo
Patch10001: 0001-add-bootstrap-for-source-code-compilation.patch
Patch10002: 0002-add-SM2-genkey-function.patch
Patch10003: 0003-add-SM2-sign-function-for-openssl-engine.patch
Patch10004: 0004-add-SM2-engine-test-script.patch
BuildRequires: make
BuildRequires: autoconf
@ -86,6 +87,11 @@ uses the tpm2-tss software stack
%changelog
* Tue Aug 1 2023 wangyoukang<wangyoukang@xfusion.com> - 1.1.0-1.u4
- Type:req
- CVE:
- DESC: add SM2 engine test script
* Tue Aug 1 2023 wangyoukang<wangyoukang@xfusion.com> - 1.1.0-1.u3
- Type:req
- CVE: