summaryrefslogtreecommitdiff
path: root/regress/usr.bin
diff options
context:
space:
mode:
authorKinichiro Inoguchi <inoguchi@cvs.openbsd.org>2019-10-31 15:53:09 +0000
committerKinichiro Inoguchi <inoguchi@cvs.openbsd.org>2019-10-31 15:53:09 +0000
commitc5d1b017c80a5b837762b3115870a7021842ec49 (patch)
tree443823b07ae035f2cef4941886d600a3fa7f2429 /regress/usr.bin
parent902063a3fc0bbf6d91434bf4efc130cff3d6b843 (diff)
Add RSA OAEP test for pkeyutl in appstest.sh
Diffstat (limited to 'regress/usr.bin')
-rwxr-xr-xregress/usr.bin/openssl/appstest.sh22
1 files changed, 21 insertions, 1 deletions
diff --git a/regress/usr.bin/openssl/appstest.sh b/regress/usr.bin/openssl/appstest.sh
index a9cb4aef15e..f4c14f5ca07 100755
--- a/regress/usr.bin/openssl/appstest.sh
+++ b/regress/usr.bin/openssl/appstest.sh
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $OpenBSD: appstest.sh,v 1.23 2019/07/17 12:06:53 inoguchi Exp $
+# $OpenBSD: appstest.sh,v 1.24 2019/10/31 15:53:08 inoguchi Exp $
#
# Copyright (c) 2016 Kinichiro Inoguchi <inoguchi@openbsd.org>
#
@@ -453,6 +453,26 @@ function test_key {
diff $pkeyutldat $pkeyutldec
check_exit_status $?
+ pkeyutl_rsa_oaep_enc=$key_dir/pkeyutl_rsa_oaep.enc
+ pkeyutl_rsa_oaep_dec=$key_dir/pkeyutl_rsa_oaep.dec
+
+ $openssl_bin pkeyutl -encrypt -in $pkeyutldat \
+ -inkey $genpkey_rsa \
+ -pkeyopt rsa_padding_mode:oaep -pkeyopt rsa_oaep_md:sha256 \
+ -pkeyopt rsa_oaep_label:0011223344556677 \
+ -out $pkeyutl_rsa_oaep_enc
+ check_exit_status $?
+
+ $openssl_bin pkeyutl -decrypt -in $pkeyutl_rsa_oaep_enc \
+ -inkey $genpkey_rsa \
+ -pkeyopt rsa_padding_mode:oaep -pkeyopt rsa_oaep_md:sha256 \
+ -pkeyopt rsa_oaep_label:0011223344556677 \
+ -out $pkeyutl_rsa_oaep_dec
+ check_exit_status $?
+
+ diff $pkeyutldat $pkeyutl_rsa_oaep_dec
+ check_exit_status $?
+
pkeyutlsc1=$key_dir/pkeyutl.sc1
pkeyutlsc2=$key_dir/pkeyutl.sc2