Fix rsa_pkcs1_*_clear.der to actually be PKCS#1 files

With OpenSSL 3.0.2 (which I used to generate the previous set of "pkcs1" DER
files), the output of `openssl rsa -outform DER` is actually a
PKCS#8-encoded key, despite what the documentation says. This is a change
from OpenSSL 1.x, where the output is a PKCS#1-encoded key. OpenSSL 3.0.8
documents the output as PKCS#8.

Change to `openssl pkey`, which seems more reliable. The documentation
states that the output is PKCS#8, but the output is actually consistently
PKCS#1 at least from 1.0.2g to 3.3.0.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
Gilles Peskine 2024-04-25 16:02:13 +02:00
parent cbb4507b44
commit 0652b62d5e
9 changed files with 1 additions and 1 deletions

View File

@ -739,7 +739,7 @@ all_final += $(keys_rsa_base)
### PKCS1-encoded, plaintext RSA keys in derived forms
rsa_pkcs1_%.der: rsa_pkcs1_%.pem
$(OPENSSL) rsa -inform PEM -in $< -outform DER -out $@
$(OPENSSL) pkey -inform PEM -in $< -outform DER -out $@
all_final += $(keys_rsa_base:.pem=.der)
###