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:
psychon
2010-02-18 20:41:56 +00:00
parent 4825bb6d8e
commit ff54899588
+2 -2
View File
@@ -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;