From 205fa72305e49f7e3ed41fe2fae2bf4f2c01830a Mon Sep 17 00:00:00 2001 From: Christian Hohnstaedt Date: Fri, 27 Nov 2009 07:35:17 +0100 Subject: [PATCH] extend templates - they now contain the not-well-defined information --- lib/pki_temp.cpp | 10 +++++++--- lib/pki_temp.h | 3 ++- misc/CA.xca | Bin 72 -> 74 bytes misc/HTTPS_client.xca | Bin 72 -> 74 bytes misc/HTTPS_server.xca | Bin 72 -> 74 bytes widgets/NewX509.cpp | 2 ++ 6 files changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/pki_temp.cpp b/lib/pki_temp.cpp index b813a98c..e5c10794 100644 --- a/lib/pki_temp.cpp +++ b/lib/pki_temp.cpp @@ -49,13 +49,14 @@ pki_temp::pki_temp(const pki_temp *pk) keyUse=pk->keyUse; eKeyUse=pk->eKeyUse; adv_ext=pk->adv_ext; + noWellDefined=pk->noWellDefined; } pki_temp::pki_temp(const QString d) :pki_base(d) { class_name = "pki_temp"; - dataVersion=3; + dataVersion=4; pkiType=tmpl; cols=2; @@ -85,6 +86,7 @@ pki_temp::pki_temp(const QString d) keyUse=0; eKeyUse=0; adv_ext=""; + noWellDefined=false; } @@ -130,6 +132,8 @@ void pki_temp::fromData(const unsigned char *p, int size, int version) validMidn=db::boolFromData(&p1); if (version>2) adv_ext=db::stringFromData(&p1); + if (version>3) + noWellDefined=db::boolFromData(&p1); if (p1-p != size) { my_error(tr("Wrong Size of template: ") + getIntName()); } @@ -172,7 +176,7 @@ unsigned char *pki_temp::toData(int *size) db::stringToData(&p1, certPol); db::boolToData(&p1, validMidn); db::stringToData(&p1, adv_ext); - + db::boolToData(&p1, noWellDefined); *size = p1-p; return p; } @@ -256,7 +260,7 @@ pki_temp::~pki_temp() int pki_temp::dataSize() { - int s = 9 * sizeof(int) + 8 * sizeof(char) + + int s = 9 * sizeof(int) + 9 * sizeof(char) + xname.derSize() + ( subAltName.length() + issAltName.length() + diff --git a/lib/pki_temp.h b/lib/pki_temp.h index 70539c24..c9dcaec7 100644 --- a/lib/pki_temp.h +++ b/lib/pki_temp.h @@ -23,7 +23,8 @@ class pki_temp: public pki_base QString nsComment, nsBaseUrl, nsRevocationUrl, nsCARevocationUrl, nsRenewalUrl, nsCaPolicyUrl, nsSslServerName, destination, adv_ext; - bool bcCrit, keyUseCrit, eKeyUseCrit, subKey, authKey, validMidn; + bool bcCrit, keyUseCrit, eKeyUseCrit, subKey, authKey, + validMidn, noWellDefined; int nsCertType, pathLen, keyUse, eKeyUse, ca; int validN, validM; diff --git a/misc/CA.xca b/misc/CA.xca index 718a04102a7c44a9a73968a05de5a5d825781ed7..9b53b06ed691d3e9b455f63950e8a387ddc2c228 100644 GIT binary patch delta 17 Wcmeb9;$UE4Z~|hMi5w103=9AfcLBTr delta 14 TcmebB;9y{2Z~$Vai5w093@rh+ diff --git a/misc/HTTPS_client.xca b/misc/HTTPS_client.xca index afbc19d513059247b0f6d1283ec485e4ae910d2a..16e3925de325cf465f7acf352bff7d20ac6de5e8 100644 GIT binary patch delta 17 Wcmeb9;$UE4Z~|hMi5w103=9AfcLBTr delta 14 TcmebB;9y{2Z~$Vai5w093@rh+ diff --git a/misc/HTTPS_server.xca b/misc/HTTPS_server.xca index 5b91338a27d7d2a5d6428aa41f0ff70e3bda7be4..e7d258f80bc44115fd82a9cffb66fe2cd0647078 100644 GIT binary patch delta 17 Wcmeb9;$UE4Z~|hMi5w103=9AfcLBTr delta 14 TcmebB;9y{2Z~$Vai5w093@rh+ diff --git a/widgets/NewX509.cpp b/widgets/NewX509.cpp index 5bcc9521..5d8ebc91 100644 --- a/widgets/NewX509.cpp +++ b/widgets/NewX509.cpp @@ -303,6 +303,7 @@ void NewX509::fromTemplate(pki_temp *temp) basicPath->setText(QString::number(temp->pathLen)); } nconf_data->document()->setPlainText(temp->adv_ext); + noWellDefinedExpDate->setChecked(temp->noWellDefined); notBefore->setNow(); on_applyTime_clicked(); } @@ -340,6 +341,7 @@ void NewX509::toTemplate(pki_temp *temp) } else { temp->adv_ext = nconf_data->toPlainText(); } + temp->noWellDefined = noWellDefinedExpDate->isChecked(); } void NewX509::on_fromReqCB_clicked()