diff --git a/VERSION b/VERSION index 4a7324a7..4de8338c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.6.0-pre00 +0.6.0-pre01 diff --git a/lib/db_crl.cpp b/lib/db_crl.cpp index 85860428..6b27192e 100644 --- a/lib/db_crl.cpp +++ b/lib/db_crl.cpp @@ -54,7 +54,7 @@ #include "widgets/CrlDetail.h" #include #include - +#include db_crl::db_crl(QString db, MainWindow *mw) :db_base(db,mw) @@ -180,11 +180,41 @@ pki_crl *db_crl::newItem(pki_x509 *cert) QList list; a1time time; pki_crl *crl = NULL; + Ui::NewCrl ui; + const EVP_MD *dgst; + const EVP_MD *algolist[] = { EVP_md2(), EVP_md5(), EVP_sha1() +#ifdef HAS_SHA256 + ,EVP_sha256(), EVP_sha512() +#endif + }; x509v3ext e; X509V3_CTX ext_ctx; X509V3_set_ctx(&ext_ctx, cert->getCert() , NULL, NULL, NULL, 0); X509V3_set_ctx_nodb((&ext_ctx)); + QDialog *dlg = new QDialog(mainwin); + ui.setupUi(dlg); + ui.image->setPixmap(*MainWindow::revImg); +#ifdef HAS_SHA256 + ui.hashAlgo->addItem(tr("SHA 256")); + ui.hashAlgo->addItem(tr("SHA 512")); + ui.hashAlgo->setCurrentIndex(3); +#endif + ui.lastUpdate->setDate(time.now()); + ui.nextUpdate->setDate(time.now(cert->getCrlDays() *60*60*24)); + if (cert->getRefKey()->getType() == EVP_PKEY_DSA) + ui.hashAlgo->setEnabled(false); + else + ui.hashAlgo->setEnabled(true); + + if (cert->hasExtension(NID_subject_alt_name)) + ui.subAltName->setEnabled(true); + else + ui.subAltName->setEnabled(false); + if (!dlg->exec()) { + delete dlg; + return NULL; + } try { crl = new pki_crl(); crl->createCrl(cert->getIntName(), cert); @@ -196,16 +226,26 @@ pki_crl *db_crl::newItem(pki_x509 *cert) } } - crl->addV3ext(e.create(NID_authority_key_identifier, - "keyid,issuer", &ext_ctx)); - if (cert->hasExtension(NID_subject_alt_name)) { - crl->addV3ext(e.create(NID_issuer_alt_name, - "issuer:copy", &ext_ctx)); + if (ui.authKeyId->isChecked()) { + crl->addV3ext(e.create(NID_authority_key_identifier, + "keyid,issuer", &ext_ctx)); } - crl->setLastUpdate(time.now()); - crl->setNextUpdate(time.now(60*60*24*cert->getCrlDays())); - cert->setLastCrl(time); - crl->sign(cert->getRefKey(), EVP_sha1()); + if (ui.subAltName->isChecked()) { + if (cert->hasExtension(NID_subject_alt_name)) { + crl->addV3ext(e.create(NID_issuer_alt_name, + "issuer:copy", &ext_ctx)); + } + } + + crl->setLastUpdate(ui.lastUpdate->getDate()); + crl->setNextUpdate(ui.nextUpdate->getDate()); + cert->setLastCrl(ui.nextUpdate->getDate()); + if (cert->getRefKey()->getType() == EVP_PKEY_DSA) + dgst = EVP_dss1(); + else + dgst = algolist[ui.hashAlgo->currentIndex()]; + + crl->sign(cert->getRefKey(), dgst); mainwin->certs->updatePKI(cert); #warning FIXME: set Last update insert(crl); diff --git a/misc/xca.nsi b/misc/xca.nsi index e71d2f72..5a06e155 100755 --- a/misc/xca.nsi +++ b/misc/xca.nsi @@ -64,12 +64,15 @@ Section "xca (required)" SecMain File "misc\eku.txt" File "misc\oids.txt" File "misc\aia.txt" - File "lang\*.qm" + File /nonfatal "lang\*.qm" File "doc\*.html" + File "../mingwm10.dll" File "${OPENSSL}\libeay32.dll" File "${QTDIR}\QtGui4.dll" File "${QTDIR}\QtCore4.dll" + ; remove old images + Delete "$INSTDIR\*.png" ; Write the installation path into the registry WriteRegStr HKLM SOFTWARE\xca "Install_Dir" "$INSTDIR" @@ -89,18 +92,24 @@ SectionEnd ;---------------------------------------- Section "Update" SecUpdate - StrCpy $3 "" SetOutPath $INSTDIR File "${DBDUMP}" - FindFirst $0 $1 $LOCALAPPDATA\*.db - loop: - StrCmp $1 "" done - Exec '"$INSTDIR\db_dump.exe" -f "$LOCALAPPDATA\$1.dump" "$LOCALAPPDATA\$1"' - StrCpy $3 "$3 $LOCALAPPDATA\$1.dump\n" + FindFirst $0 $1 $APPDATA\xca\*.db + loop1: + StrCmp $1 "" done1 + Exec '"$INSTDIR\db_dump.exe" -f "$APPDATA\xca\$1.dump" "$APPDATA\xca\$1"' + MessageBox MB_OK "Dumping $APPDATA\xca\$1 to $APPDATA\xca\$1.dump" FindNext $0 $1 - Goto loop - MessageBox MB_OK "You can use the Menu entry 'Import old db dump' to import the following dumps: $3" - done: + Goto loop1 + done1: + FindFirst $0 $1 $INSTDIR\*.db + loop2: + StrCmp $1 "" done2 + Exec '"$INSTDIR\db_dump.exe" -f "$INSTDIR\$1.dump" "$INSTDIR\$1"' + MessageBox MB_OK "Dumping $INSTDIR\$1 to $INSTDIR\$1.dump" + FindNext $0 $1 + Goto loop2 + done2: SectionEnd diff --git a/ui/NewCrl.ui b/ui/NewCrl.ui index b9dfebc8..24a74401 100644 --- a/ui/NewCrl.ui +++ b/ui/NewCrl.ui @@ -1,142 +1,267 @@ - - - - Dialog - + NewCrl + 0 0 - 400 - 300 + 316 + 384 Dialog - - - - 20 - 250 - 351 - 33 - + + + 9 - - - 0 - - - 6 - - - - - Qt::Horizontal - - - - 131 - 31 - - - - - - - - OK - - - - - - - Cancel - - - - - - - - - 270 - 200 - 76 - 23 - + + 6 - - MD 2 - + + + 0 + + + 6 + + + + + + Arial + 14 + 50 + false + false + false + false + + + + Create CRL + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 95 + 40 + + + + + 95 + 40 + + + + true + + + + - - MD 5 - + + + Qt::Vertical + + + + 20 + 40 + + + - - SHA 1 - + + + Dates + + + + 9 + + + 6 + + + + + next update + + + + + + + last update + + + + + + + + + + + - - - - - 70 - 20 - 261 - 161 - - - - GroupBox - - - - - 20 - 30 - 121 - 19 - - - - last update - - - - - - 20 - 60 - 101 - 19 - - - - next update - - - + + + + 0 + + + 6 + + + + + Hashing algorithm + + + + + + + + MD 2 + + + + + MD 5 + + + + + SHA 1 + + + + + + + + + + Extensions + + + + 9 + + + 6 + + + + + Authority key identifier + + + + + + + Subject alternative name + + + + + + + + + + Qt::Vertical + + + + 21 + 20 + + + + + + + + 0 + + + 6 + + + + + Cancel + + + + + + + Qt::Horizontal + + + + 21 + 21 + + + + + + + + OK + + + + + + - + + + Validity + QDateTimeEdit +
widgets/validity.h
+
+
okButton clicked() - Dialog + NewCrl accept() - 278 - 253 + 224 + 332 96 @@ -147,12 +272,12 @@ cancelButton clicked() - Dialog + NewCrl reject() - 369 - 253 + 305 + 332 179