aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/unit_x509.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-03-14 08:11:24 -0400
committerJack Lloyd <[email protected]>2018-03-14 09:27:33 -0400
commit7a645fd781d70855019bed278ffa80d726962be5 (patch)
treee8af17b6a15f6fe4ff288f980fa915dc9b69f98f /src/tests/unit_x509.cpp
parentcf03866d0c9648b92501e4de2ca62e28ff19af3b (diff)
Allow the caller to specify the serial number of a generated cert
GH #1489
Diffstat (limited to 'src/tests/unit_x509.cpp')
-rw-r--r--src/tests/unit_x509.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/tests/unit_x509.cpp b/src/tests/unit_x509.cpp
index 94fa95392..1a5a6a2ce 100644
--- a/src/tests/unit_x509.cpp
+++ b/src/tests/unit_x509.cpp
@@ -692,12 +692,17 @@ Test::Result test_x509_cert(const Botan::Private_Key& ca_key,
/* Create the CA object */
Botan::X509_CA ca(ca_cert, ca_key, {{"padding",sig_padding}}, hash_fn, Test::rng());
+ const BigInt user1_serial = 99;
+
/* Sign the requests to create the certs */
Botan::X509_Certificate user1_cert =
- ca.sign_request(user1_req, Test::rng(),
+ ca.sign_request(user1_req, Test::rng(), user1_serial,
from_date(2008, 01, 01),
from_date(2033, 01, 01));
+ result.test_eq("User1 serial size matches expected", user1_cert.serial_number().size(), 1);
+ result.test_eq("User1 serial matches expected", user1_cert.serial_number().at(0), size_t(99));
+
Botan::X509_Certificate user2_cert =
ca.sign_request(user2_req, Test::rng(),
from_date(2008, 01, 01),