mirror of
https://github.com/znc/znc.git
synced 2026-05-09 06:44:40 +02:00
Generate stronger certificates in --makepem
Idea and patch by Reed Loden on the bug tracker, thanks a lot. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1774 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -45,7 +45,7 @@ void CUtils::GenerateCert(FILE *pOut, const CString& sHost) {
|
||||
u_int iSeed = time(NULL);
|
||||
int serial = (rand_r(&iSeed) % 9999);
|
||||
|
||||
RSA *pRSA = RSA_generate_key(1024, 0x10001, NULL, NULL);
|
||||
RSA *pRSA = RSA_generate_key(2048, 0x10001, NULL, NULL);
|
||||
if ((pKey = EVP_PKEY_new())) {
|
||||
if (!EVP_PKEY_assign_RSA(pKey, pRSA)) {
|
||||
EVP_PKEY_free(pKey);
|
||||
@@ -101,7 +101,7 @@ void CUtils::GenerateCert(FILE *pOut, const CString& sHost) {
|
||||
X509_set_subject_name(pCert, pName);
|
||||
X509_set_issuer_name(pCert, pName);
|
||||
|
||||
if (!X509_sign(pCert, pKey, EVP_md5())) {
|
||||
if (!X509_sign(pCert, pKey, EVP_sha1())) {
|
||||
X509_free(pCert);
|
||||
EVP_PKEY_free(pKey);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user