diff options
author | Thorvald Natvig <slicer@users.sourceforge.net> | 2009-04-27 20:50:56 +0400 |
---|---|---|
committer | Thorvald Natvig <slicer@users.sourceforge.net> | 2009-04-27 20:50:56 +0400 |
commit | c12d03c1579c35e7b1bd2dfd993f11d825512f46 (patch) | |
tree | 2c88f1c93afc30be4f85572b186f51815f8dd620 /src/murmur/Cert.cpp | |
parent | 3f611676211167db0d6d616b28d4415cb53a6d76 (diff) |
Start of Certificate Wizard
Diffstat (limited to 'src/murmur/Cert.cpp')
-rw-r--r-- | src/murmur/Cert.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/murmur/Cert.cpp b/src/murmur/Cert.cpp index d2840c982..c08118ea6 100644 --- a/src/murmur/Cert.cpp +++ b/src/murmur/Cert.cpp @@ -31,7 +31,7 @@ #include "Server.h" #include "Meta.h" -int add_ext(X509 * crt, int nid, char *value) { +static int add_ext(X509 * crt, int nid, char *value) { X509_EXTENSION *ex; X509V3_CTX ctx; X509V3_set_ctx_nodb(&ctx); @@ -101,12 +101,8 @@ void Server::initializeCert() { if (qscCert.isNull() || qskKey.isNull()) { log("Generating new server certificate."); - BIO *bio_err; - CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON); - bio_err=BIO_new_fp(stderr, BIO_NOCLOSE); - X509 *x509 = X509_new(); EVP_PKEY *pkey = EVP_PKEY_new(); RSA *rsa = RSA_generate_key(1024,RSA_F4,NULL,NULL); @@ -115,7 +111,7 @@ void Server::initializeCert() { X509_set_version(x509, 2); ASN1_INTEGER_set(X509_get_serialNumber(x509),1); X509_gmtime_adj(X509_get_notBefore(x509),0); - X509_gmtime_adj(X509_get_notAfter(x509),60*60*24*365); + X509_gmtime_adj(X509_get_notAfter(x509),60*60*24*365*20); X509_set_pubkey(x509, pkey); X509_NAME *name=X509_get_subject_name(x509); |