From d1200ee2e88c18cfd464ccb6feee202b5060e988 Mon Sep 17 00:00:00 2001 From: Pengyu Lv Date: Tue, 30 May 2023 18:54:39 +0800 Subject: [PATCH 1/2] Fix invalid commands for ec_x{25519,448}_{prv,pub}.{der,pem} Signed-off-by: Pengyu Lv --- tests/data_files/Makefile | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/data_files/Makefile b/tests/data_files/Makefile index 3d2d5dccd..55d6cd219 100644 --- a/tests/data_files/Makefile +++ b/tests/data_files/Makefile @@ -1011,32 +1011,32 @@ ec_x25519_prv.der: $(OPENSSL) genpkey -algorithm X25519 -out $@ -outform DER all_final += ec_x25519_prv.der -ec_x25519_pub.der: ec_x25519_pub.der - $(OPENSSL) pkey -in $< -inform DER -out $@ -outform DER +ec_x25519_pub.der: ec_x25519_prv.der + $(OPENSSL) pkey -in $< -inform DER -out $@ -outform DER -pubout all_final += ec_x25519_pub.der -ec_x25519_prv.pem: ec_x25519_prv.pem +ec_x25519_prv.pem: ec_x25519_prv.der $(OPENSSL) pkey -in $< -inform DER -out $@ all_final += ec_x25519_prv.pem -ec_x25519_pub.pem: ec_x25519_pub.pem - $(OPENSSL) pkey -in $< -inform DER -out $@ +ec_x25519_pub.pem: ec_x25519_pub.der + $(OPENSSL) pkey -in $< -inform DER -out $@ -pubin all_final += ec_x25519_pub.pem ec_x448_prv.der: $(OPENSSL) genpkey -algorithm X448 -out $@ -outform DER all_final += ec_x448_prv.der -ec_x448_pub.der: ec_x448_pub.der - $(OPENSSL) pkey -in $< -inform DER -out $@ -outform DER +ec_x448_pub.der: ec_x448_prv.der + $(OPENSSL) pkey -in $< -inform DER -out $@ -outform DER -pubout all_final += ec_x448_pub.der -ec_x448_prv.pem: ec_x448_prv.pem +ec_x448_prv.pem: ec_x448_prv.der $(OPENSSL) pkey -in $< -inform DER -out $@ all_final += ec_x448_prv.pem -ec_x448_pub.pem: ec_x448_pub.pem - $(OPENSSL) pkey -in $< -inform DER -out $@ +ec_x448_pub.pem: ec_x448_pub.der + $(OPENSSL) pkey -in $< -inform DER -out $@ -pubin all_final += ec_x448_pub.pem ################################################################ From 21e5939479648453d787badb560f014730e090e6 Mon Sep 17 00:00:00 2001 From: Pengyu Lv Date: Mon, 5 Jun 2023 17:40:15 +0800 Subject: [PATCH 2/2] Generate PEM pub key directly from DER prv key Signed-off-by: Pengyu Lv --- tests/data_files/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/data_files/Makefile b/tests/data_files/Makefile index 55d6cd219..46aa5052d 100644 --- a/tests/data_files/Makefile +++ b/tests/data_files/Makefile @@ -1019,8 +1019,8 @@ ec_x25519_prv.pem: ec_x25519_prv.der $(OPENSSL) pkey -in $< -inform DER -out $@ all_final += ec_x25519_prv.pem -ec_x25519_pub.pem: ec_x25519_pub.der - $(OPENSSL) pkey -in $< -inform DER -out $@ -pubin +ec_x25519_pub.pem: ec_x25519_prv.der + $(OPENSSL) pkey -in $< -inform DER -out $@ -pubout all_final += ec_x25519_pub.pem ec_x448_prv.der: @@ -1035,8 +1035,8 @@ ec_x448_prv.pem: ec_x448_prv.der $(OPENSSL) pkey -in $< -inform DER -out $@ all_final += ec_x448_prv.pem -ec_x448_pub.pem: ec_x448_pub.der - $(OPENSSL) pkey -in $< -inform DER -out $@ -pubin +ec_x448_pub.pem: ec_x448_prv.der + $(OPENSSL) pkey -in $< -inform DER -out $@ -pubout all_final += ec_x448_pub.pem ################################################################