diff --git a/changelog b/changelog
index 4e669cef..ffbd350e 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,4 @@
+ * Add OID resolver, move some Menu items to "Extra"
* SF. Bug. #81 Make xca qt5 compatible
* SF. Bug. #107 error:0D0680A8:asn1 encoding
* Don't validate notBefore and notAfter if they are disabled.
diff --git a/ui/Makefile b/ui/Makefile
index facba885..835d59d6 100644
--- a/ui/Makefile
+++ b/ui/Makefile
@@ -9,7 +9,7 @@ UI_H = ui_About.h ui_CaProperties.h ui_CertDetail.h ui_CertExtend.h \
ui_ImportMulti.h ui_KeyDetail.h ui_MainWindow.h ui_NewCrl.h \
ui_NewKey.h ui_NewX509.h ui_Options.h ui_PwDialog.h ui_Revoke.h \
ui_SelectToken.h ui_TrustState.h ui_v3ext.h ui_SearchPkcs11.h \
- ui_RevocationList.h
+ ui_RevocationList.h ui_OidResolver.h
include $(TOPDIR)/Rules.mak
diff --git a/ui/OidResolver.ui b/ui/OidResolver.ui
new file mode 100644
index 00000000..80e948e7
--- /dev/null
+++ b/ui/OidResolver.ui
@@ -0,0 +1,229 @@
+
+
+ OidResolver
+
+
+
+ 0
+ 0
+ 400
+ 266
+
+
+
+ Dialog
+
+
+ -
+
+
+
+ Arial
+ 14
+ 50
+ false
+ false
+ false
+ false
+
+
+
+ OID Resolver
+
+
+ Qt::AlignCenter
+
+
+
+ -
+
+
+ Enter The OID, the Nid, or one of the textual representations
+
+
+
+ -
+
+
-
+
+
+ Search
+
+
+
+ -
+
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ -
+
+
-
+
+
+ OID
+
+
+
+ -
+
+
+
+ 0
+ 18
+
+
+
+
+
+
+
+ -
+
+
+ Short name
+
+
+
+ -
+
+
+
+ 0
+ 18
+
+
+
+
+
+
+
+ -
+
+
+ Long name
+
+
+
+ -
+
+
+
+ 0
+ 18
+
+
+
+
+
+
+
+ -
+
+
+ OpenSSL internal ID
+
+
+ Nid
+
+
+
+ -
+
+
+
+ 0
+ 18
+
+
+
+ OpenSSL internal ID
+
+
+
+
+
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+ QDialogButtonBox::Ok
+
+
+
+
+
+
+
+ CopyLabel
+ QLabel
+
+
+
+
+
+
+ buttonBox
+ accepted()
+ OidResolver
+ accept()
+
+
+ 227
+ 161
+
+
+ 157
+ 188
+
+
+
+
+ buttonBox
+ rejected()
+ OidResolver
+ reject()
+
+
+ 295
+ 167
+
+
+ 286
+ 188
+
+
+
+
+ input
+ textChanged(QString)
+ OidResolver
+ searchOid(QString)
+
+
+ 131
+ 65
+
+
+ 398
+ 12
+
+
+
+
+
+ searchOid(QString)
+
+
diff --git a/widgets/MW_menu.cpp b/widgets/MW_menu.cpp
index 44e4a8f8..c09defdb 100644
--- a/widgets/MW_menu.cpp
+++ b/widgets/MW_menu.cpp
@@ -17,7 +17,8 @@
#include "lib/func.h"
#include "lib/db_x509super.h"
#include "ui_Options.h"
-#include "widgets/hashBox.h"
+#include "hashBox.h"
+#include "OidResolver.h"
#include
#include
#include
@@ -36,7 +37,7 @@ public:
void MainWindow::init_menu()
{
static QMenu *file = NULL, *help = NULL, *import = NULL,
- *token = NULL, *languageMenu = NULL;
+ *token = NULL, *languageMenu = NULL, *extra = NULL;
static QActionGroup * langGroup = NULL;
QAction *a;
@@ -90,21 +91,11 @@ void MainWindow::init_menu()
file->addAction(tr("&Open DataBase"), this, SLOT(load_database()),
QKeySequence::Open);
file->addMenu(historyMenu);
- file->addAction(tr("Generate DH parameter"), this,
- SLOT(generateDHparam()));
file->addAction(tr("Set as default DataBase"), this,
SLOT(default_database()));
acList += file->addAction(tr("&Close DataBase"), this,
SLOT(close_database()), QKeySequence(QKeySequence::Close));
- acList += file->addAction(tr("&Dump DataBase"), this,
- SLOT(dump_database()));
- acList += file->addAction(tr("C&hange DataBase password"), this,
- SLOT(changeDbPass()));
- acList += file->addAction(tr("&Import old db_dump"), this,
- SLOT(import_dbdump()));
- acList += file->addAction(tr("&Undelete items"), this,
- SLOT(undelete()));
- file->addSeparator();
+
a = new QAction(tr("Options"), this);
connect(a, SIGNAL(triggered()), this, SLOT(setOptions()));
a->setMenuRole(QAction::PreferencesRole);
@@ -141,6 +132,19 @@ void MainWindow::init_menu()
token->addAction(tr("Init PIN"), this,
SLOT(initPin()) );
+ extra = menuBar()->addMenu(tr("Extra"));
+ acList += extra->addAction(tr("&Dump DataBase"), this,
+ SLOT(dump_database()));
+ acList += extra->addAction(tr("C&hange DataBase password"), this,
+ SLOT(changeDbPass()));
+ acList += extra->addAction(tr("&Import old db_dump"), this,
+ SLOT(import_dbdump()));
+ acList += extra->addAction(tr("&Undelete items"), this,
+ SLOT(undelete()));
+ extra->addAction(tr("Generate DH parameter"), this,
+ SLOT(generateDHparam()));
+ extra->addAction(tr("OID Resolver"), this, SLOT(resolveOID()));
+
help = menuBar()->addMenu(tr("&Help") );
help->addAction(tr("&Content"), this, SLOT(help()),
QKeySequence::HelpContents);
@@ -398,3 +402,10 @@ QString MainWindow::getOptFlags()
flags << "disable_netscape";
return flags.join(",");
}
+
+void MainWindow::resolveOID()
+{
+ OidResolver *o = new OidResolver(this);
+ o->exec();
+ delete o;
+}
diff --git a/widgets/MainWindow.h b/widgets/MainWindow.h
index 9ff03f83..05d53037 100644
--- a/widgets/MainWindow.h
+++ b/widgets/MainWindow.h
@@ -169,5 +169,6 @@ class MainWindow: public QMainWindow, public Ui::MainWindow
void initPin();
void generateDHparam();
void open_database(QAction* a);
+ void resolveOID();
};
#endif
diff --git a/widgets/Makefile b/widgets/Makefile
index 4d660994..83babf28 100644
--- a/widgets/Makefile
+++ b/widgets/Makefile
@@ -8,7 +8,8 @@ MOC_NAMES=MainWindow KeyDetail clicklabel XcaTreeView NewX509 \
validity v3ext distname CertDetail CertExtend PwDialog \
ImportMulti CrlDetail ExportDialog hashBox Options NewKey kvView \
NewCrl SearchPkcs11 RevocationList XcaProxyModel XcaHeaderView \
- KeyTreeView TempTreeView ReqTreeView X509SuperTreeView CertTreeView
+ KeyTreeView TempTreeView ReqTreeView X509SuperTreeView CertTreeView \
+ OidResolver
NAMES=$(MOC_NAMES) NewX509_ext MW_menu MW_help MW_database
OBJS=$(patsubst %,moc_%.o,$(MOC_NAMES)) $(patsubst %,%.o,$(NAMES))
diff --git a/widgets/OidResolver.cpp b/widgets/OidResolver.cpp
new file mode 100644
index 00000000..2a959754
--- /dev/null
+++ b/widgets/OidResolver.cpp
@@ -0,0 +1,52 @@
+/* vi: set sw=4 ts=4:
+ *
+ * Copyright (C) 2001 - 2012 Christian Hohnstaedt.
+ *
+ * All rights reserved.
+ */
+
+#include
+#include "OidResolver.h"
+#include "lib/base.h"
+#include "lib/func.h"
+#include "lib/exception.h"
+
+OidResolver::OidResolver(QWidget *parent)
+ :QDialog(parent)
+{
+ setWindowTitle(tr(XCA_TITLE));
+ setupUi(this);
+}
+
+void OidResolver::searchOid(QString s)
+{
+ bool ok;
+ int n;
+
+ s = s.trimmed();
+ n = s.toUInt(&ok);
+ if (!ok)
+ n = OBJ_txt2nid(CCHAR(s));
+ ign_openssl_error();
+ if (n == NID_undef) {
+ ln->clear();
+ sn->clear();
+ oid->clear();
+ nid->clear();
+ } else {
+ const ASN1_OBJECT *a = OBJ_nid2obj(n);
+ ln->setText(OBJ_nid2ln(n));
+ sn->setText(OBJ_nid2sn(n));
+ nid->setText(QString("%1").arg(n));
+ if (a) {
+ try {
+ oid->setText(OBJ_obj2QString(a, 1));
+ } catch (errorEx &e) {
+ oid->clear();
+ }
+ } else {
+ oid->clear();
+ }
+ }
+ ign_openssl_error();
+}
diff --git a/widgets/OidResolver.h b/widgets/OidResolver.h
new file mode 100644
index 00000000..8d42e7e2
--- /dev/null
+++ b/widgets/OidResolver.h
@@ -0,0 +1,24 @@
+/* vi: set sw=4 ts=4:
+ *
+ * Copyright (C) 2015 Christian Hohnstaedt.
+ *
+ * All rights reserved.
+ */
+
+#ifndef __OID_RESOLVER_H
+#define __OID_RESOLVER_H
+
+#include "ui_OidResolver.h"
+
+class OidResolver: public QDialog, public Ui::OidResolver
+{
+ Q_OBJECT
+
+ public:
+ OidResolver(QWidget *w);
+
+ public slots:
+ void searchOid(QString s);
+
+};
+#endif
diff --git a/xca.pro b/xca.pro
index 283b6ca5..88254bdd 100644
--- a/xca.pro
+++ b/xca.pro
@@ -89,6 +89,7 @@ HEADERS += local.h \
widgets/TempTreeView.h \
widgets/X509SuperTreeView.h \
widgets/XcaHeaderView.h \
+ widgets/OidResolver.h \
widgets/XcaProxyModel.h
FORMS += ui/About.ui \
@@ -111,6 +112,7 @@ FORMS += ui/About.ui \
ui/TrustState.ui \
ui/SearchPkcs11.ui \
ui/v3ext.ui \
+ ui/OidResolver.ui \
ui/RevocationList.ui
SOURCES += lib/asn1int.cpp \
@@ -182,6 +184,7 @@ SOURCES += lib/asn1int.cpp \
widgets/TempTreeView.cpp \
widgets/X509SuperTreeView.cpp \
widgets/XcaHeaderView.cpp \
+ widgets/OidResolver.cpp \
widgets/XcaProxyModel.cpp
TRANSLATIONS += lang/xca_de.ts lang/xca_es.ts lang/xca_ru.ts lang/xca.ts lang/xca_tr.ts lang/xca_fr.ts lang/xca_hr.ts