From 9a2ae6e58f6d6284fed2d46d09a6601c9439917b Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Thu, 3 Sep 2015 17:11:12 +0200 Subject: [PATCH] Fix missing zero padding for generated CA serial fixes #10074 --- lib/base/tlsutility.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/base/tlsutility.cpp b/lib/base/tlsutility.cpp index eccc343fe..9be90f39c 100644 --- a/lib/base/tlsutility.cpp +++ b/lib/base/tlsutility.cpp @@ -399,7 +399,7 @@ boost::shared_ptr CreateCert(EVP_PKEY *pubkey, X509_NAME *subject, X509_NA std::ofstream ofp; ofp.open(serialfile.CStr()); - ofp << std::hex << serial + 1; + ofp << std::hex << std::setw(2) << std::setfill('0') << serial + 1; ofp.close(); if (ofp.fail()) -- 2.40.0