diff --git a/Utils.cpp b/Utils.cpp index 5a4fb499..d753618a 100644 --- a/Utils.cpp +++ b/Utils.cpp @@ -45,7 +45,10 @@ void CUtils::GenerateCert(FILE *pOut, bool bEncPrivKey) { EVP_PKEY *pKey = NULL; X509 *pCert = NULL; X509_NAME *pName = NULL; - int serial = 0, days = 365; + int days = 365; + + u_int iSeed = time( NULL ); + int serial = ( rand_r( &iSeed ) % 9999 ); RSA *pRSA = RSA_generate_key(1024, 0x10001, NULL, NULL); if( ( pKey = EVP_PKEY_new() ) ) {