mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-07 06:42:56 +03:00
Add test-case for signature over zero-length data
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
This commit is contained in:
@@ -1205,6 +1205,10 @@ $(pkcs7_test_file):
|
||||
echo -e "Hello\xd" > $@
|
||||
all_final += $(pkcs7_test_file)
|
||||
|
||||
pkcs7_zerolendata.bin:
|
||||
printf '' > $@
|
||||
all_final += pkcs7_zerolendata.bin
|
||||
|
||||
pkcs7_data_1.bin:
|
||||
echo -e "2\xd" > $@
|
||||
all_final += pkcs7_data_1.bin
|
||||
@@ -1238,6 +1242,11 @@ pkcs7-rsa-sha256-2.der: $(pkcs7_test_cert_2)
|
||||
$(OPENSSL) x509 -in pkcs7-rsa-sha256-2.crt -out $@ -outform DER
|
||||
all_final += pkcs7-rsa-sha256-2.der
|
||||
|
||||
# pkcs7 signature file over zero-len data
|
||||
pkcs7_zerolendata_detached.der: pkcs7_zerolendata.bin pkcs7-rsa-sha256-1.key pkcs7-rsa-sha256-1.crt
|
||||
$(OPENSSL) smime -sign -md sha256 -nocerts -noattr -in pkcs7_zerolendata.bin -inkey pkcs7-rsa-sha256-1.key -outform DER -binary -signer pkcs7-rsa-sha256-1.crt -out pkcs7_zerolendata_detached.der
|
||||
all_final += pkcs7_zerolendata_detached.der
|
||||
|
||||
# pkcs7 signature file with CERT
|
||||
pkcs7_data_cert_signed_sha256.der: $(pkcs7_test_file) $(pkcs7_test_cert_1)
|
||||
$(OPENSSL) smime -sign -binary -in pkcs7_data.bin -out $@ -md sha256 -signer pkcs7-rsa-sha256-1.pem -noattr -outform DER -out $@
|
||||
|
0
tests/data_files/pkcs7_zerolendata.bin
Normal file
0
tests/data_files/pkcs7_zerolendata.bin
Normal file
BIN
tests/data_files/pkcs7_zerolendata_detached.der
Normal file
BIN
tests/data_files/pkcs7_zerolendata_detached.der
Normal file
Binary file not shown.
Reference in New Issue
Block a user