]> granicus.if.org Git - icinga2/commitdiff
Fix missing zero padding for generated CA serial
authorMichael Friedrich <michael.friedrich@netways.de>
Thu, 3 Sep 2015 15:11:12 +0000 (17:11 +0200)
committerMichael Friedrich <michael.friedrich@netways.de>
Thu, 3 Sep 2015 15:12:01 +0000 (17:12 +0200)
fixes #10074

lib/base/tlsutility.cpp

index eccc343fe939cf09441d3c6cf3561c9177f8e5cb..9be90f39c73d9e0ffcaafeb252a72906fa008f6a 100644 (file)
@@ -399,7 +399,7 @@ boost::shared_ptr<X509> 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())