summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDmitry Belyavskiy <beldmit@gmail.com>2021-05-04 20:47:42 +0200
committerDmitry Belyavskiy <beldmit@gmail.com>2021-05-11 12:12:32 +0200
commit6dbb277627de86578577185084378135605d2df1 (patch)
tree003a29ffb2811ff66745570a494678b2dd22ef67 /test
parentf60e35d01e8b0116c53575774dbf26dcd2d2311d (diff)
Tests for creating req from PKCS8 keys with extra attrs
Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15142)
Diffstat (limited to 'test')
-rw-r--r--test/recipes/25-test_req.t25
-rw-r--r--test/testrsa_withattrs.derbin0 -> 1277 bytes
-rw-r--r--test/testrsa_withattrs.pem29
3 files changed, 53 insertions, 1 deletions
diff --git a/test/recipes/25-test_req.t b/test/recipes/25-test_req.t
index 30c1c43a7f..0fcb56a46a 100644
--- a/test/recipes/25-test_req.t
+++ b/test/recipes/25-test_req.t
@@ -73,7 +73,7 @@ subtest "generating alt certificate requests with RSA" => sub {
subtest "generating certificate requests with RSA" => sub {
- plan tests => 3;
+ plan tests => 7;
SKIP: {
skip "RSA is not supported by this OpenSSL build", 2
@@ -97,6 +97,29 @@ subtest "generating certificate requests with RSA" => sub {
"-config", srctop_file("test", "test.cnf"),
"-verify", "-in", "testreq-rsa.pem", "-noout"])),
"Verifying signature on request");
+
+ ok(run(app(["openssl", "req",
+ "-config", srctop_file("test", "test.cnf"),
+ "-new", "-out", "testreq_withattrs_pem.pem", "-utf8",
+ "-key", srctop_file("test", "testrsa_withattrs.pem")])),
+ "Generating request from a key with extra attributes - PEM");
+
+ ok(run(app(["openssl", "req",
+ "-config", srctop_file("test", "test.cnf"),
+ "-verify", "-in", "testreq_withattrs_pem.pem", "-noout"])),
+ "Verifying signature on request from a key with extra attributes - PEM");
+
+ ok(run(app(["openssl", "req",
+ "-config", srctop_file("test", "test.cnf"),
+ "-new", "-out", "testreq_withattrs_der.pem", "-utf8",
+ "-key", srctop_file("test", "testrsa_withattrs.der"),
+ "-keyform", "DER"])),
+ "Generating request from a key with extra attributes - PEM");
+
+ ok(run(app(["openssl", "req",
+ "-config", srctop_file("test", "test.cnf"),
+ "-verify", "-in", "testreq_withattrs_der.pem", "-noout"])),
+ "Verifying signature on request from a key with extra attributes - PEM");
}
};
diff --git a/test/testrsa_withattrs.der b/test/testrsa_withattrs.der
new file mode 100644
index 0000000000..811e1e0bcb
--- /dev/null
+++ b/test/testrsa_withattrs.der
Binary files differ
diff --git a/test/testrsa_withattrs.pem b/test/testrsa_withattrs.pem
new file mode 100644
index 0000000000..42d0a3c51c
--- /dev/null
+++ b/test/testrsa_withattrs.pem
@@ -0,0 +1,29 @@
+-----BEGIN PRIVATE KEY-----
+MIIE+QIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDsh7QWxhftrqng
+RC3Ms+HxH2NFCX1sRoiIV4cYK2z0DQdEiNpFdpHlcs3weTuudcpr8XursodVFMTB
+eHjROhgwO/LT9xReEUiaoHJgfv6KcKcxEvntCjQkzGhkw03OH5VYdtTRAbwpwcYt
+groPiZ2STINpQOmFabzai+K+3rddwTGkkca3C5kY7KOMlnt9IuvmycksRqH6MPKz
+P5QbztlgY95rtra+OEzKLYQ1ux6hkaUlpxT5eGKfzYdccwKJWa0dUXyT/8F6rpTm
+Zbz3BxdKGAWMywaTfh5ywhNmVNTeIumxIRc3+PInn0rqKTaDrWylxiBdb3t27HxQ
+InDZmPwdAgMBAAECggEBAMTRrzN8JxEq1ES/tvStgodoPOyHlwxwLNB3NP0RtZnm
+9XM8BZTjs0egnmlKGDV14riruuMGrcJIg+kR3EcN9m68k7V51kLoUugINuTBCAIe
+96DIT5vFb9pnFT8znRy1/0obp787mF2O1t+r9jNTqgDBFmCRGUBg2jtpR4bYQPEL
+ZjXMDPcsmOlmbBdsyQvjlOHqXjCoUWwOCBEZdtaLzxaOPrBW5Jh2h3Xz1pV3NdZ/
+xufAYRhpJamPNiSipRehBZAeQP2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