mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 16:37:19 +09:00
test: run PKCS#7 verification with both internal and external certificates
This commit is contained in:
@@ -49,9 +49,18 @@ testcase_public() {
|
||||
|
||||
testcase_pkcs7() {
|
||||
echo -n "test" > /tmp/payload
|
||||
|
||||
# Generate PKCS#1 signature
|
||||
openssl dgst -sha256 -sign /tmp/test.key -out /tmp/payload.sig /tmp/payload
|
||||
|
||||
# Generate PKCS#7 signature
|
||||
/usr/lib/systemd/systemd-keyutil --certificate /tmp/test.crt --output /tmp/payload.p7s --signature /tmp/payload.sig pkcs7
|
||||
openssl smime -verify -binary -inform der -in /tmp/payload.p7s -content /tmp/payload -certfile /tmp/test.crt -nointern -noverify > /dev/null
|
||||
|
||||
# Verify using internal x509 certificate
|
||||
openssl smime -verify -binary -inform der -in /tmp/payload.p7s -content /tmp/payload -noverify > /dev/null
|
||||
|
||||
# Verify using external (original) x509 certificate
|
||||
openssl smime -verify -binary -inform der -in /tmp/payload.p7s -content /tmp/payload -certificate /tmp/test.crt -nointern -noverify > /dev/null
|
||||
}
|
||||
|
||||
run_testcases
|
||||
|
||||
Reference in New Issue
Block a user