mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 10:22:48 +00:00
generic: get rid of KLibrary
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
89e60600f8
commit
376484dff8
19 changed files with 203 additions and 443 deletions
|
@ -193,7 +193,6 @@ install(
|
|||
KKeySequenceWidget
|
||||
KLanguageButton
|
||||
KLed
|
||||
KLibrary
|
||||
KLineEdit
|
||||
KLinkItemSelectionModel
|
||||
KListWidget
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
#include "../klibrary.h"
|
|
@ -19,17 +19,16 @@
|
|||
#include "templateinterface.h"
|
||||
#include "document.h"
|
||||
#include "view.h"
|
||||
#include <QtCore/QString>
|
||||
#include <QString>
|
||||
#include <QDateTime>
|
||||
#include <QRegExp>
|
||||
#include <QLibrary>
|
||||
#include <klocale.h>
|
||||
#include <kglobal.h>
|
||||
#include <QtCore/qdatetime.h>
|
||||
#include <QtCore/QRegExp>
|
||||
#include <kmessagebox.h>
|
||||
#include <kcalendarsystem.h>
|
||||
#include <unistd.h>
|
||||
#include <klibrary.h>
|
||||
|
||||
#include <kdebug.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#define DUMMY_VALUE "!KTE:TEMPLATEHANDLER_DUMMY_VALUE!"
|
||||
|
||||
|
@ -59,8 +58,8 @@ bool TemplateInterface::expandMacros( QMap<QString, QString> &map, QWidget *pare
|
|||
{
|
||||
if (kabcbridgecall==0)
|
||||
{
|
||||
KLibrary lib(QLatin1String("ktexteditorkabcbridge"));
|
||||
kabcbridgecall=(kabcbridgecalltype)lib.resolveFunction("ktexteditorkabcbridge");
|
||||
QLibrary lib(QLatin1String("ktexteditorkabcbridge"));
|
||||
kabcbridgecall=(kabcbridgecalltype)lib.resolve("ktexteditorkabcbridge");
|
||||
if (kabcbridgecall == 0)
|
||||
{
|
||||
KMessageBox::sorry(parentWindow,i18n("The template needs information about you, which is stored in your address book.\nHowever, the required plugin could not be loaded.\n\nPlease install the KDEPIM/Kontact package for your system."));
|
||||
|
|
|
@ -37,8 +37,7 @@
|
|||
#include <QStringList>
|
||||
|
||||
// KDE includes
|
||||
|
||||
#include <klibrary.h>
|
||||
#include <kglobal.h>
|
||||
|
||||
// LibRaw includes
|
||||
|
||||
|
|
|
@ -284,7 +284,6 @@ set(kdecore_LIB_SRCS
|
|||
util/kdedmodule.cpp
|
||||
util/kdeversion.cpp
|
||||
util/klauncher_iface.cpp
|
||||
util/klibrary.cpp
|
||||
util/kmacroexpander.cpp
|
||||
util/kpluginfactory.cpp
|
||||
util/kpluginloader.cpp
|
||||
|
@ -514,7 +513,6 @@ install(
|
|||
util/kde_file.h
|
||||
util/kdedmodule.h
|
||||
util/klauncher_iface.h
|
||||
util/klibrary.h
|
||||
util/kmacroexpander.h
|
||||
util/kexportplugin.h
|
||||
util/kpluginfactory.h
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
#include <kdebug.h>
|
||||
#include <klocale.h>
|
||||
#include <klocale_p.h>
|
||||
#include <klibrary.h>
|
||||
#include <kstandarddirs.h>
|
||||
#include <kuitsemantics_p.h>
|
||||
#include "kcatalogname_p.h"
|
||||
|
|
|
@ -1,120 +0,0 @@
|
|||
/* This file is part of the KDE libraries
|
||||
Copyright (C) 1999 Torben Weis <weis@kde.org>
|
||||
Copyright (C) 2000 Michael Matz <matz@kde.org>
|
||||
Copyright (C) 2007 Bernhard Loos <nhuh.put@web.de.org>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License version 2 as published by the Free Software Foundation.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
#include "klibrary.h"
|
||||
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QPointer>
|
||||
|
||||
#include <kcomponentdata.h>
|
||||
#include <kstandarddirs.h>
|
||||
#include <kpluginfactory.h>
|
||||
#include <kdebug.h>
|
||||
|
||||
extern QString makeLibName( const QString &libname );
|
||||
extern QString findLibraryInternal(const QString &name, const KComponentData &cData);
|
||||
|
||||
int kLibraryDebugArea() {
|
||||
static int s_area = KDebug::registerArea("kdecore (KLibrary)");
|
||||
return s_area;
|
||||
}
|
||||
|
||||
//static
|
||||
QString findLibrary(const QString &name, const KComponentData &cData)
|
||||
{
|
||||
return findLibraryInternal(name, cData);;
|
||||
}
|
||||
|
||||
|
||||
KLibrary::KLibrary(QObject *parent)
|
||||
: QLibrary(parent), d_ptr(0)
|
||||
{
|
||||
}
|
||||
|
||||
KLibrary::KLibrary(const QString &name, const KComponentData &cData, QObject *parent)
|
||||
: QLibrary(findLibrary(name, cData), parent), d_ptr(0)
|
||||
{
|
||||
}
|
||||
|
||||
KLibrary::KLibrary(const QString &name, int verNum, const KComponentData &cData, QObject *parent)
|
||||
: QLibrary(findLibrary(name, cData), verNum, parent), d_ptr(0)
|
||||
{
|
||||
}
|
||||
|
||||
KLibrary::~KLibrary()
|
||||
{
|
||||
}
|
||||
|
||||
static KPluginFactory *kde4Factory(KLibrary *lib)
|
||||
{
|
||||
const QByteArray symname("qt_plugin_instance");
|
||||
|
||||
typedef QObject* (*t_func)();
|
||||
t_func func = reinterpret_cast<t_func>(lib->resolveFunction(symname));
|
||||
if ( !func )
|
||||
{
|
||||
kDebug(kLibraryDebugArea()) << "The library" << lib->fileName() << "does not offer a qt_plugin_instance function.";
|
||||
return 0;
|
||||
}
|
||||
|
||||
QObject* instance = func();
|
||||
KPluginFactory *factory = qobject_cast<KPluginFactory *>(instance);
|
||||
|
||||
if( !factory )
|
||||
{
|
||||
if (instance)
|
||||
kDebug(kLibraryDebugArea()) << "Expected a KPluginFactory, got a" << instance->metaObject()->className();
|
||||
kDebug(kLibraryDebugArea()) << "The library" << lib->fileName() << "does not offer a KDE 4 compatible factory.";
|
||||
return 0;
|
||||
}
|
||||
return factory;
|
||||
}
|
||||
|
||||
// deprecated
|
||||
KPluginFactory* KLibrary::factory(const char* factoryname)
|
||||
{
|
||||
Q_UNUSED(factoryname);
|
||||
|
||||
if (fileName().isEmpty()) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return kde4Factory(this);
|
||||
}
|
||||
|
||||
KLibrary::void_function_ptr KLibrary::resolveFunction( const char* symname )
|
||||
{
|
||||
void *psym = resolve( symname );
|
||||
if (!psym)
|
||||
return 0;
|
||||
|
||||
// Cast the void* to non-pointer type first - it's not legal to
|
||||
// cast a pointer-to-object directly to a pointer-to-function.
|
||||
ptrdiff_t tmp = reinterpret_cast<ptrdiff_t>(psym);
|
||||
void_function_ptr sym = reinterpret_cast<void_function_ptr>(tmp);
|
||||
|
||||
return sym;
|
||||
}
|
||||
|
||||
void KLibrary::setFileName(const QString &name, const KComponentData &data)
|
||||
{
|
||||
QLibrary::setFileName(findLibrary(name, data));
|
||||
}
|
||||
|
||||
#include "moc_klibrary.cpp"
|
|
@ -1,76 +0,0 @@
|
|||
/* This file is part of the KDE libraries
|
||||
Copyright (C) 2007 Bernhard Loos <nhuh.put@web.de.org>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License version 2 as published by the Free Software Foundation.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
#ifndef KLIBRARY_H
|
||||
#define KLIBRARY_H
|
||||
|
||||
#include <kdecore_export.h>
|
||||
|
||||
#include <kglobal.h>
|
||||
|
||||
#include <QtCore/QLibrary>
|
||||
|
||||
class KLibraryPrivate;
|
||||
|
||||
class KPluginFactory;
|
||||
|
||||
/**
|
||||
* \class KLibrary klibrary.h <KLibrary>
|
||||
*
|
||||
* Thin wrapper around QLibrary; you should rarely use this directly, see KPluginLoader for higher-level loading of plugins.
|
||||
* KLibrary adds kde3-factory and kde4-factory support to QLibrary (for the deprecated KLibLoader)
|
||||
* KLibrary also searches libs in the kde search paths.
|
||||
*/
|
||||
class KDECORE_EXPORT KLibrary : public QLibrary
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(QString fileName READ fileName WRITE setFileName)
|
||||
public:
|
||||
typedef void (*void_function_ptr) ();
|
||||
|
||||
explicit KLibrary(QObject *parent = 0);
|
||||
explicit KLibrary(const QString &name, const KComponentData &cData = KGlobal::mainComponent(), QObject *parent = 0);
|
||||
KLibrary(const QString &name, int verNum, const KComponentData &cData = KGlobal::mainComponent(), QObject *parent = 0);
|
||||
|
||||
virtual ~KLibrary();
|
||||
|
||||
/**
|
||||
* Returns the factory of the library.
|
||||
* @param factoryname The postfix to the init_ symbol used to create the
|
||||
* factory object. It corresponds to the first parameter to
|
||||
* K_EXPORT_COMPONENT_FACTORY.
|
||||
* @return The factory of the library if there is any, otherwise 0
|
||||
* @deprecated use KPluginLoader::factory
|
||||
*/
|
||||
KDE_DEPRECATED KPluginFactory* factory( const char* factoryname = 0 );
|
||||
|
||||
/**
|
||||
* Looks up a symbol from the library. This is a very low level
|
||||
* function that you usually don't want to use.
|
||||
* @param name the name of the symbol to look up
|
||||
* @return the address of the symbol, or 0 if it does not exist
|
||||
*/
|
||||
void_function_ptr resolveFunction(const char *name);
|
||||
|
||||
void setFileName(const QString &name, const KComponentData &data = KGlobal::mainComponent());
|
||||
|
||||
bool unload() { return false; } //this is only temporary. i will remove it as soon as I have removed all dangerous users of it
|
||||
private:
|
||||
KLibraryPrivate *d_ptr;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -28,8 +28,6 @@
|
|||
|
||||
K_GLOBAL_STATIC(QObjectCleanupHandler, factorycleanup)
|
||||
|
||||
extern int kLibraryDebugArea();
|
||||
|
||||
KPluginFactory::KPluginFactory(const char *componentName, const char *catalogName, QObject *parent)
|
||||
: QObject(parent), d_ptr(new KPluginFactoryPrivate)
|
||||
{
|
||||
|
@ -86,7 +84,7 @@ void KPluginFactory::registerPlugin(const QString &keyword, const QMetaObject *m
|
|||
// we allow different interfaces to be registered without keyword
|
||||
if (!keyword.isEmpty()) {
|
||||
if (d->createInstanceHash.contains(keyword)) {
|
||||
kFatal(kLibraryDebugArea()) << "A plugin with the keyword" << keyword << "was already registered. A keyword must be unique!";
|
||||
kFatal() << "A plugin with the keyword" << keyword << "was already registered. A keyword must be unique!";
|
||||
}
|
||||
d->createInstanceHash.insert(keyword, KPluginFactoryPrivate::Plugin(metaObject, instanceFunction));
|
||||
} else {
|
||||
|
@ -97,7 +95,7 @@ void KPluginFactory::registerPlugin(const QString &keyword, const QMetaObject *m
|
|||
for (const QMetaObject *otherSuper = plugin.first->superClass(); otherSuper;
|
||||
otherSuper = otherSuper->superClass()) {
|
||||
if (superClass == otherSuper) {
|
||||
kFatal(kLibraryDebugArea()) << "Two plugins with the same interface(" << superClass->className() << ") were registered. Use keywords to identify the plugins.";
|
||||
kFatal() << "Two plugins with the same interface(" << superClass->className() << ") were registered. Use keywords to identify the plugins.";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -108,7 +106,7 @@ void KPluginFactory::registerPlugin(const QString &keyword, const QMetaObject *m
|
|||
for (const QMetaObject *otherSuper = metaObject->superClass(); otherSuper;
|
||||
otherSuper = otherSuper->superClass()) {
|
||||
if (superClass == otherSuper) {
|
||||
kFatal(kLibraryDebugArea()) << "Two plugins with the same interface(" << superClass->className() << ") were registered. Use keywords to identify the plugins.";
|
||||
kFatal() << "Two plugins with the same interface(" << superClass->className() << ") were registered. Use keywords to identify the plugins.";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -138,7 +136,7 @@ QObject *KPluginFactory::create(const char *iface, QWidget *parentWidget, QObjec
|
|||
for (const QMetaObject *current = plugin.first; current; current = current->superClass()) {
|
||||
if (0 == qstrcmp(iface, current->className())) {
|
||||
if (obj) {
|
||||
kFatal(kLibraryDebugArea()) << "ambiguous interface requested from a DSO containing more than one plugin";
|
||||
kFatal() << "ambiguous interface requested from a DSO containing more than one plugin";
|
||||
}
|
||||
obj = plugin.second(parentWidget, parent, args);
|
||||
break;
|
||||
|
|
|
@ -24,15 +24,12 @@
|
|||
#include <klocale.h>
|
||||
#include "kpluginfactory.h"
|
||||
#include <kservice.h>
|
||||
#include "klibrary.h"
|
||||
#include <kdebug.h>
|
||||
|
||||
#include <QtCore/QLibrary>
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QFileInfo>
|
||||
|
||||
extern int kLibraryDebugArea();
|
||||
|
||||
class KPluginLoaderPrivate
|
||||
{
|
||||
Q_DECLARE_PUBLIC(KPluginLoader)
|
||||
|
@ -51,7 +48,7 @@ protected:
|
|||
KDEPluginVerificationData *verificationData;
|
||||
QString errorString;
|
||||
|
||||
KLibrary *lib;
|
||||
QLibrary *lib;
|
||||
};
|
||||
|
||||
inline QString makeLibName( const QString &libname )
|
||||
|
@ -85,7 +82,7 @@ QString findLibraryInternal(const QString &name, const KComponentData &cData)
|
|||
bool hasPrefix = fileinfo.fileName().startsWith(QLatin1String("lib"));
|
||||
|
||||
if (hasPrefix)
|
||||
kDebug(kLibraryDebugArea()) << "plugins should not have a 'lib' prefix:" << libname;
|
||||
kDebug() << "plugins should not have a 'lib' prefix:" << libname;
|
||||
|
||||
// If it is a absolute path just return it
|
||||
if (!QDir::isRelativePath(libname))
|
||||
|
@ -105,7 +102,7 @@ QString findLibraryInternal(const QString &name, const KComponentData &cData)
|
|||
|
||||
libfile = cData.dirs()->findResource("lib", libname);
|
||||
if (!libfile.isEmpty()) {
|
||||
kDebug(kLibraryDebugArea()) << "library" << libname << "not found under 'module' but under 'lib'";
|
||||
kDebug() << "library" << libname << "not found under 'module' but under 'lib'";
|
||||
return libfile;
|
||||
}
|
||||
|
||||
|
@ -186,7 +183,7 @@ KPluginFactory *KPluginLoader::factory()
|
|||
KPluginFactory *factory = qobject_cast<KPluginFactory *>(obj);
|
||||
|
||||
if (factory == 0) {
|
||||
kDebug(kLibraryDebugArea()) << "Expected a KPluginFactory, got a" << obj->metaObject()->className();
|
||||
kDebug() << "Expected a KPluginFactory, got a" << obj->metaObject()->className();
|
||||
delete obj;
|
||||
d->errorString = i18n("The library %1 does not offer a KDE 4 compatible factory." , d->name);
|
||||
}
|
||||
|
@ -202,7 +199,7 @@ bool KPluginLoader::load()
|
|||
return true;
|
||||
|
||||
if (!QPluginLoader::load()) {
|
||||
d->lib = new KLibrary(d->name);
|
||||
d->lib = new QLibrary(d->name);
|
||||
if (d->lib->load())
|
||||
return true;
|
||||
|
||||
|
@ -224,7 +221,7 @@ bool KPluginLoader::load()
|
|||
return false;
|
||||
}
|
||||
} else {
|
||||
kDebug(kLibraryDebugArea()) << "The plugin" << d->name << "doesn't contain a kde_plugin_verification_data structure";
|
||||
kDebug() << "The plugin" << d->name << "doesn't contain a kde_plugin_verification_data structure";
|
||||
}
|
||||
|
||||
quint32 *version = (quint32 *) lib.resolve("kde_plugin_version");
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
#include <kapplication.h>
|
||||
#include <kcmdlineargs.h>
|
||||
#include <kaboutdata.h>
|
||||
#include <klibrary.h>
|
||||
#include <klocale.h>
|
||||
#include <kglobal.h>
|
||||
#include <kconfig.h>
|
||||
|
@ -415,7 +414,7 @@ QStringList Kded::loadedModules()
|
|||
void Kded::slotKDEDModuleRemoved(KDEDModule *module)
|
||||
{
|
||||
m_modules.remove(module->moduleName());
|
||||
//KLibrary *lib = m_libs.take(module->moduleName());
|
||||
//QLibrary *lib = m_libs.take(module->moduleName());
|
||||
//if (lib)
|
||||
// lib->unload();
|
||||
}
|
||||
|
|
|
@ -197,7 +197,7 @@ private:
|
|||
bool m_recreateBusy;
|
||||
|
||||
QHash<QString,KDEDModule *> m_modules;
|
||||
//QHash<QString,KLibrary *> m_libs;
|
||||
//QHash<QString,QLibrary *> m_libs;
|
||||
QHash<QString,QObject *> m_dontLoad;
|
||||
|
||||
//window id tracking, with a QDBusServiceWatcher to remove them as needed
|
||||
|
|
|
@ -54,7 +54,6 @@
|
|||
#include <QtCore/QRegExp>
|
||||
#include <QtGui/QFont>
|
||||
#include <kcomponentdata.h>
|
||||
#include <klibrary.h>
|
||||
#include <kdemacros.h>
|
||||
#include <kstandarddirs.h>
|
||||
#include <kglobal.h>
|
||||
|
@ -64,6 +63,7 @@
|
|||
#include <kdebug.h>
|
||||
#include <kde_file.h>
|
||||
#include <ksavefile.h>
|
||||
#include <kpluginloader.h>
|
||||
|
||||
#ifdef Q_OS_LINUX
|
||||
#include <sys/prctl.h>
|
||||
|
@ -421,7 +421,7 @@ static pid_t launch(int argc, const char *_name, const char *args,
|
|||
name = _name;
|
||||
lib = QFile::decodeName(name);
|
||||
exec = name;
|
||||
KLibrary klib(lib, *s_instance );
|
||||
KPluginLoader klib(lib, *s_instance );
|
||||
libpath = klib.fileName();
|
||||
execpath = execpath_avoid_loops(exec, envc, envs, avoid_loops);
|
||||
} else {
|
||||
|
|
|
@ -44,7 +44,6 @@
|
|||
#include <kconfig.h>
|
||||
#include <kdebug.h>
|
||||
#include <kde_file.h>
|
||||
#include <klibrary.h>
|
||||
#include <klocale.h>
|
||||
#include <kprotocolmanager.h>
|
||||
#include <kprotocolinfo.h>
|
||||
|
@ -1115,15 +1114,16 @@ KLauncher::requestSlave(const QString &protocol,
|
|||
kde_safe_write(kdeinitSocket, &request_header, sizeof(request_header));
|
||||
}
|
||||
if (mSlaveValgrind == protocol) {
|
||||
KLibrary lib(name, KGlobal::mainComponent());
|
||||
KPluginLoader lib(name, KGlobal::mainComponent());
|
||||
arg_list.prepend(lib.fileName());
|
||||
arg_list.prepend(KStandardDirs::locate("exe", QString::fromLatin1("kioslave")));
|
||||
name = QString::fromLatin1("valgrind");
|
||||
|
||||
if (!mSlaveValgrindSkin.isEmpty()) {
|
||||
arg_list.prepend(QLatin1String("--tool=") + mSlaveValgrindSkin);
|
||||
} else
|
||||
arg_list.prepend(QLatin1String("--tool=memcheck"));
|
||||
} else {
|
||||
arg_list.prepend(QLatin1String("--tool=memcheck"));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
KLaunchRequest *request = new KLaunchRequest;
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
#include <kstandarddirs.h>
|
||||
#include <ktoolinvocation.h>
|
||||
#include <klauncher_iface.h>
|
||||
#include <klibrary.h>
|
||||
|
||||
#include "dataprotocol.h"
|
||||
#include "kservice.h"
|
||||
|
@ -436,7 +435,7 @@ Slave* Slave::createSlave( const QString &protocol, const KUrl& url, int& error,
|
|||
delete slave;
|
||||
return 0;
|
||||
}
|
||||
KLibrary lib(_name, KGlobal::mainComponent());
|
||||
KPluginLoader lib(_name, KGlobal::mainComponent());
|
||||
QString lib_path = lib.fileName();
|
||||
if (lib_path.isEmpty())
|
||||
{
|
||||
|
|
|
@ -28,11 +28,10 @@
|
|||
#include <kdebug.h>
|
||||
#include <kconfig.h>
|
||||
#include <kconfiggroup.h>
|
||||
#include <klibrary.h>
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QtCore/QFile>
|
||||
#include <QtCore/QRegExp>
|
||||
|
||||
#include <QtCore/QLibrary>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
@ -210,8 +209,8 @@ public:
|
|||
: sslLib(0), cryptoLib(0), ok(false)
|
||||
{}
|
||||
|
||||
KLibrary *sslLib;
|
||||
KLibrary *cryptoLib;
|
||||
QLibrary *sslLib;
|
||||
QLibrary *cryptoLib;
|
||||
bool ok;
|
||||
|
||||
static KOpenSSLProxy *sSelf;
|
||||
|
@ -300,7 +299,7 @@ KOpenSSLProxy::KOpenSSLProxy()
|
|||
{
|
||||
QString libname = findMostRecentLib("/usr/lib" KDELIBSUFF, "crypto");
|
||||
if (!libname.isNull()) {
|
||||
d->cryptoLib = new KLibrary(libname);
|
||||
d->cryptoLib = new QLibrary(libname);
|
||||
d->cryptoLib->setLoadHints(QLibrary::ExportExternalSymbolsHint);
|
||||
if (!d->cryptoLib->load()) {
|
||||
delete d->cryptoLib;
|
||||
|
@ -366,7 +365,7 @@ KOpenSSLProxy::KOpenSSLProxy()
|
|||
QString tmpStr(alib.toLatin1().constData());
|
||||
tmpStr.remove(QRegExp("\\(.*\\)"));
|
||||
if (!access(tmpStr.toLatin1(), R_OK)) {
|
||||
d->cryptoLib = new KLibrary(alib);
|
||||
d->cryptoLib = new QLibrary(alib);
|
||||
d->cryptoLib->setLoadHints(QLibrary::ExportExternalSymbolsHint);
|
||||
}
|
||||
if (d->cryptoLib && d->cryptoLib->load()) {
|
||||
|
@ -382,128 +381,128 @@ KOpenSSLProxy::KOpenSSLProxy()
|
|||
|
||||
if (d->cryptoLib) {
|
||||
#ifdef KSSL_HAVE_SSL
|
||||
K_X509_free = (void (*) (X509 *)) d->cryptoLib->resolveFunction("X509_free");
|
||||
K_RAND_egd = (int (*)(const char *)) d->cryptoLib->resolveFunction("RAND_egd");
|
||||
K_RAND_load_file = (int (*)(const char *, long)) d->cryptoLib->resolveFunction("RAND_load_file");
|
||||
K_RAND_file_name = (const char* (*)(char *, size_t)) d->cryptoLib->resolveFunction("RAND_file_name");
|
||||
K_RAND_write_file = (int (*)(const char *)) d->cryptoLib->resolveFunction("RAND_write_file");
|
||||
K_CRYPTO_free = (void (*) (void *)) d->cryptoLib->resolveFunction("CRYPTO_free");
|
||||
K_d2i_X509 = (X509 * (*)(X509 **,unsigned char **,long)) d->cryptoLib->resolveFunction("d2i_X509");
|
||||
K_i2d_X509 = (int (*)(X509 *,unsigned char **)) d->cryptoLib->resolveFunction("i2d_X509");
|
||||
K_X509_cmp = (int (*)(X509 *, X509 *)) d->cryptoLib->resolveFunction("X509_cmp");
|
||||
K_X509_STORE_CTX_new = (X509_STORE_CTX * (*) (void)) d->cryptoLib->resolveFunction("X509_STORE_CTX_new");
|
||||
K_X509_STORE_CTX_free = (void (*) (X509_STORE_CTX *)) d->cryptoLib->resolveFunction("X509_STORE_CTX_free");
|
||||
K_X509_verify_cert = (int (*) (X509_STORE_CTX *)) d->cryptoLib->resolveFunction("X509_verify_cert");
|
||||
K_X509_STORE_new = (X509_STORE * (*) (void)) d->cryptoLib->resolveFunction("X509_STORE_new");
|
||||
K_X509_STORE_free = (void (*) (X509_STORE *)) d->cryptoLib->resolveFunction("X509_STORE_free");
|
||||
K_X509_NAME_oneline = (char * (*) (X509_NAME *,char *,int)) d->cryptoLib->resolveFunction("X509_NAME_oneline");
|
||||
K_X509_get_subject_name = (X509_NAME * (*) (X509 *)) d->cryptoLib->resolveFunction("X509_get_subject_name");
|
||||
K_X509_get_issuer_name = (X509_NAME * (*) (X509 *)) d->cryptoLib->resolveFunction("X509_get_issuer_name");
|
||||
K_X509_STORE_add_lookup = (X509_LOOKUP *(*) (X509_STORE *, X509_LOOKUP_METHOD *)) d->cryptoLib->resolveFunction("X509_STORE_add_lookup");
|
||||
K_X509_LOOKUP_file = (X509_LOOKUP_METHOD *(*)(void)) d->cryptoLib->resolveFunction("X509_LOOKUP_file");
|
||||
K_X509_LOOKUP_free = (void (*)(X509_LOOKUP *)) d->cryptoLib->resolveFunction("X509_LOOKUP_free");
|
||||
K_X509_LOOKUP_ctrl = (int (*)(X509_LOOKUP *, int, const char *, long, char **)) d->cryptoLib->resolveFunction("X509_LOOKUP_ctrl");
|
||||
K_X509_STORE_CTX_init = (void (*)(X509_STORE_CTX *, X509_STORE *, X509 *, STACK_OF(X509) *)) d->cryptoLib->resolveFunction("X509_STORE_CTX_init");
|
||||
K_X509_dup = (X509* (*)(X509*)) d->cryptoLib->resolveFunction("X509_dup");
|
||||
K_BIO_s_mem = (BIO_METHOD *(*) (void)) d->cryptoLib->resolveFunction("BIO_s_mem");
|
||||
K_BIO_new = (BIO* (*)(BIO_METHOD *)) d->cryptoLib->resolveFunction("BIO_new");
|
||||
K_BIO_new_fp = (BIO* (*)(FILE*, int)) d->cryptoLib->resolveFunction("BIO_new_fp");
|
||||
K_BIO_new_mem_buf = (BIO* (*)(void *, int)) d->cryptoLib->resolveFunction("BIO_new_mem_buf");
|
||||
K_BIO_free = (int (*)(BIO*)) d->cryptoLib->resolveFunction("BIO_free");
|
||||
K_BIO_ctrl = (long (*) (BIO *,int,long,void *)) d->cryptoLib->resolveFunction("BIO_ctrl");
|
||||
K_BIO_write = (int (*) (BIO *b, const void *data, int len)) d->cryptoLib->resolveFunction("BIO_write");
|
||||
K_PEM_ASN1_write_bio = (int (*)(int (*)(), const char *,BIO*, char*, const EVP_CIPHER *, unsigned char *, int, pem_password_cb *, void *)) d->cryptoLib->resolveFunction("PEM_ASN1_write_bio");
|
||||
K_X509_free = (void (*) (X509 *)) d->cryptoLib->resolve("X509_free");
|
||||
K_RAND_egd = (int (*)(const char *)) d->cryptoLib->resolve("RAND_egd");
|
||||
K_RAND_load_file = (int (*)(const char *, long)) d->cryptoLib->resolve("RAND_load_file");
|
||||
K_RAND_file_name = (const char* (*)(char *, size_t)) d->cryptoLib->resolve("RAND_file_name");
|
||||
K_RAND_write_file = (int (*)(const char *)) d->cryptoLib->resolve("RAND_write_file");
|
||||
K_CRYPTO_free = (void (*) (void *)) d->cryptoLib->resolve("CRYPTO_free");
|
||||
K_d2i_X509 = (X509 * (*)(X509 **,unsigned char **,long)) d->cryptoLib->resolve("d2i_X509");
|
||||
K_i2d_X509 = (int (*)(X509 *,unsigned char **)) d->cryptoLib->resolve("i2d_X509");
|
||||
K_X509_cmp = (int (*)(X509 *, X509 *)) d->cryptoLib->resolve("X509_cmp");
|
||||
K_X509_STORE_CTX_new = (X509_STORE_CTX * (*) (void)) d->cryptoLib->resolve("X509_STORE_CTX_new");
|
||||
K_X509_STORE_CTX_free = (void (*) (X509_STORE_CTX *)) d->cryptoLib->resolve("X509_STORE_CTX_free");
|
||||
K_X509_verify_cert = (int (*) (X509_STORE_CTX *)) d->cryptoLib->resolve("X509_verify_cert");
|
||||
K_X509_STORE_new = (X509_STORE * (*) (void)) d->cryptoLib->resolve("X509_STORE_new");
|
||||
K_X509_STORE_free = (void (*) (X509_STORE *)) d->cryptoLib->resolve("X509_STORE_free");
|
||||
K_X509_NAME_oneline = (char * (*) (X509_NAME *,char *,int)) d->cryptoLib->resolve("X509_NAME_oneline");
|
||||
K_X509_get_subject_name = (X509_NAME * (*) (X509 *)) d->cryptoLib->resolve("X509_get_subject_name");
|
||||
K_X509_get_issuer_name = (X509_NAME * (*) (X509 *)) d->cryptoLib->resolve("X509_get_issuer_name");
|
||||
K_X509_STORE_add_lookup = (X509_LOOKUP *(*) (X509_STORE *, X509_LOOKUP_METHOD *)) d->cryptoLib->resolve("X509_STORE_add_lookup");
|
||||
K_X509_LOOKUP_file = (X509_LOOKUP_METHOD *(*)(void)) d->cryptoLib->resolve("X509_LOOKUP_file");
|
||||
K_X509_LOOKUP_free = (void (*)(X509_LOOKUP *)) d->cryptoLib->resolve("X509_LOOKUP_free");
|
||||
K_X509_LOOKUP_ctrl = (int (*)(X509_LOOKUP *, int, const char *, long, char **)) d->cryptoLib->resolve("X509_LOOKUP_ctrl");
|
||||
K_X509_STORE_CTX_init = (void (*)(X509_STORE_CTX *, X509_STORE *, X509 *, STACK_OF(X509) *)) d->cryptoLib->resolve("X509_STORE_CTX_init");
|
||||
K_X509_dup = (X509* (*)(X509*)) d->cryptoLib->resolve("X509_dup");
|
||||
K_BIO_s_mem = (BIO_METHOD *(*) (void)) d->cryptoLib->resolve("BIO_s_mem");
|
||||
K_BIO_new = (BIO* (*)(BIO_METHOD *)) d->cryptoLib->resolve("BIO_new");
|
||||
K_BIO_new_fp = (BIO* (*)(FILE*, int)) d->cryptoLib->resolve("BIO_new_fp");
|
||||
K_BIO_new_mem_buf = (BIO* (*)(void *, int)) d->cryptoLib->resolve("BIO_new_mem_buf");
|
||||
K_BIO_free = (int (*)(BIO*)) d->cryptoLib->resolve("BIO_free");
|
||||
K_BIO_ctrl = (long (*) (BIO *,int,long,void *)) d->cryptoLib->resolve("BIO_ctrl");
|
||||
K_BIO_write = (int (*) (BIO *b, const void *data, int len)) d->cryptoLib->resolve("BIO_write");
|
||||
K_PEM_ASN1_write_bio = (int (*)(int (*)(), const char *,BIO*, char*, const EVP_CIPHER *, unsigned char *, int, pem_password_cb *, void *)) d->cryptoLib->resolve("PEM_ASN1_write_bio");
|
||||
K_ASN1_item_i2d_fp = (int (*)(ASN1_ITEM *, FILE*, unsigned char *))
|
||||
d->cryptoLib->resolveFunction("ASN1_item_i2d_fp");
|
||||
K_NETSCAPE_X509_it = (ASN1_ITEM *) d->cryptoLib->resolveFunction("NETSCAPE_X509_it");
|
||||
K_X509_print_fp = (int (*)(FILE*, X509*)) d->cryptoLib->resolveFunction("X509_print_fp");
|
||||
K_i2d_PKCS12 = (int (*)(PKCS12*, unsigned char**)) d->cryptoLib->resolveFunction("i2d_PKCS12");
|
||||
K_i2d_PKCS12_fp = (int (*)(FILE *, PKCS12*)) d->cryptoLib->resolveFunction("i2d_PKCS12_fp");
|
||||
K_PKCS12_newpass = (int (*)(PKCS12*, char*, char*)) d->cryptoLib->resolveFunction("PKCS12_newpass");
|
||||
K_d2i_PKCS12_fp = (PKCS12* (*)(FILE*, PKCS12**)) d->cryptoLib->resolveFunction("d2i_PKCS12_fp");
|
||||
K_PKCS12_new = (PKCS12* (*)()) d->cryptoLib->resolveFunction("PKCS12_new");
|
||||
K_PKCS12_free = (void (*)(PKCS12 *)) d->cryptoLib->resolveFunction("PKCS12_free");
|
||||
d->cryptoLib->resolve("ASN1_item_i2d_fp");
|
||||
K_NETSCAPE_X509_it = (ASN1_ITEM *) d->cryptoLib->resolve("NETSCAPE_X509_it");
|
||||
K_X509_print_fp = (int (*)(FILE*, X509*)) d->cryptoLib->resolve("X509_print_fp");
|
||||
K_i2d_PKCS12 = (int (*)(PKCS12*, unsigned char**)) d->cryptoLib->resolve("i2d_PKCS12");
|
||||
K_i2d_PKCS12_fp = (int (*)(FILE *, PKCS12*)) d->cryptoLib->resolve("i2d_PKCS12_fp");
|
||||
K_PKCS12_newpass = (int (*)(PKCS12*, char*, char*)) d->cryptoLib->resolve("PKCS12_newpass");
|
||||
K_d2i_PKCS12_fp = (PKCS12* (*)(FILE*, PKCS12**)) d->cryptoLib->resolve("d2i_PKCS12_fp");
|
||||
K_PKCS12_new = (PKCS12* (*)()) d->cryptoLib->resolve("PKCS12_new");
|
||||
K_PKCS12_free = (void (*)(PKCS12 *)) d->cryptoLib->resolve("PKCS12_free");
|
||||
K_PKCS12_parse = (int (*)(PKCS12*, const char *, EVP_PKEY**,
|
||||
X509**, STACK_OF(X509)**)) d->cryptoLib->resolveFunction("PKCS12_parse");
|
||||
K_EVP_PKEY_free = (void (*) (EVP_PKEY *)) d->cryptoLib->resolveFunction("EVP_PKEY_free");
|
||||
K_EVP_PKEY_new = (EVP_PKEY* (*)()) d->cryptoLib->resolveFunction("EVP_PKEY_new");
|
||||
K_X509_REQ_free = (void (*)(X509_REQ*)) d->cryptoLib->resolveFunction("X509_REQ_free");
|
||||
K_X509_REQ_new = (X509_REQ* (*)()) d->cryptoLib->resolveFunction("X509_REQ_new");
|
||||
K_X509_STORE_CTX_set_chain = (void (*)(X509_STORE_CTX *, STACK_OF(X509)*)) d->cryptoLib->resolveFunction("X509_STORE_CTX_set_chain");
|
||||
K_X509_STORE_CTX_set_purpose = (void (*)(X509_STORE_CTX *, int)) d->cryptoLib->resolveFunction("X509_STORE_CTX_set_purpose");
|
||||
K_sk_free = (void (*) (STACK *)) d->cryptoLib->resolveFunction("sk_free");
|
||||
K_sk_num = (int (*) (STACK *)) d->cryptoLib->resolveFunction("sk_num");
|
||||
K_sk_pop = (char* (*) (STACK *)) d->cryptoLib->resolveFunction("sk_pop");
|
||||
K_sk_value = (char* (*) (STACK *, int)) d->cryptoLib->resolveFunction("sk_value");
|
||||
K_sk_new = (STACK* (*) (int (*)())) d->cryptoLib->resolveFunction("sk_new");
|
||||
K_sk_push = (int (*) (STACK*, char*)) d->cryptoLib->resolveFunction("sk_push");
|
||||
K_sk_dup = (STACK* (*) (STACK *)) d->cryptoLib->resolveFunction("sk_dup");
|
||||
K_i2s_ASN1_INTEGER = (char *(*) (X509V3_EXT_METHOD *, ASN1_INTEGER *)) d->cryptoLib->resolveFunction("i2s_ASN1_INTEGER");
|
||||
K_X509_get_serialNumber = (ASN1_INTEGER * (*) (X509 *)) d->cryptoLib->resolveFunction("X509_get_serialNumber");
|
||||
K_X509_get_pubkey = (EVP_PKEY *(*)(X509 *)) d->cryptoLib->resolveFunction("X509_get_pubkey");
|
||||
K_i2d_PublicKey = (int (*)(EVP_PKEY *, unsigned char **)) d->cryptoLib->resolveFunction("i2d_PublicKey");
|
||||
K_X509_check_private_key = (int (*)(X509 *, EVP_PKEY *)) d->cryptoLib->resolveFunction("X509_check_private_key");
|
||||
K_BN_bn2hex = (char *(*)(const BIGNUM *)) d->cryptoLib->resolveFunction("BN_bn2hex");
|
||||
K_X509_digest = (int (*)(const X509 *,const EVP_MD *, unsigned char *, unsigned int *)) d->cryptoLib->resolveFunction("X509_digest");
|
||||
K_EVP_md5 = (EVP_MD *(*)()) d->cryptoLib->resolveFunction("EVP_md5");
|
||||
K_ASN1_INTEGER_free = (void (*)(ASN1_INTEGER *)) d->cryptoLib->resolveFunction("ASN1_INTEGER_free");
|
||||
K_OBJ_obj2nid = (int (*)(ASN1_OBJECT *)) d->cryptoLib->resolveFunction("OBJ_obj2nid");
|
||||
K_OBJ_nid2ln = (const char *(*)(int)) d->cryptoLib->resolveFunction("OBJ_nid2ln");
|
||||
K_X509_get_ext_count = (int (*)(X509*)) d->cryptoLib->resolveFunction("X509_get_ext_count");
|
||||
K_X509_get_ext_by_NID = (int (*)(X509*,int,int)) d->cryptoLib->resolveFunction("X509_get_ext_by_NID");
|
||||
K_X509_get_ext_by_OBJ = (int (*)(X509*,ASN1_OBJECT*,int)) d->cryptoLib->resolveFunction("X509_get_ext_by_OBJ");
|
||||
K_X509_get_ext = (X509_EXTENSION* (*)(X509*,int)) d->cryptoLib->resolveFunction("X509_get_ext");
|
||||
K_X509_delete_ext = (X509_EXTENSION* (*)(X509*,int)) d->cryptoLib->resolveFunction("X509_delete_ext");
|
||||
K_X509_add_ext = (int (*)(X509*,X509_EXTENSION*,int)) d->cryptoLib->resolveFunction("X509_add_ext");
|
||||
K_X509_get_ext_d2i = (void* (*)(X509*,int,int*,int*)) d->cryptoLib->resolveFunction("X509_get_ext_d2i");
|
||||
K_i2s_ASN1_OCTET_STRING = (char *(*)(X509V3_EXT_METHOD*,ASN1_OCTET_STRING*)) d->cryptoLib->resolveFunction("i2s_ASN1_OCTET_STRING");
|
||||
K_ASN1_BIT_STRING_get_bit = (int (*)(ASN1_BIT_STRING*,int)) d->cryptoLib->resolveFunction("ASN1_BIT_STRING_get_bit");
|
||||
K_PKCS7_new = (PKCS7 *(*)()) d->cryptoLib->resolveFunction("PKCS7_new");
|
||||
K_PKCS7_free = (void (*)(PKCS7*)) d->cryptoLib->resolveFunction("PKCS7_free");
|
||||
K_PKCS7_content_free = (void (*)(PKCS7*)) d->cryptoLib->resolveFunction("PKCS7_content_free");
|
||||
K_i2d_PKCS7 = (int (*)(PKCS7*, unsigned char**)) d->cryptoLib->resolveFunction("i2d_PKCS7");
|
||||
K_i2d_PKCS7_fp = (int (*)(FILE*,PKCS7*)) d->cryptoLib->resolveFunction("i2d_PKCS7_fp");
|
||||
K_i2d_PKCS7_bio = (int (*)(BIO *bp,PKCS7 *p7)) d->cryptoLib->resolveFunction("i2d_PKCS7_bio");
|
||||
K_d2i_PKCS7 = (PKCS7* (*)(PKCS7**,unsigned char**,long)) d->cryptoLib->resolveFunction("d2i_PKCS7");
|
||||
K_d2i_PKCS7_fp = (PKCS7 *(*)(FILE *,PKCS7**)) d->cryptoLib->resolveFunction("d2i_PKCS7_fp");
|
||||
K_d2i_PKCS7_bio = (PKCS7 *(*)(BIO *bp,PKCS7 **p7)) d->cryptoLib->resolveFunction("d2i_PKCS7_bio");
|
||||
K_PKCS7_dup = (PKCS7* (*)(PKCS7*)) d->cryptoLib->resolveFunction("PKCS7_dup");
|
||||
K_PKCS7_sign = (PKCS7 *(*)(X509*, EVP_PKEY*, STACK_OF(X509)*, BIO*, int)) d->cryptoLib->resolveFunction("PKCS7_sign");
|
||||
K_PKCS7_verify = (int (*)(PKCS7*,STACK_OF(X509)*,X509_STORE*,BIO*,BIO*,int)) d->cryptoLib->resolveFunction("PKCS7_verify");
|
||||
K_PKCS7_get0_signers = (STACK_OF(X509) *(*)(PKCS7 *, STACK_OF(X509) *, int)) d->cryptoLib->resolveFunction("PKCS7_get0_signers");
|
||||
K_PKCS7_encrypt = (PKCS7* (*)(STACK_OF(X509) *, BIO *, EVP_CIPHER *, int)) d->cryptoLib->resolveFunction("PKCS7_encrypt");
|
||||
K_PKCS7_decrypt = (int (*)(PKCS7 *, EVP_PKEY *, X509 *, BIO *, int)) d->cryptoLib->resolveFunction("PKCS7_decrypt");
|
||||
K_PEM_X509_INFO_read = (STACK_OF(X509_INFO) *(*)(FILE*, STACK_OF(X509_INFO)*, pem_password_cb*, void *)) d->cryptoLib->resolveFunction("PEM_X509_INFO_read");
|
||||
K_ASN1_d2i_fp = (char *(*)(char *(*)(),char *(*)(),FILE*,unsigned char**)) d->cryptoLib->resolveFunction("ASN1_d2i_fp");
|
||||
K_X509_new = (X509 *(*)()) d->cryptoLib->resolveFunction("X509_new");
|
||||
K_X509_PURPOSE_get_count = (int (*)()) d->cryptoLib->resolveFunction("X509_PURPOSE_get_count");
|
||||
K_X509_PURPOSE_get_id = (int (*)(X509_PURPOSE *)) d->cryptoLib->resolveFunction("X509_PURPOSE_get_id");
|
||||
K_X509_check_purpose = (int (*)(X509*,int,int)) d->cryptoLib->resolveFunction("X509_check_purpose");
|
||||
K_X509_PURPOSE_get0 = (X509_PURPOSE *(*)(int)) d->cryptoLib->resolveFunction("X509_PURPOSE_get0");
|
||||
K_EVP_PKEY_assign = (int (*)(EVP_PKEY*, int, char*)) d->cryptoLib->resolveFunction("EVP_PKEY_assign");
|
||||
K_X509_REQ_set_pubkey = (int (*)(X509_REQ*, EVP_PKEY*)) d->cryptoLib->resolveFunction("X509_REQ_set_pubkey");
|
||||
K_RSA_generate_key = (RSA* (*)(int, unsigned long, void (*)(int,int,void *), void *)) d->cryptoLib->resolveFunction("RSA_generate_key");
|
||||
K_i2d_X509_REQ_fp = (int (*)(FILE *, X509_REQ *)) d->cryptoLib->resolveFunction("i2d_X509_REQ_fp");
|
||||
K_ERR_clear_error = (void (*)()) d->cryptoLib->resolveFunction("ERR_clear_error");
|
||||
K_ERR_get_error = (unsigned long (*)()) d->cryptoLib->resolveFunction("ERR_get_error");
|
||||
K_ERR_print_errors_fp = (void (*)(FILE*)) d->cryptoLib->resolveFunction("ERR_print_errors_fp");
|
||||
K_X509_get1_email = (STACK *(*)(X509 *x)) d->cryptoLib->resolveFunction("X509_get1_email");
|
||||
K_X509_email_free = (void (*)(STACK *sk)) d->cryptoLib->resolveFunction("X509_email_free");
|
||||
K_EVP_des_ede3_cbc = (EVP_CIPHER *(*)()) d->cryptoLib->resolveFunction("EVP_des_ede3_cbc");
|
||||
K_EVP_des_cbc = (EVP_CIPHER *(*)()) d->cryptoLib->resolveFunction("EVP_des_cbc");
|
||||
K_EVP_rc2_cbc = (EVP_CIPHER *(*)()) d->cryptoLib->resolveFunction("EVP_rc2_cbc");
|
||||
K_EVP_rc2_64_cbc = (EVP_CIPHER *(*)()) d->cryptoLib->resolveFunction("EVP_rc2_64_cbc");
|
||||
K_EVP_rc2_40_cbc = (EVP_CIPHER *(*)()) d->cryptoLib->resolveFunction("EVP_rc2_40_cbc");
|
||||
K_i2d_PrivateKey_fp = (int (*)(FILE*,EVP_PKEY*)) d->cryptoLib->resolveFunction("i2d_PrivateKey_fp");
|
||||
K_i2d_PKCS8PrivateKey_fp = (int (*)(FILE*, EVP_PKEY*, const EVP_CIPHER*, char*, int, pem_password_cb*, void*)) d->cryptoLib->resolveFunction("i2d_PKCS8PrivateKey_fp");
|
||||
K_RSA_free = (void (*)(RSA*)) d->cryptoLib->resolveFunction("RSA_free");
|
||||
K_EVP_bf_cbc = (EVP_CIPHER *(*)()) d->cryptoLib->resolveFunction("EVP_bf_cbc");
|
||||
K_X509_REQ_sign = (int (*)(X509_REQ*, EVP_PKEY*, const EVP_MD*)) d->cryptoLib->resolveFunction("X509_REQ_sign");
|
||||
K_X509_NAME_add_entry_by_txt = (int (*)(X509_NAME*, char*, int, unsigned char*, int, int, int)) d->cryptoLib->resolveFunction("X509_NAME_add_entry_by_txt");
|
||||
K_X509_NAME_new = (X509_NAME *(*)()) d->cryptoLib->resolveFunction("X509_NAME_new");
|
||||
K_X509_REQ_set_subject_name = (int (*)(X509_REQ*,X509_NAME*)) d->cryptoLib->resolveFunction("X509_REQ_set_subject_name");
|
||||
K_ASN1_STRING_data = (unsigned char *(*)(ASN1_STRING*)) d->cryptoLib->resolveFunction("ASN1_STRING_data");
|
||||
K_ASN1_STRING_length = (int (*)(ASN1_STRING*)) d->cryptoLib->resolveFunction("ASN1_STRING_length");
|
||||
X509**, STACK_OF(X509)**)) d->cryptoLib->resolve("PKCS12_parse");
|
||||
K_EVP_PKEY_free = (void (*) (EVP_PKEY *)) d->cryptoLib->resolve("EVP_PKEY_free");
|
||||
K_EVP_PKEY_new = (EVP_PKEY* (*)()) d->cryptoLib->resolve("EVP_PKEY_new");
|
||||
K_X509_REQ_free = (void (*)(X509_REQ*)) d->cryptoLib->resolve("X509_REQ_free");
|
||||
K_X509_REQ_new = (X509_REQ* (*)()) d->cryptoLib->resolve("X509_REQ_new");
|
||||
K_X509_STORE_CTX_set_chain = (void (*)(X509_STORE_CTX *, STACK_OF(X509)*)) d->cryptoLib->resolve("X509_STORE_CTX_set_chain");
|
||||
K_X509_STORE_CTX_set_purpose = (void (*)(X509_STORE_CTX *, int)) d->cryptoLib->resolve("X509_STORE_CTX_set_purpose");
|
||||
K_sk_free = (void (*) (STACK *)) d->cryptoLib->resolve("sk_free");
|
||||
K_sk_num = (int (*) (STACK *)) d->cryptoLib->resolve("sk_num");
|
||||
K_sk_pop = (char* (*) (STACK *)) d->cryptoLib->resolve("sk_pop");
|
||||
K_sk_value = (char* (*) (STACK *, int)) d->cryptoLib->resolve("sk_value");
|
||||
K_sk_new = (STACK* (*) (int (*)())) d->cryptoLib->resolve("sk_new");
|
||||
K_sk_push = (int (*) (STACK*, char*)) d->cryptoLib->resolve("sk_push");
|
||||
K_sk_dup = (STACK* (*) (STACK *)) d->cryptoLib->resolve("sk_dup");
|
||||
K_i2s_ASN1_INTEGER = (char *(*) (X509V3_EXT_METHOD *, ASN1_INTEGER *)) d->cryptoLib->resolve("i2s_ASN1_INTEGER");
|
||||
K_X509_get_serialNumber = (ASN1_INTEGER * (*) (X509 *)) d->cryptoLib->resolve("X509_get_serialNumber");
|
||||
K_X509_get_pubkey = (EVP_PKEY *(*)(X509 *)) d->cryptoLib->resolve("X509_get_pubkey");
|
||||
K_i2d_PublicKey = (int (*)(EVP_PKEY *, unsigned char **)) d->cryptoLib->resolve("i2d_PublicKey");
|
||||
K_X509_check_private_key = (int (*)(X509 *, EVP_PKEY *)) d->cryptoLib->resolve("X509_check_private_key");
|
||||
K_BN_bn2hex = (char *(*)(const BIGNUM *)) d->cryptoLib->resolve("BN_bn2hex");
|
||||
K_X509_digest = (int (*)(const X509 *,const EVP_MD *, unsigned char *, unsigned int *)) d->cryptoLib->resolve("X509_digest");
|
||||
K_EVP_md5 = (EVP_MD *(*)()) d->cryptoLib->resolve("EVP_md5");
|
||||
K_ASN1_INTEGER_free = (void (*)(ASN1_INTEGER *)) d->cryptoLib->resolve("ASN1_INTEGER_free");
|
||||
K_OBJ_obj2nid = (int (*)(ASN1_OBJECT *)) d->cryptoLib->resolve("OBJ_obj2nid");
|
||||
K_OBJ_nid2ln = (const char *(*)(int)) d->cryptoLib->resolve("OBJ_nid2ln");
|
||||
K_X509_get_ext_count = (int (*)(X509*)) d->cryptoLib->resolve("X509_get_ext_count");
|
||||
K_X509_get_ext_by_NID = (int (*)(X509*,int,int)) d->cryptoLib->resolve("X509_get_ext_by_NID");
|
||||
K_X509_get_ext_by_OBJ = (int (*)(X509*,ASN1_OBJECT*,int)) d->cryptoLib->resolve("X509_get_ext_by_OBJ");
|
||||
K_X509_get_ext = (X509_EXTENSION* (*)(X509*,int)) d->cryptoLib->resolve("X509_get_ext");
|
||||
K_X509_delete_ext = (X509_EXTENSION* (*)(X509*,int)) d->cryptoLib->resolve("X509_delete_ext");
|
||||
K_X509_add_ext = (int (*)(X509*,X509_EXTENSION*,int)) d->cryptoLib->resolve("X509_add_ext");
|
||||
K_X509_get_ext_d2i = (void* (*)(X509*,int,int*,int*)) d->cryptoLib->resolve("X509_get_ext_d2i");
|
||||
K_i2s_ASN1_OCTET_STRING = (char *(*)(X509V3_EXT_METHOD*,ASN1_OCTET_STRING*)) d->cryptoLib->resolve("i2s_ASN1_OCTET_STRING");
|
||||
K_ASN1_BIT_STRING_get_bit = (int (*)(ASN1_BIT_STRING*,int)) d->cryptoLib->resolve("ASN1_BIT_STRING_get_bit");
|
||||
K_PKCS7_new = (PKCS7 *(*)()) d->cryptoLib->resolve("PKCS7_new");
|
||||
K_PKCS7_free = (void (*)(PKCS7*)) d->cryptoLib->resolve("PKCS7_free");
|
||||
K_PKCS7_content_free = (void (*)(PKCS7*)) d->cryptoLib->resolve("PKCS7_content_free");
|
||||
K_i2d_PKCS7 = (int (*)(PKCS7*, unsigned char**)) d->cryptoLib->resolve("i2d_PKCS7");
|
||||
K_i2d_PKCS7_fp = (int (*)(FILE*,PKCS7*)) d->cryptoLib->resolve("i2d_PKCS7_fp");
|
||||
K_i2d_PKCS7_bio = (int (*)(BIO *bp,PKCS7 *p7)) d->cryptoLib->resolve("i2d_PKCS7_bio");
|
||||
K_d2i_PKCS7 = (PKCS7* (*)(PKCS7**,unsigned char**,long)) d->cryptoLib->resolve("d2i_PKCS7");
|
||||
K_d2i_PKCS7_fp = (PKCS7 *(*)(FILE *,PKCS7**)) d->cryptoLib->resolve("d2i_PKCS7_fp");
|
||||
K_d2i_PKCS7_bio = (PKCS7 *(*)(BIO *bp,PKCS7 **p7)) d->cryptoLib->resolve("d2i_PKCS7_bio");
|
||||
K_PKCS7_dup = (PKCS7* (*)(PKCS7*)) d->cryptoLib->resolve("PKCS7_dup");
|
||||
K_PKCS7_sign = (PKCS7 *(*)(X509*, EVP_PKEY*, STACK_OF(X509)*, BIO*, int)) d->cryptoLib->resolve("PKCS7_sign");
|
||||
K_PKCS7_verify = (int (*)(PKCS7*,STACK_OF(X509)*,X509_STORE*,BIO*,BIO*,int)) d->cryptoLib->resolve("PKCS7_verify");
|
||||
K_PKCS7_get0_signers = (STACK_OF(X509) *(*)(PKCS7 *, STACK_OF(X509) *, int)) d->cryptoLib->resolve("PKCS7_get0_signers");
|
||||
K_PKCS7_encrypt = (PKCS7* (*)(STACK_OF(X509) *, BIO *, EVP_CIPHER *, int)) d->cryptoLib->resolve("PKCS7_encrypt");
|
||||
K_PKCS7_decrypt = (int (*)(PKCS7 *, EVP_PKEY *, X509 *, BIO *, int)) d->cryptoLib->resolve("PKCS7_decrypt");
|
||||
K_PEM_X509_INFO_read = (STACK_OF(X509_INFO) *(*)(FILE*, STACK_OF(X509_INFO)*, pem_password_cb*, void *)) d->cryptoLib->resolve("PEM_X509_INFO_read");
|
||||
K_ASN1_d2i_fp = (char *(*)(char *(*)(),char *(*)(),FILE*,unsigned char**)) d->cryptoLib->resolve("ASN1_d2i_fp");
|
||||
K_X509_new = (X509 *(*)()) d->cryptoLib->resolve("X509_new");
|
||||
K_X509_PURPOSE_get_count = (int (*)()) d->cryptoLib->resolve("X509_PURPOSE_get_count");
|
||||
K_X509_PURPOSE_get_id = (int (*)(X509_PURPOSE *)) d->cryptoLib->resolve("X509_PURPOSE_get_id");
|
||||
K_X509_check_purpose = (int (*)(X509*,int,int)) d->cryptoLib->resolve("X509_check_purpose");
|
||||
K_X509_PURPOSE_get0 = (X509_PURPOSE *(*)(int)) d->cryptoLib->resolve("X509_PURPOSE_get0");
|
||||
K_EVP_PKEY_assign = (int (*)(EVP_PKEY*, int, char*)) d->cryptoLib->resolve("EVP_PKEY_assign");
|
||||
K_X509_REQ_set_pubkey = (int (*)(X509_REQ*, EVP_PKEY*)) d->cryptoLib->resolve("X509_REQ_set_pubkey");
|
||||
K_RSA_generate_key = (RSA* (*)(int, unsigned long, void (*)(int,int,void *), void *)) d->cryptoLib->resolve("RSA_generate_key");
|
||||
K_i2d_X509_REQ_fp = (int (*)(FILE *, X509_REQ *)) d->cryptoLib->resolve("i2d_X509_REQ_fp");
|
||||
K_ERR_clear_error = (void (*)()) d->cryptoLib->resolve("ERR_clear_error");
|
||||
K_ERR_get_error = (unsigned long (*)()) d->cryptoLib->resolve("ERR_get_error");
|
||||
K_ERR_print_errors_fp = (void (*)(FILE*)) d->cryptoLib->resolve("ERR_print_errors_fp");
|
||||
K_X509_get1_email = (STACK *(*)(X509 *x)) d->cryptoLib->resolve("X509_get1_email");
|
||||
K_X509_email_free = (void (*)(STACK *sk)) d->cryptoLib->resolve("X509_email_free");
|
||||
K_EVP_des_ede3_cbc = (EVP_CIPHER *(*)()) d->cryptoLib->resolve("EVP_des_ede3_cbc");
|
||||
K_EVP_des_cbc = (EVP_CIPHER *(*)()) d->cryptoLib->resolve("EVP_des_cbc");
|
||||
K_EVP_rc2_cbc = (EVP_CIPHER *(*)()) d->cryptoLib->resolve("EVP_rc2_cbc");
|
||||
K_EVP_rc2_64_cbc = (EVP_CIPHER *(*)()) d->cryptoLib->resolve("EVP_rc2_64_cbc");
|
||||
K_EVP_rc2_40_cbc = (EVP_CIPHER *(*)()) d->cryptoLib->resolve("EVP_rc2_40_cbc");
|
||||
K_i2d_PrivateKey_fp = (int (*)(FILE*,EVP_PKEY*)) d->cryptoLib->resolve("i2d_PrivateKey_fp");
|
||||
K_i2d_PKCS8PrivateKey_fp = (int (*)(FILE*, EVP_PKEY*, const EVP_CIPHER*, char*, int, pem_password_cb*, void*)) d->cryptoLib->resolve("i2d_PKCS8PrivateKey_fp");
|
||||
K_RSA_free = (void (*)(RSA*)) d->cryptoLib->resolve("RSA_free");
|
||||
K_EVP_bf_cbc = (EVP_CIPHER *(*)()) d->cryptoLib->resolve("EVP_bf_cbc");
|
||||
K_X509_REQ_sign = (int (*)(X509_REQ*, EVP_PKEY*, const EVP_MD*)) d->cryptoLib->resolve("X509_REQ_sign");
|
||||
K_X509_NAME_add_entry_by_txt = (int (*)(X509_NAME*, char*, int, unsigned char*, int, int, int)) d->cryptoLib->resolve("X509_NAME_add_entry_by_txt");
|
||||
K_X509_NAME_new = (X509_NAME *(*)()) d->cryptoLib->resolve("X509_NAME_new");
|
||||
K_X509_REQ_set_subject_name = (int (*)(X509_REQ*,X509_NAME*)) d->cryptoLib->resolve("X509_REQ_set_subject_name");
|
||||
K_ASN1_STRING_data = (unsigned char *(*)(ASN1_STRING*)) d->cryptoLib->resolve("ASN1_STRING_data");
|
||||
K_ASN1_STRING_length = (int (*)(ASN1_STRING*)) d->cryptoLib->resolve("ASN1_STRING_length");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -511,7 +510,7 @@ KOpenSSLProxy::KOpenSSLProxy()
|
|||
{
|
||||
QString libname = findMostRecentLib("/usr/lib", "ssl");
|
||||
if (!libname.isNull()) {
|
||||
d->sslLib = new KLibrary(libname);
|
||||
d->sslLib = new QLibrary(libname);
|
||||
d->sslLib->setLoadHints(QLibrary::ExportExternalSymbolsHint);
|
||||
if (!d->sslLib->load()) {
|
||||
delete d->sslLib;
|
||||
|
@ -533,7 +532,7 @@ KOpenSSLProxy::KOpenSSLProxy()
|
|||
QString tmpStr(alib.toLatin1());
|
||||
tmpStr.remove(QRegExp("\\(.*\\)"));
|
||||
if (!access(tmpStr.toLatin1(), R_OK)) {
|
||||
d->sslLib = new KLibrary(alib);
|
||||
d->sslLib = new QLibrary(alib);
|
||||
d->sslLib->setLoadHints(QLibrary::ExportExternalSymbolsHint);
|
||||
}
|
||||
if (d->sslLib && d->sslLib->load()) {
|
||||
|
@ -551,80 +550,80 @@ KOpenSSLProxy::KOpenSSLProxy()
|
|||
if (d->sslLib) {
|
||||
#ifdef KSSL_HAVE_SSL
|
||||
// stand back from your monitor and look at this. it's fun! :)
|
||||
K_SSL_connect = (int (*)(SSL *)) d->sslLib->resolveFunction("SSL_connect");
|
||||
K_SSL_accept = (int (*)(SSL *)) d->sslLib->resolveFunction("SSL_accept");
|
||||
K_SSL_read = (int (*)(SSL *, void *, int)) d->sslLib->resolveFunction("SSL_read");
|
||||
K_SSL_connect = (int (*)(SSL *)) d->sslLib->resolve("SSL_connect");
|
||||
K_SSL_accept = (int (*)(SSL *)) d->sslLib->resolve("SSL_accept");
|
||||
K_SSL_read = (int (*)(SSL *, void *, int)) d->sslLib->resolve("SSL_read");
|
||||
K_SSL_write = (int (*)(SSL *, const void *, int))
|
||||
d->sslLib->resolveFunction("SSL_write");
|
||||
K_SSL_new = (SSL* (*)(SSL_CTX *)) d->sslLib->resolveFunction("SSL_new");
|
||||
K_SSL_free = (void (*)(SSL *)) d->sslLib->resolveFunction("SSL_free");
|
||||
K_SSL_shutdown = (int (*)(SSL *)) d->sslLib->resolveFunction("SSL_shutdown");
|
||||
K_SSL_CTX_new = (SSL_CTX* (*)(SSL_METHOD*)) d->sslLib->resolveFunction("SSL_CTX_new");
|
||||
K_SSL_CTX_free = (void (*)(SSL_CTX*)) d->sslLib->resolveFunction("SSL_CTX_free");
|
||||
K_SSL_set_fd = (int (*)(SSL *, int)) d->sslLib->resolveFunction("SSL_set_fd");
|
||||
K_SSL_pending = (int (*)(SSL *)) d->sslLib->resolveFunction("SSL_pending");
|
||||
d->sslLib->resolve("SSL_write");
|
||||
K_SSL_new = (SSL* (*)(SSL_CTX *)) d->sslLib->resolve("SSL_new");
|
||||
K_SSL_free = (void (*)(SSL *)) d->sslLib->resolve("SSL_free");
|
||||
K_SSL_shutdown = (int (*)(SSL *)) d->sslLib->resolve("SSL_shutdown");
|
||||
K_SSL_CTX_new = (SSL_CTX* (*)(SSL_METHOD*)) d->sslLib->resolve("SSL_CTX_new");
|
||||
K_SSL_CTX_free = (void (*)(SSL_CTX*)) d->sslLib->resolve("SSL_CTX_free");
|
||||
K_SSL_set_fd = (int (*)(SSL *, int)) d->sslLib->resolve("SSL_set_fd");
|
||||
K_SSL_pending = (int (*)(SSL *)) d->sslLib->resolve("SSL_pending");
|
||||
K_SSL_CTX_set_cipher_list = (int (*)(SSL_CTX *, const char *))
|
||||
d->sslLib->resolveFunction("SSL_CTX_set_cipher_list");
|
||||
K_SSL_CTX_set_verify = (void (*)(SSL_CTX*, int, int (*)(int, X509_STORE_CTX*))) d->sslLib->resolveFunction("SSL_CTX_set_verify");
|
||||
d->sslLib->resolve("SSL_CTX_set_cipher_list");
|
||||
K_SSL_CTX_set_verify = (void (*)(SSL_CTX*, int, int (*)(int, X509_STORE_CTX*))) d->sslLib->resolve("SSL_CTX_set_verify");
|
||||
K_SSL_use_certificate = (int (*)(SSL*, X509*))
|
||||
d->sslLib->resolveFunction("SSL_CTX_use_certificate");
|
||||
d->sslLib->resolve("SSL_CTX_use_certificate");
|
||||
K_SSL_get_current_cipher = (SSL_CIPHER *(*)(SSL *))
|
||||
d->sslLib->resolveFunction("SSL_get_current_cipher");
|
||||
d->sslLib->resolve("SSL_get_current_cipher");
|
||||
K_SSL_ctrl = (long (*)(SSL * ,int, long, char *))
|
||||
d->sslLib->resolveFunction("SSL_ctrl");
|
||||
K_TLSv1_client_method = (SSL_METHOD *(*)()) d->sslLib->resolveFunction("TLSv1_client_method");
|
||||
K_SSLv23_client_method = (SSL_METHOD *(*)()) d->sslLib->resolveFunction("SSLv23_client_method");
|
||||
K_SSL_get_peer_certificate = (X509 *(*)(SSL *)) d->sslLib->resolveFunction("SSL_get_peer_certificate");
|
||||
K_SSL_CIPHER_get_bits = (int (*)(SSL_CIPHER *,int *)) d->sslLib->resolveFunction("SSL_CIPHER_get_bits");
|
||||
K_SSL_CIPHER_get_version = (char * (*)(SSL_CIPHER *)) d->sslLib->resolveFunction("SSL_CIPHER_get_version");
|
||||
K_SSL_CIPHER_get_name = (const char * (*)(SSL_CIPHER *)) d->sslLib->resolveFunction("SSL_CIPHER_get_name");
|
||||
K_SSL_CIPHER_description = (char * (*)(SSL_CIPHER *, char *, int)) d->sslLib->resolveFunction("SSL_CIPHER_description");
|
||||
K_SSL_CTX_use_PrivateKey = (int (*)(SSL_CTX*, EVP_PKEY*)) d->sslLib->resolveFunction("SSL_CTX_use_PrivateKey");
|
||||
K_SSL_CTX_use_certificate = (int (*)(SSL_CTX*, X509*)) d->sslLib->resolveFunction("SSL_CTX_use_certificate");
|
||||
K_SSL_get_error = (int (*)(SSL*, int)) d->sslLib->resolveFunction("SSL_get_error");
|
||||
K_SSL_get_peer_cert_chain = (STACK_OF(X509)* (*)(SSL*)) d->sslLib->resolveFunction("SSL_get_peer_cert_chain");
|
||||
K_SSL_load_client_CA_file = (STACK_OF(X509_NAME)* (*)(const char *)) d->sslLib->resolveFunction("SSL_load_client_CA_file");
|
||||
K_SSL_peek = (int (*)(SSL*,void*,int)) d->sslLib->resolveFunction("SSL_peek");
|
||||
K_SSL_get1_session = (SSL_SESSION* (*)(SSL*)) d->sslLib->resolveFunction("SSL_get1_session");
|
||||
K_SSL_SESSION_free = (void (*)(SSL_SESSION*)) d->sslLib->resolveFunction("SSL_SESSION_free");
|
||||
K_SSL_set_session = (int (*)(SSL*,SSL_SESSION*)) d->sslLib->resolveFunction("SSL_set_session");
|
||||
K_d2i_SSL_SESSION = (SSL_SESSION* (*)(SSL_SESSION**,unsigned char**, long)) d->sslLib->resolveFunction("d2i_SSL_SESSION");
|
||||
K_i2d_SSL_SESSION = (int (*)(SSL_SESSION*,unsigned char**)) d->sslLib->resolveFunction("i2d_SSL_SESSION");
|
||||
K_SSL_get_ciphers = (STACK_OF(SSL_CIPHER) *(*)(const SSL*)) d->sslLib->resolveFunction("SSL_get_ciphers");
|
||||
d->sslLib->resolve("SSL_ctrl");
|
||||
K_TLSv1_client_method = (SSL_METHOD *(*)()) d->sslLib->resolve("TLSv1_client_method");
|
||||
K_SSLv23_client_method = (SSL_METHOD *(*)()) d->sslLib->resolve("SSLv23_client_method");
|
||||
K_SSL_get_peer_certificate = (X509 *(*)(SSL *)) d->sslLib->resolve("SSL_get_peer_certificate");
|
||||
K_SSL_CIPHER_get_bits = (int (*)(SSL_CIPHER *,int *)) d->sslLib->resolve("SSL_CIPHER_get_bits");
|
||||
K_SSL_CIPHER_get_version = (char * (*)(SSL_CIPHER *)) d->sslLib->resolve("SSL_CIPHER_get_version");
|
||||
K_SSL_CIPHER_get_name = (const char * (*)(SSL_CIPHER *)) d->sslLib->resolve("SSL_CIPHER_get_name");
|
||||
K_SSL_CIPHER_description = (char * (*)(SSL_CIPHER *, char *, int)) d->sslLib->resolve("SSL_CIPHER_description");
|
||||
K_SSL_CTX_use_PrivateKey = (int (*)(SSL_CTX*, EVP_PKEY*)) d->sslLib->resolve("SSL_CTX_use_PrivateKey");
|
||||
K_SSL_CTX_use_certificate = (int (*)(SSL_CTX*, X509*)) d->sslLib->resolve("SSL_CTX_use_certificate");
|
||||
K_SSL_get_error = (int (*)(SSL*, int)) d->sslLib->resolve("SSL_get_error");
|
||||
K_SSL_get_peer_cert_chain = (STACK_OF(X509)* (*)(SSL*)) d->sslLib->resolve("SSL_get_peer_cert_chain");
|
||||
K_SSL_load_client_CA_file = (STACK_OF(X509_NAME)* (*)(const char *)) d->sslLib->resolve("SSL_load_client_CA_file");
|
||||
K_SSL_peek = (int (*)(SSL*,void*,int)) d->sslLib->resolve("SSL_peek");
|
||||
K_SSL_get1_session = (SSL_SESSION* (*)(SSL*)) d->sslLib->resolve("SSL_get1_session");
|
||||
K_SSL_SESSION_free = (void (*)(SSL_SESSION*)) d->sslLib->resolve("SSL_SESSION_free");
|
||||
K_SSL_set_session = (int (*)(SSL*,SSL_SESSION*)) d->sslLib->resolve("SSL_set_session");
|
||||
K_d2i_SSL_SESSION = (SSL_SESSION* (*)(SSL_SESSION**,unsigned char**, long)) d->sslLib->resolve("d2i_SSL_SESSION");
|
||||
K_i2d_SSL_SESSION = (int (*)(SSL_SESSION*,unsigned char**)) d->sslLib->resolve("i2d_SSL_SESSION");
|
||||
K_SSL_get_ciphers = (STACK_OF(SSL_CIPHER) *(*)(const SSL*)) d->sslLib->resolve("SSL_get_ciphers");
|
||||
#endif
|
||||
|
||||
|
||||
// Initialize the library (once only!)
|
||||
KLibrary::void_function_ptr x;
|
||||
x = d->sslLib->resolveFunction("SSL_library_init");
|
||||
void *x;
|
||||
x = d->sslLib->resolve("SSL_library_init");
|
||||
if (d->cryptoLib) {
|
||||
if (x) ((int (*)())x)();
|
||||
x = d->cryptoLib->resolveFunction("OpenSSL_add_all_algorithms");
|
||||
x = d->cryptoLib->resolve("OpenSSL_add_all_algorithms");
|
||||
if (!x)
|
||||
x = d->cryptoLib->resolveFunction("OPENSSL_add_all_algorithms");
|
||||
x = d->cryptoLib->resolve("OPENSSL_add_all_algorithms");
|
||||
if (x) {
|
||||
((void (*)())x)();
|
||||
} else {
|
||||
x = d->cryptoLib->resolveFunction("OpenSSL_add_all_algorithms_conf");
|
||||
x = d->cryptoLib->resolve("OpenSSL_add_all_algorithms_conf");
|
||||
if (!x)
|
||||
x = d->cryptoLib->resolveFunction("OPENSSL_add_all_algorithms_conf");
|
||||
x = d->cryptoLib->resolve("OPENSSL_add_all_algorithms_conf");
|
||||
if (x) {
|
||||
((void (*)())x)();
|
||||
} else {
|
||||
x = d->cryptoLib->resolveFunction("OpenSSL_add_all_algorithms_noconf");
|
||||
x = d->cryptoLib->resolve("OpenSSL_add_all_algorithms_noconf");
|
||||
if (!x)
|
||||
x = d->cryptoLib->resolveFunction("OPENSSL_add_all_algorithms_noconf");
|
||||
x = d->cryptoLib->resolve("OPENSSL_add_all_algorithms_noconf");
|
||||
if (x)
|
||||
((void (*)())x)();
|
||||
}
|
||||
}
|
||||
x = d->cryptoLib->resolveFunction("OpenSSL_add_all_ciphers");
|
||||
x = d->cryptoLib->resolve("OpenSSL_add_all_ciphers");
|
||||
if (!x)
|
||||
x = d->cryptoLib->resolveFunction("OPENSSL_add_all_ciphers");
|
||||
x = d->cryptoLib->resolve("OPENSSL_add_all_ciphers");
|
||||
if (x) ((void (*)())x)();
|
||||
x = d->cryptoLib->resolveFunction("OpenSSL_add_all_digests");
|
||||
x = d->cryptoLib->resolve("OpenSSL_add_all_digests");
|
||||
if (!x)
|
||||
x = d->cryptoLib->resolveFunction("OPENSSL_add_all_digests");
|
||||
x = d->cryptoLib->resolve("OPENSSL_add_all_digests");
|
||||
if (x) ((void (*)())x)();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
#include <QtGui/QWidget>
|
||||
|
||||
#include <kpluginloader.h>
|
||||
#include <klibrary.h>
|
||||
#include <klocale.h>
|
||||
#include <kglobal.h>
|
||||
#include <kcomponentdata.h>
|
||||
|
|
|
@ -319,32 +319,6 @@ QObject* Manager::module(const QString& modulename)
|
|||
|
||||
QByteArray libraryname = QString("krossmodule%1").arg(modulename).toLower().toLatin1();
|
||||
|
||||
#if 0
|
||||
KLibLoader* loader = KLibLoader::self();
|
||||
KLibrary* lib = loader->library( libraryname, QLibrary::ExportExternalSymbolsHint );
|
||||
if( ! lib ) { //FIXME this fallback-code should be in KLibLoader imho.
|
||||
lib = loader->library( QString("lib%1").arg(libraryname), QLibrary::ExportExternalSymbolsHint );
|
||||
if( ! lib ) {
|
||||
krosswarning( QString("Failed to load module '%1': %2").arg(modulename).arg(loader->lastErrorMessage()) );
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
def_module_func func;
|
||||
func = (def_module_func) lib->resolveFunction("krossmodule");
|
||||
if( ! func ) {
|
||||
krosswarning( QString("Failed to determinate init function in module '%1'").arg(modulename) );
|
||||
return 0;
|
||||
}
|
||||
|
||||
QObject* module = (QObject*) (func)(); // call the function
|
||||
lib->unload(); // unload the library
|
||||
|
||||
if( ! module ) {
|
||||
krosswarning( QString("Failed to load module object '%1'").arg(modulename) );
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
if( void* funcPtr = loadLibrary(libraryname, "krossmodule") ) {
|
||||
def_module_func func = (def_module_func) funcPtr;
|
||||
Q_ASSERT( func );
|
||||
|
@ -357,7 +331,6 @@ QObject* Manager::module(const QString& modulename)
|
|||
else {
|
||||
krosswarning( QString("Failed to load module '%1'").arg(modulename) );
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QLayout>
|
||||
|
||||
#include <klibrary.h>
|
||||
#include <kpluginloader.h>
|
||||
#include <kdebug.h>
|
||||
#include <klocale.h>
|
||||
|
@ -93,12 +92,12 @@ KCModule* KCModuleLoader::loadModule(const KCModuleInfo& mod, ErrorReporting rep
|
|||
//#ifndef NDEBUG
|
||||
{
|
||||
// get the create_ function
|
||||
KLibrary lib(mod.library());
|
||||
QLibrary lib(mod.library());
|
||||
if (lib.load()) {
|
||||
KCModule *(*create)(QWidget *, const char *);
|
||||
QByteArray factorymethod("create_");
|
||||
factorymethod += mod.handle().toLatin1();
|
||||
create = reinterpret_cast<KCModule *(*)(QWidget *, const char*)>(lib.resolveFunction(factorymethod));
|
||||
create = reinterpret_cast<KCModule *(*)(QWidget *, const char*)>(lib.resolve(factorymethod));
|
||||
if (create) {
|
||||
return create(parent, mod.handle().toLatin1());
|
||||
kFatal(1208) << "This module still uses a custom factory method (" << factorymethod << "). This is not supported anymore. Please fix the module.";
|
||||
|
|
Loading…
Add table
Reference in a new issue