Merge branch 'master' of ssh+git://playfair.gnupg.org/git/gpgme
This commit is contained in:
commit
8d2621fcad
10
autogen.rc
10
autogen.rc
@ -2,17 +2,11 @@
|
||||
|
||||
case "$myhost" in
|
||||
w32)
|
||||
configure_opts="
|
||||
--with-gpg-error-prefix=@SYSROOT@
|
||||
--with-libassuan-prefix=@SYSROOT@
|
||||
"
|
||||
configure_opts=""
|
||||
;;
|
||||
|
||||
amd64)
|
||||
configure_opts="
|
||||
--with-gpg-error-prefix=@SYSROOT@
|
||||
--with-libassuan-prefix=@SYSROOT@
|
||||
"
|
||||
configure_opts=""
|
||||
;;
|
||||
esac
|
||||
|
||||
|
@ -2461,9 +2461,9 @@ the context @var{ctx} to @var{proto}. All crypto operations will be
|
||||
performed by the crypto engine configured for that protocol.
|
||||
@xref{Protocols and Engines}.
|
||||
|
||||
Setting the protocol with @code{gpgme_set_protocol} does not check if
|
||||
the crypto engine for that protocol is available and installed
|
||||
correctly. @xref{Engine Version Check}.
|
||||
Setting the protocol with @code{gpgme_set_protocol} does intentionally
|
||||
not check if the crypto engine for that protocol is available and
|
||||
installed correctly. @xref{Engine Version Check}.
|
||||
|
||||
The function returns the error code @code{GPG_ERR_NO_ERROR} if the
|
||||
protocol could be set successfully, and @code{GPG_ERR_INV_VALUE} if
|
||||
|
@ -66,7 +66,8 @@ libgpgmepp_la_SOURCES = $(main_sources) $(gpgmepp_headers) context_vanilla.cpp \
|
||||
$(interface_headers) $(private_gpgmepp_headers)
|
||||
|
||||
AM_CPPFLAGS = -I$(top_builddir)/src @GPG_ERROR_CFLAGS@ @LIBASSUAN_CFLAGS@ \
|
||||
-DBUILDING_GPGMEPP
|
||||
-DBUILDING_GPGMEPP -Wsuggest-override \
|
||||
-Wzero-as-null-pointer-constant
|
||||
|
||||
libgpgmepp_la_LIBADD = ../../../src/libgpgme.la @LIBASSUAN_LIBS@
|
||||
libgpgmepp_la_LDFLAGS = -no-undefined -version-info \
|
||||
|
@ -76,7 +76,7 @@ gpgme_error_t passphrase_callback(void *opaque, const char *uid_hint, const char
|
||||
PassphraseProvider *provider = static_cast<PassphraseProvider *>(opaque);
|
||||
bool canceled = false;
|
||||
gpgme_error_t err = GPG_ERR_NO_ERROR;
|
||||
char *passphrase = provider ? provider->getPassphrase(uid_hint, desc, prev_was_bad, canceled) : 0 ;
|
||||
char *passphrase = provider ? provider->getPassphrase(uid_hint, desc, prev_was_bad, canceled) : nullptr ;
|
||||
if (canceled) {
|
||||
err = make_error(GPG_ERR_CANCELED);
|
||||
} else {
|
||||
|
@ -64,7 +64,7 @@ std::vector<Component> Component::load(Error &returnedError)
|
||||
//
|
||||
// 1. get a context:
|
||||
//
|
||||
gpgme_ctx_t ctx_native = 0;
|
||||
gpgme_ctx_t ctx_native = nullptr;
|
||||
if (const gpgme_error_t err = gpgme_new(&ctx_native)) {
|
||||
returnedError = Error(err);
|
||||
return std::vector<Component>();
|
||||
@ -74,7 +74,7 @@ std::vector<Component> Component::load(Error &returnedError)
|
||||
//
|
||||
// 2. load the config:
|
||||
//
|
||||
gpgme_conf_comp_t conf_list_native = 0;
|
||||
gpgme_conf_comp_t conf_list_native = nullptr;
|
||||
if (const gpgme_error_t err = gpgme_op_conf_load(ctx_native, &conf_list_native)) {
|
||||
returnedError = Error(err);
|
||||
return std::vector<Component>();
|
||||
@ -94,7 +94,7 @@ std::vector<Component> Component::load(Error &returnedError)
|
||||
}
|
||||
|
||||
// now prevent double-free of next.get() and following:
|
||||
head->next = 0;
|
||||
head->next = nullptr;
|
||||
|
||||
// now add a new Component to 'result' (may throw):
|
||||
result.resize(result.size() + 1);
|
||||
@ -115,7 +115,7 @@ Error Component::save() const
|
||||
//
|
||||
// 1. get a context:
|
||||
//
|
||||
gpgme_ctx_t ctx_native = 0;
|
||||
gpgme_ctx_t ctx_native = nullptr;
|
||||
if (const gpgme_error_t err = gpgme_new(&ctx_native)) {
|
||||
return Error(err);
|
||||
}
|
||||
@ -129,22 +129,22 @@ Error Component::save() const
|
||||
|
||||
const char *Component::name() const
|
||||
{
|
||||
return comp ? comp->name : 0 ;
|
||||
return comp ? comp->name : nullptr;
|
||||
}
|
||||
|
||||
const char *Component::description() const
|
||||
{
|
||||
return comp ? comp->description : 0 ;
|
||||
return comp ? comp->description : nullptr ;
|
||||
}
|
||||
|
||||
const char *Component::programName() const
|
||||
{
|
||||
return comp ? comp->program_name : 0 ;
|
||||
return comp ? comp->program_name : nullptr ;
|
||||
}
|
||||
|
||||
Option Component::option(unsigned int idx) const
|
||||
{
|
||||
gpgme_conf_opt_t opt = 0;
|
||||
gpgme_conf_opt_t opt = nullptr;
|
||||
if (comp) {
|
||||
opt = comp->options;
|
||||
}
|
||||
@ -160,7 +160,7 @@ Option Component::option(unsigned int idx) const
|
||||
|
||||
Option Component::option(const char *name) const
|
||||
{
|
||||
gpgme_conf_opt_t opt = 0;
|
||||
gpgme_conf_opt_t opt = nullptr;
|
||||
if (comp) {
|
||||
opt = comp->options;
|
||||
}
|
||||
@ -177,7 +177,7 @@ Option Component::option(const char *name) const
|
||||
unsigned int Component::numOptions() const
|
||||
{
|
||||
unsigned int result = 0;
|
||||
for (gpgme_conf_opt_t opt = comp ? comp->options : 0 ; opt ; opt = opt->next) {
|
||||
for (gpgme_conf_opt_t opt = comp ? comp->options : nullptr ; opt ; opt = opt->next) {
|
||||
++result;
|
||||
}
|
||||
return result;
|
||||
@ -186,7 +186,7 @@ unsigned int Component::numOptions() const
|
||||
std::vector<Option> Component::options() const
|
||||
{
|
||||
std::vector<Option> result;
|
||||
for (gpgme_conf_opt_t opt = comp ? comp->options : 0 ; opt ; opt = opt->next) {
|
||||
for (gpgme_conf_opt_t opt = comp ? comp->options : nullptr ; opt ; opt = opt->next) {
|
||||
result.push_back(Option(comp, opt));
|
||||
}
|
||||
return result;
|
||||
@ -194,17 +194,17 @@ std::vector<Option> Component::options() const
|
||||
|
||||
static gpgme_conf_arg_t mygpgme_conf_arg_copy(gpgme_conf_arg_t other, gpgme_conf_type_t type)
|
||||
{
|
||||
gpgme_conf_arg_t result = 0, last = 0;
|
||||
gpgme_conf_arg_t result = nullptr, last = nullptr;
|
||||
for (gpgme_conf_arg_t a = other ; a ; a = a->next) {
|
||||
gpgme_conf_arg_t arg = 0;
|
||||
gpgme_conf_arg_t arg = nullptr;
|
||||
const gpgme_error_t err
|
||||
= gpgme_conf_arg_new(&arg, type,
|
||||
a->no_arg ? 0 :
|
||||
a->no_arg ? nullptr :
|
||||
type == GPGME_CONF_STRING ? a->value.string :
|
||||
/* else */ static_cast<void *>(&a->value));
|
||||
if (err) {
|
||||
gpgme_conf_arg_release(result, type);
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
assert(arg);
|
||||
if (result) {
|
||||
@ -234,17 +234,17 @@ Level Option::level() const
|
||||
|
||||
const char *Option::name() const
|
||||
{
|
||||
return isNull() ? 0 : opt->name ;
|
||||
return isNull() ? nullptr : opt->name ;
|
||||
}
|
||||
|
||||
const char *Option::description() const
|
||||
{
|
||||
return isNull() ? 0 : opt->description ;
|
||||
return isNull() ? nullptr : opt->description ;
|
||||
}
|
||||
|
||||
const char *Option::argumentName() const
|
||||
{
|
||||
return isNull() ? 0 : opt->argname ;
|
||||
return isNull() ? nullptr : opt->argname ;
|
||||
}
|
||||
|
||||
Type Option::type() const
|
||||
@ -420,7 +420,7 @@ Argument Option::defaultValue() const
|
||||
|
||||
const char *Option::defaultDescription() const
|
||||
{
|
||||
return isNull() ? 0 : opt->default_description ;
|
||||
return isNull() ? nullptr : opt->default_description ;
|
||||
}
|
||||
|
||||
Argument Option::noArgumentValue() const
|
||||
@ -434,7 +434,7 @@ Argument Option::noArgumentValue() const
|
||||
|
||||
const char *Option::noArgumentDescription() const
|
||||
{
|
||||
return isNull() ? 0 : opt->no_arg_description ;
|
||||
return isNull() ? nullptr : opt->no_arg_description ;
|
||||
}
|
||||
|
||||
Argument Option::activeValue() const
|
||||
@ -501,7 +501,7 @@ Error Option::resetToActiveValue()
|
||||
if (isNull()) {
|
||||
return Error(make_error(GPG_ERR_INV_ARG));
|
||||
} else {
|
||||
return Error(gpgme_conf_opt_change(opt, 1, 0));
|
||||
return Error(gpgme_conf_opt_change(opt, 1, nullptr));
|
||||
}
|
||||
}
|
||||
|
||||
@ -510,15 +510,15 @@ Error Option::resetToDefaultValue()
|
||||
if (isNull()) {
|
||||
return Error(make_error(GPG_ERR_INV_ARG));
|
||||
} else {
|
||||
return Error(gpgme_conf_opt_change(opt, 0, 0));
|
||||
return Error(gpgme_conf_opt_change(opt, 0, nullptr));
|
||||
}
|
||||
}
|
||||
|
||||
static gpgme_conf_arg_t make_argument(gpgme_conf_type_t type, const void *value)
|
||||
{
|
||||
gpgme_conf_arg_t arg = 0;
|
||||
gpgme_conf_arg_t arg = nullptr;
|
||||
if (const gpgme_error_t err = gpgme_conf_arg_new(&arg, type, value)) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
} else {
|
||||
return arg;
|
||||
}
|
||||
@ -594,8 +594,8 @@ const void *to_void_star(const unsigned int &i)
|
||||
template <typename T>
|
||||
gpgme_conf_arg_t make_argument(gpgme_conf_type_t type, const std::vector<T> &value)
|
||||
{
|
||||
gpgme_conf_arg_t result = 0;
|
||||
gpgme_conf_arg_t last = 0;
|
||||
gpgme_conf_arg_t result = nullptr;
|
||||
gpgme_conf_arg_t last = nullptr;
|
||||
for (typename std::vector<T>::const_iterator it = value.begin(), end = value.end() ; it != end ; ++it) {
|
||||
if (gpgme_conf_arg_t arg = make_argument(type, to_void_star(*it))) {
|
||||
if (last) {
|
||||
@ -693,14 +693,14 @@ unsigned int Argument::numElements() const
|
||||
const char *Argument::stringValue(unsigned int idx) const
|
||||
{
|
||||
if (isNull() || opt->alt_type != GPGME_CONF_STRING) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
gpgme_conf_arg_t a = arg;
|
||||
while (a && idx) {
|
||||
a = a->next;
|
||||
--idx;
|
||||
}
|
||||
return a ? a->value.string : 0 ;
|
||||
return a ? a->value.string : nullptr ;
|
||||
}
|
||||
|
||||
int Argument::intValue(unsigned int idx) const
|
||||
|
@ -145,7 +145,7 @@ private:
|
||||
class GPGMEPP_EXPORT Option
|
||||
{
|
||||
public:
|
||||
Option() : comp(), opt(0) {}
|
||||
Option() : comp(), opt(nullptr) {}
|
||||
Option(const shared_gpgme_conf_comp_t &gpgme_comp, gpgme_conf_opt_t gpgme_opt)
|
||||
: comp(gpgme_comp), opt(gpgme_opt) {}
|
||||
|
||||
@ -228,7 +228,7 @@ class GPGMEPP_EXPORT Argument
|
||||
friend class ::GpgME::Configuration::Option;
|
||||
Argument(const shared_gpgme_conf_comp_t &comp, gpgme_conf_opt_t opt, gpgme_conf_arg_t arg, bool owns);
|
||||
public:
|
||||
Argument() : comp(), opt(0), arg(0) {}
|
||||
Argument() : comp(), opt(nullptr), arg(nullptr) {}
|
||||
//Argument( const shared_gpgme_conf_comp_t & comp, gpgme_conf_opt_t opt, gpgme_conf_arg_t arg );
|
||||
Argument(const Argument &other);
|
||||
~Argument();
|
||||
|
@ -1,6 +1,7 @@
|
||||
/*
|
||||
context.cpp - wraps a gpgme key context
|
||||
Copyright (C) 2003, 2007 Klarälvdalens Datakonsult AB
|
||||
2017, 2018 Intevation GmbH
|
||||
|
||||
This file is part of GPGME++.
|
||||
|
||||
@ -94,7 +95,7 @@ static void percent_unescape(std::string &s, bool plus2space)
|
||||
|
||||
void initializeLibrary()
|
||||
{
|
||||
gpgme_check_version(0);
|
||||
gpgme_check_version(nullptr);
|
||||
}
|
||||
|
||||
Error initializeLibrary(int)
|
||||
@ -203,26 +204,26 @@ Context::~Context()
|
||||
|
||||
Context *Context::createForProtocol(Protocol proto)
|
||||
{
|
||||
gpgme_ctx_t ctx = 0;
|
||||
gpgme_ctx_t ctx = nullptr;
|
||||
if (gpgme_new(&ctx) != 0) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
switch (proto) {
|
||||
case OpenPGP:
|
||||
if (gpgme_set_protocol(ctx, GPGME_PROTOCOL_OpenPGP) != 0) {
|
||||
gpgme_release(ctx);
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
break;
|
||||
case CMS:
|
||||
if (gpgme_set_protocol(ctx, GPGME_PROTOCOL_CMS) != 0) {
|
||||
gpgme_release(ctx);
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return new Context(ctx);
|
||||
@ -235,7 +236,7 @@ std::unique_ptr<Context> Context::create(Protocol proto)
|
||||
|
||||
std::unique_ptr<Context> Context::createForEngine(Engine eng, Error *error)
|
||||
{
|
||||
gpgme_ctx_t ctx = 0;
|
||||
gpgme_ctx_t ctx = nullptr;
|
||||
if (const gpgme_error_t err = gpgme_new(&ctx)) {
|
||||
if (error) {
|
||||
*error = Error(err);
|
||||
@ -298,7 +299,7 @@ void Context::setDecryptionFlags(DecryptionFlags flags)
|
||||
|
||||
Context::Private::Private(gpgme_ctx_t c)
|
||||
: ctx(c),
|
||||
iocbs(0),
|
||||
iocbs(nullptr),
|
||||
lastop(None),
|
||||
lasterr(GPG_ERR_NO_ERROR),
|
||||
lastAssuanInquireData(Data::null),
|
||||
@ -315,7 +316,7 @@ Context::Private::~Private()
|
||||
if (ctx) {
|
||||
gpgme_release(ctx);
|
||||
}
|
||||
ctx = 0;
|
||||
ctx = nullptr;
|
||||
delete iocbs;
|
||||
}
|
||||
|
||||
@ -393,11 +394,11 @@ unsigned int Context::keyListMode() const
|
||||
|
||||
void Context::setProgressProvider(ProgressProvider *provider)
|
||||
{
|
||||
gpgme_set_progress_cb(d->ctx, provider ? &progress_callback : 0, provider);
|
||||
gpgme_set_progress_cb(d->ctx, provider ? &progress_callback : nullptr, provider);
|
||||
}
|
||||
ProgressProvider *Context::progressProvider() const
|
||||
{
|
||||
void *pp = 0;
|
||||
void *pp = nullptr;
|
||||
gpgme_progress_cb_t pcb = &progress_callback;
|
||||
gpgme_get_progress_cb(d->ctx, &pcb, &pp);
|
||||
return static_cast<ProgressProvider *>(pp);
|
||||
@ -405,12 +406,12 @@ ProgressProvider *Context::progressProvider() const
|
||||
|
||||
void Context::setPassphraseProvider(PassphraseProvider *provider)
|
||||
{
|
||||
gpgme_set_passphrase_cb(d->ctx, provider ? &passphrase_callback : 0, provider);
|
||||
gpgme_set_passphrase_cb(d->ctx, provider ? &passphrase_callback : nullptr, provider);
|
||||
}
|
||||
|
||||
PassphraseProvider *Context::passphraseProvider() const
|
||||
{
|
||||
void *pp = 0;
|
||||
void *pp = nullptr;
|
||||
gpgme_passphrase_cb_t pcb = &passphrase_callback;
|
||||
gpgme_get_passphrase_cb(d->ctx, &pcb, &pp);
|
||||
return static_cast<PassphraseProvider *>(pp);
|
||||
@ -434,7 +435,7 @@ void Context::setManagedByEventLoopInteractor(bool manage)
|
||||
}
|
||||
bool Context::managedByEventLoopInteractor() const
|
||||
{
|
||||
return d->iocbs != 0;
|
||||
return d->iocbs != nullptr;
|
||||
}
|
||||
|
||||
void Context::installIOCallbacks(gpgme_io_cbs *iocbs)
|
||||
@ -449,10 +450,10 @@ void Context::installIOCallbacks(gpgme_io_cbs *iocbs)
|
||||
|
||||
void Context::uninstallIOCallbacks()
|
||||
{
|
||||
static gpgme_io_cbs noiocbs = { 0, 0, 0, 0, 0 };
|
||||
static gpgme_io_cbs noiocbs = { nullptr, nullptr, nullptr, nullptr, nullptr };
|
||||
// io.add == 0 means disable io callbacks:
|
||||
gpgme_set_io_cbs(d->ctx, &noiocbs);
|
||||
delete d->iocbs; d->iocbs = 0;
|
||||
delete d->iocbs; d->iocbs = nullptr;
|
||||
}
|
||||
|
||||
Error Context::setLocale(int cat, const char *val)
|
||||
@ -505,7 +506,7 @@ Error Context::startKeyListing(const char *patterns[], bool secretOnly)
|
||||
#ifndef HAVE_GPGME_EXT_KEYLIST_MODE_EXTERNAL_NONBROKEN
|
||||
if (!patterns || !patterns[0] || !patterns[1]) {
|
||||
// max. one pattern -> use the non-ext version
|
||||
return startKeyListing(patterns ? patterns[0] : 0, secretOnly);
|
||||
return startKeyListing(patterns ? patterns[0] : nullptr, secretOnly);
|
||||
}
|
||||
#endif
|
||||
return Error(d->lasterr = gpgme_op_keylist_ext_start(d->ctx, patterns, int(secretOnly), 0));
|
||||
@ -542,7 +543,7 @@ KeyGenerationResult Context::generateKey(const char *parameters, Data &pubKey)
|
||||
{
|
||||
d->lastop = Private::KeyGen;
|
||||
Data::Private *const dp = pubKey.impl();
|
||||
d->lasterr = gpgme_op_genkey(d->ctx, parameters, dp ? dp->data : 0, 0);
|
||||
d->lasterr = gpgme_op_genkey(d->ctx, parameters, dp ? dp->data : nullptr, nullptr);
|
||||
return KeyGenerationResult(d->ctx, Error(d->lasterr));
|
||||
}
|
||||
|
||||
@ -550,7 +551,7 @@ Error Context::startKeyGeneration(const char *parameters, Data &pubKey)
|
||||
{
|
||||
d->lastop = Private::KeyGen;
|
||||
Data::Private *const dp = pubKey.impl();
|
||||
return Error(d->lasterr = gpgme_op_genkey_start(d->ctx, parameters, dp ? dp->data : 0, 0));
|
||||
return Error(d->lasterr = gpgme_op_genkey_start(d->ctx, parameters, dp ? dp->data : nullptr, nullptr));
|
||||
}
|
||||
|
||||
KeyGenerationResult Context::keyGenerationResult() const
|
||||
@ -566,7 +567,7 @@ Error Context::exportPublicKeys(const char *pattern, Data &keyData)
|
||||
{
|
||||
d->lastop = Private::Export;
|
||||
Data::Private *const dp = keyData.impl();
|
||||
return Error(d->lasterr = gpgme_op_export(d->ctx, pattern, 0, dp ? dp->data : 0));
|
||||
return Error(d->lasterr = gpgme_op_export(d->ctx, pattern, 0, dp ? dp->data : nullptr));
|
||||
}
|
||||
|
||||
Error Context::exportPublicKeys(const char *patterns[], Data &keyData)
|
||||
@ -575,18 +576,18 @@ Error Context::exportPublicKeys(const char *patterns[], Data &keyData)
|
||||
#ifndef HAVE_GPGME_EXT_KEYLIST_MODE_EXTERNAL_NONBROKEN
|
||||
if (!patterns || !patterns[0] || !patterns[1]) {
|
||||
// max. one pattern -> use the non-ext version
|
||||
return exportPublicKeys(patterns ? patterns[0] : 0, keyData);
|
||||
return exportPublicKeys(patterns ? patterns[0] : nullptr, keyData);
|
||||
}
|
||||
#endif
|
||||
Data::Private *const dp = keyData.impl();
|
||||
return Error(d->lasterr = gpgme_op_export_ext(d->ctx, patterns, 0, dp ? dp->data : 0));
|
||||
return Error(d->lasterr = gpgme_op_export_ext(d->ctx, patterns, 0, dp ? dp->data : nullptr));
|
||||
}
|
||||
|
||||
Error Context::startPublicKeyExport(const char *pattern, Data &keyData)
|
||||
{
|
||||
d->lastop = Private::Export;
|
||||
Data::Private *const dp = keyData.impl();
|
||||
return Error(d->lasterr = gpgme_op_export_start(d->ctx, pattern, 0, dp ? dp->data : 0));
|
||||
return Error(d->lasterr = gpgme_op_export_start(d->ctx, pattern, 0, dp ? dp->data : nullptr));
|
||||
}
|
||||
|
||||
Error Context::startPublicKeyExport(const char *patterns[], Data &keyData)
|
||||
@ -595,18 +596,18 @@ Error Context::startPublicKeyExport(const char *patterns[], Data &keyData)
|
||||
#ifndef HAVE_GPGME_EXT_KEYLIST_MODE_EXTERNAL_NONBROKEN
|
||||
if (!patterns || !patterns[0] || !patterns[1]) {
|
||||
// max. one pattern -> use the non-ext version
|
||||
return startPublicKeyExport(patterns ? patterns[0] : 0, keyData);
|
||||
return startPublicKeyExport(patterns ? patterns[0] : nullptr, keyData);
|
||||
}
|
||||
#endif
|
||||
Data::Private *const dp = keyData.impl();
|
||||
return Error(d->lasterr = gpgme_op_export_ext_start(d->ctx, patterns, 0, dp ? dp->data : 0));
|
||||
return Error(d->lasterr = gpgme_op_export_ext_start(d->ctx, patterns, 0, dp ? dp->data : nullptr));
|
||||
}
|
||||
|
||||
ImportResult Context::importKeys(const Data &data)
|
||||
{
|
||||
d->lastop = Private::Import;
|
||||
const Data::Private *const dp = data.impl();
|
||||
d->lasterr = gpgme_op_import(d->ctx, dp ? dp->data : 0);
|
||||
d->lasterr = gpgme_op_import(d->ctx, dp ? dp->data : nullptr);
|
||||
return ImportResult(d->ctx, Error(d->lasterr));
|
||||
}
|
||||
|
||||
@ -623,7 +624,7 @@ ImportResult Context::importKeys(const std::vector<Key> &kk)
|
||||
*keys_it++ = it->impl();
|
||||
}
|
||||
}
|
||||
*keys_it++ = 0;
|
||||
*keys_it++ = nullptr;
|
||||
d->lasterr = gpgme_op_import_keys(d->ctx, keys);
|
||||
shouldHaveResult = true;
|
||||
if ((gpgme_err_code(d->lasterr) == GPG_ERR_NOT_IMPLEMENTED ||
|
||||
@ -642,16 +643,16 @@ ImportResult Context::importKeys(const std::vector<Key> &kk)
|
||||
}
|
||||
}
|
||||
}
|
||||
fprs.push_back(0);
|
||||
fprs.push_back(nullptr);
|
||||
Data data;
|
||||
Data::Private *const dp = data.impl();
|
||||
const gpgme_keylist_mode_t oldMode = gpgme_get_keylist_mode(d->ctx);
|
||||
gpgme_set_keylist_mode(d->ctx, GPGME_KEYLIST_MODE_EXTERN);
|
||||
d->lasterr = gpgme_op_export_ext(d->ctx, &fprs[0], 0, dp ? dp->data : 0);
|
||||
d->lasterr = gpgme_op_export_ext(d->ctx, &fprs[0], 0, dp ? dp->data : nullptr);
|
||||
gpgme_set_keylist_mode(d->ctx, oldMode);
|
||||
if (!d->lasterr) {
|
||||
data.seek(0, SEEK_SET);
|
||||
d->lasterr = gpgme_op_import(d->ctx, dp ? dp->data : 0);
|
||||
d->lasterr = gpgme_op_import(d->ctx, dp ? dp->data : nullptr);
|
||||
shouldHaveResult = true;
|
||||
}
|
||||
}
|
||||
@ -667,7 +668,7 @@ Error Context::startKeyImport(const Data &data)
|
||||
{
|
||||
d->lastop = Private::Import;
|
||||
const Data::Private *const dp = data.impl();
|
||||
return Error(d->lasterr = gpgme_op_import_start(d->ctx, dp ? dp->data : 0));
|
||||
return Error(d->lasterr = gpgme_op_import_start(d->ctx, dp ? dp->data : nullptr));
|
||||
}
|
||||
|
||||
Error Context::startKeyImport(const std::vector<Key> &kk)
|
||||
@ -680,7 +681,7 @@ Error Context::startKeyImport(const std::vector<Key> &kk)
|
||||
*keys_it++ = it->impl();
|
||||
}
|
||||
}
|
||||
*keys_it++ = 0;
|
||||
*keys_it++ = nullptr;
|
||||
Error err = Error(d->lasterr = gpgme_op_import_keys_start(d->ctx, keys));
|
||||
delete[] keys;
|
||||
return err;
|
||||
@ -729,9 +730,9 @@ Error Context::edit(const Key &key, std::unique_ptr<EditInteractor> func, Data &
|
||||
d->lastEditInteractor = std::move(func);
|
||||
Data::Private *const dp = data.impl();
|
||||
return Error(d->lasterr = gpgme_op_edit(d->ctx, key.impl(),
|
||||
d->lastEditInteractor.get() ? edit_interactor_callback : 0,
|
||||
d->lastEditInteractor.get() ? d->lastEditInteractor->d : 0,
|
||||
dp ? dp->data : 0));
|
||||
d->lastEditInteractor.get() ? edit_interactor_callback : nullptr,
|
||||
d->lastEditInteractor.get() ? d->lastEditInteractor->d : nullptr,
|
||||
dp ? dp->data : nullptr));
|
||||
}
|
||||
|
||||
|
||||
@ -741,9 +742,9 @@ Error Context::startEditing(const Key &key, std::unique_ptr<EditInteractor> func
|
||||
d->lastEditInteractor = std::move(func);
|
||||
Data::Private *const dp = data.impl();
|
||||
return Error(d->lasterr = gpgme_op_edit_start(d->ctx, key.impl(),
|
||||
d->lastEditInteractor.get() ? edit_interactor_callback : 0,
|
||||
d->lastEditInteractor.get() ? d->lastEditInteractor->d : 0,
|
||||
dp ? dp->data : 0));
|
||||
d->lastEditInteractor.get() ? edit_interactor_callback : nullptr,
|
||||
d->lastEditInteractor.get() ? d->lastEditInteractor->d : nullptr,
|
||||
dp ? dp->data : nullptr));
|
||||
}
|
||||
|
||||
|
||||
@ -764,9 +765,9 @@ Error Context::cardEdit(const Key &key, std::unique_ptr<EditInteractor> func, Da
|
||||
d->lastCardEditInteractor = std::move(func);
|
||||
Data::Private *const dp = data.impl();
|
||||
return Error(d->lasterr = gpgme_op_card_edit(d->ctx, key.impl(),
|
||||
d->lastCardEditInteractor.get() ? edit_interactor_callback : 0,
|
||||
d->lastCardEditInteractor.get() ? d->lastCardEditInteractor->d : 0,
|
||||
dp ? dp->data : 0));
|
||||
d->lastCardEditInteractor.get() ? edit_interactor_callback : nullptr,
|
||||
d->lastCardEditInteractor.get() ? d->lastCardEditInteractor->d : nullptr,
|
||||
dp ? dp->data : nullptr));
|
||||
}
|
||||
|
||||
Error Context::startCardEditing(const Key &key, std::unique_ptr<EditInteractor> func, Data &data)
|
||||
@ -775,9 +776,9 @@ Error Context::startCardEditing(const Key &key, std::unique_ptr<EditInteractor>
|
||||
d->lastCardEditInteractor = std::move(func);
|
||||
Data::Private *const dp = data.impl();
|
||||
return Error(d->lasterr = gpgme_op_card_edit_start(d->ctx, key.impl(),
|
||||
d->lastCardEditInteractor.get() ? edit_interactor_callback : 0,
|
||||
d->lastCardEditInteractor.get() ? d->lastCardEditInteractor->d : 0,
|
||||
dp ? dp->data : 0));
|
||||
d->lastCardEditInteractor.get() ? edit_interactor_callback : nullptr,
|
||||
d->lastCardEditInteractor.get() ? d->lastCardEditInteractor->d : nullptr,
|
||||
dp ? dp->data : nullptr));
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic pop
|
||||
@ -800,7 +801,7 @@ Error Context::startTrustItemListing(const char *pattern, int maxLevel)
|
||||
|
||||
TrustItem Context::nextTrustItem(Error &e)
|
||||
{
|
||||
gpgme_trust_item_t ti = 0;
|
||||
gpgme_trust_item_t ti = nullptr;
|
||||
e = Error(d->lasterr = gpgme_op_trustlist_next(d->ctx, &ti));
|
||||
return TrustItem(ti);
|
||||
}
|
||||
@ -920,7 +921,7 @@ DecryptionResult Context::decrypt(const Data &cipherText, Data &plainText, const
|
||||
d->lastop = Private::Decrypt;
|
||||
const Data::Private *const cdp = cipherText.impl();
|
||||
Data::Private *const pdp = plainText.impl();
|
||||
d->lasterr = gpgme_op_decrypt_ext(d->ctx, static_cast<gpgme_decrypt_flags_t> (d->decryptFlags | flags), cdp ? cdp->data : 0, pdp ? pdp->data : 0);
|
||||
d->lasterr = gpgme_op_decrypt_ext(d->ctx, static_cast<gpgme_decrypt_flags_t> (d->decryptFlags | flags), cdp ? cdp->data : nullptr, pdp ? pdp->data : nullptr);
|
||||
return DecryptionResult(d->ctx, Error(d->lasterr));
|
||||
}
|
||||
|
||||
@ -935,7 +936,7 @@ Error Context::startDecryption(const Data &cipherText, Data &plainText, const De
|
||||
const Data::Private *const cdp = cipherText.impl();
|
||||
Data::Private *const pdp = plainText.impl();
|
||||
return Error(d->lasterr = gpgme_op_decrypt_ext_start(d->ctx, static_cast<gpgme_decrypt_flags_t> (d->decryptFlags | flags),
|
||||
cdp ? cdp->data : 0, pdp ? pdp->data : 0));
|
||||
cdp ? cdp->data : nullptr, pdp ? pdp->data : nullptr));
|
||||
}
|
||||
|
||||
Error Context::startDecryption(const Data &cipherText, Data &plainText)
|
||||
@ -957,7 +958,7 @@ VerificationResult Context::verifyDetachedSignature(const Data &signature, const
|
||||
d->lastop = Private::Verify;
|
||||
const Data::Private *const sdp = signature.impl();
|
||||
const Data::Private *const tdp = signedText.impl();
|
||||
d->lasterr = gpgme_op_verify(d->ctx, sdp ? sdp->data : 0, tdp ? tdp->data : 0, 0);
|
||||
d->lasterr = gpgme_op_verify(d->ctx, sdp ? sdp->data : nullptr, tdp ? tdp->data : nullptr, nullptr);
|
||||
return VerificationResult(d->ctx, Error(d->lasterr));
|
||||
}
|
||||
|
||||
@ -966,7 +967,7 @@ VerificationResult Context::verifyOpaqueSignature(const Data &signedData, Data &
|
||||
d->lastop = Private::Verify;
|
||||
const Data::Private *const sdp = signedData.impl();
|
||||
Data::Private *const pdp = plainText.impl();
|
||||
d->lasterr = gpgme_op_verify(d->ctx, sdp ? sdp->data : 0, 0, pdp ? pdp->data : 0);
|
||||
d->lasterr = gpgme_op_verify(d->ctx, sdp ? sdp->data : nullptr, nullptr, pdp ? pdp->data : nullptr);
|
||||
return VerificationResult(d->ctx, Error(d->lasterr));
|
||||
}
|
||||
|
||||
@ -975,7 +976,7 @@ Error Context::startDetachedSignatureVerification(const Data &signature, const D
|
||||
d->lastop = Private::Verify;
|
||||
const Data::Private *const sdp = signature.impl();
|
||||
const Data::Private *const tdp = signedText.impl();
|
||||
return Error(d->lasterr = gpgme_op_verify_start(d->ctx, sdp ? sdp->data : 0, tdp ? tdp->data : 0, 0));
|
||||
return Error(d->lasterr = gpgme_op_verify_start(d->ctx, sdp ? sdp->data : nullptr, tdp ? tdp->data : nullptr, nullptr));
|
||||
}
|
||||
|
||||
Error Context::startOpaqueSignatureVerification(const Data &signedData, Data &plainText)
|
||||
@ -983,7 +984,7 @@ Error Context::startOpaqueSignatureVerification(const Data &signedData, Data &pl
|
||||
d->lastop = Private::Verify;
|
||||
const Data::Private *const sdp = signedData.impl();
|
||||
Data::Private *const pdp = plainText.impl();
|
||||
return Error(d->lasterr = gpgme_op_verify_start(d->ctx, sdp ? sdp->data : 0, 0, pdp ? pdp->data : 0));
|
||||
return Error(d->lasterr = gpgme_op_verify_start(d->ctx, sdp ? sdp->data : nullptr, nullptr, pdp ? pdp->data : nullptr));
|
||||
}
|
||||
|
||||
VerificationResult Context::verificationResult() const
|
||||
@ -1001,7 +1002,7 @@ std::pair<DecryptionResult, VerificationResult> Context::decryptAndVerify(const
|
||||
const Data::Private *const cdp = cipherText.impl();
|
||||
Data::Private *const pdp = plainText.impl();
|
||||
d->lasterr = gpgme_op_decrypt_ext(d->ctx, static_cast<gpgme_decrypt_flags_t> (d->decryptFlags | flags | DecryptVerify),
|
||||
cdp ? cdp->data : 0, pdp ? pdp->data : 0);
|
||||
cdp ? cdp->data : nullptr, pdp ? pdp->data : nullptr);
|
||||
return std::make_pair(DecryptionResult(d->ctx, Error(d->lasterr)),
|
||||
VerificationResult(d->ctx, Error(d->lasterr)));
|
||||
}
|
||||
@ -1016,7 +1017,7 @@ Error Context::startCombinedDecryptionAndVerification(const Data &cipherText, Da
|
||||
d->lastop = Private::DecryptAndVerify;
|
||||
const Data::Private *const cdp = cipherText.impl();
|
||||
Data::Private *const pdp = plainText.impl();
|
||||
return Error(d->lasterr = gpgme_op_decrypt_ext_start(d->ctx, static_cast<gpgme_decrypt_flags_t> (d->decryptFlags | flags | DecryptVerify), cdp ? cdp->data : 0, pdp ? pdp->data : 0));
|
||||
return Error(d->lasterr = gpgme_op_decrypt_ext_start(d->ctx, static_cast<gpgme_decrypt_flags_t> (d->decryptFlags | flags | DecryptVerify), cdp ? cdp->data : nullptr, pdp ? pdp->data : nullptr));
|
||||
}
|
||||
|
||||
Error Context::startCombinedDecryptionAndVerification(const Data &cipherText, Data &plainText)
|
||||
@ -1043,14 +1044,14 @@ Error Context::startGetAuditLog(Data &output, unsigned int flags)
|
||||
{
|
||||
d->lastop = Private::GetAuditLog;
|
||||
Data::Private *const odp = output.impl();
|
||||
return Error(d->lasterr = gpgme_op_getauditlog_start(d->ctx, odp ? odp->data : 0, to_auditlog_flags(flags)));
|
||||
return Error(d->lasterr = gpgme_op_getauditlog_start(d->ctx, odp ? odp->data : nullptr, to_auditlog_flags(flags)));
|
||||
}
|
||||
|
||||
Error Context::getAuditLog(Data &output, unsigned int flags)
|
||||
{
|
||||
d->lastop = Private::GetAuditLog;
|
||||
Data::Private *const odp = output.impl();
|
||||
return Error(d->lasterr = gpgme_op_getauditlog(d->ctx, odp ? odp->data : 0, to_auditlog_flags(flags)));
|
||||
return Error(d->lasterr = gpgme_op_getauditlog(d->ctx, odp ? odp->data : nullptr, to_auditlog_flags(flags)));
|
||||
}
|
||||
|
||||
void Context::clearSigningKeys()
|
||||
@ -1091,7 +1092,7 @@ GpgME::Error Context::addSignatureNotation(const char *name, const char *value,
|
||||
|
||||
GpgME::Error Context::addSignaturePolicyURL(const char *url, bool critical)
|
||||
{
|
||||
return Error(gpgme_sig_notation_add(d->ctx, 0, url, critical ? GPGME_SIG_NOTATION_CRITICAL : 0));
|
||||
return Error(gpgme_sig_notation_add(d->ctx, nullptr, url, critical ? GPGME_SIG_NOTATION_CRITICAL : 0));
|
||||
}
|
||||
|
||||
const char *Context::signaturePolicyURL() const
|
||||
@ -1142,7 +1143,7 @@ SigningResult Context::sign(const Data &plainText, Data &signature, SignatureMod
|
||||
d->lastop = Private::Sign;
|
||||
const Data::Private *const pdp = plainText.impl();
|
||||
Data::Private *const sdp = signature.impl();
|
||||
d->lasterr = gpgme_op_sign(d->ctx, pdp ? pdp->data : 0, sdp ? sdp->data : 0, sigmode2sigmode(mode));
|
||||
d->lasterr = gpgme_op_sign(d->ctx, pdp ? pdp->data : nullptr, sdp ? sdp->data : nullptr, sigmode2sigmode(mode));
|
||||
return SigningResult(d->ctx, Error(d->lasterr));
|
||||
}
|
||||
|
||||
@ -1151,7 +1152,7 @@ Error Context::startSigning(const Data &plainText, Data &signature, SignatureMod
|
||||
d->lastop = Private::Sign;
|
||||
const Data::Private *const pdp = plainText.impl();
|
||||
Data::Private *const sdp = signature.impl();
|
||||
return Error(d->lasterr = gpgme_op_sign_start(d->ctx, pdp ? pdp->data : 0, sdp ? sdp->data : 0, sigmode2sigmode(mode)));
|
||||
return Error(d->lasterr = gpgme_op_sign_start(d->ctx, pdp ? pdp->data : nullptr, sdp ? sdp->data : nullptr, sigmode2sigmode(mode)));
|
||||
}
|
||||
|
||||
SigningResult Context::signingResult() const
|
||||
@ -1199,7 +1200,7 @@ gpgme_key_t *Context::getKeysFromRecipients(const std::vector<Key> &recipients)
|
||||
*keys_it++ = it->impl();
|
||||
}
|
||||
}
|
||||
*keys_it++ = 0;
|
||||
*keys_it++ = nullptr;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -1213,7 +1214,7 @@ EncryptionResult Context::encrypt(const std::vector<Key> &recipients, const Data
|
||||
Data::Private *const cdp = cipherText.impl();
|
||||
gpgme_key_t *const keys = getKeysFromRecipients(recipients);
|
||||
d->lasterr = gpgme_op_encrypt(d->ctx, keys, encryptflags2encryptflags(flags),
|
||||
pdp ? pdp->data : 0, cdp ? cdp->data : 0);
|
||||
pdp ? pdp->data : nullptr, cdp ? cdp->data : nullptr);
|
||||
if (keys) {
|
||||
delete[] keys;
|
||||
}
|
||||
@ -1225,8 +1226,8 @@ Error Context::encryptSymmetrically(const Data &plainText, Data &cipherText)
|
||||
d->lastop = Private::Encrypt;
|
||||
const Data::Private *const pdp = plainText.impl();
|
||||
Data::Private *const cdp = cipherText.impl();
|
||||
return Error(d->lasterr = gpgme_op_encrypt(d->ctx, 0, (gpgme_encrypt_flags_t)0,
|
||||
pdp ? pdp->data : 0, cdp ? cdp->data : 0));
|
||||
return Error(d->lasterr = gpgme_op_encrypt(d->ctx, nullptr, (gpgme_encrypt_flags_t)0,
|
||||
pdp ? pdp->data : nullptr, cdp ? cdp->data : nullptr));
|
||||
}
|
||||
|
||||
Error Context::startEncryption(const std::vector<Key> &recipients, const Data &plainText, Data &cipherText, EncryptionFlags flags)
|
||||
@ -1239,7 +1240,7 @@ Error Context::startEncryption(const std::vector<Key> &recipients, const Data &p
|
||||
Data::Private *const cdp = cipherText.impl();
|
||||
gpgme_key_t *const keys = getKeysFromRecipients(recipients);
|
||||
d->lasterr = gpgme_op_encrypt_start(d->ctx, keys, encryptflags2encryptflags(flags),
|
||||
pdp ? pdp->data : 0, cdp ? cdp->data : 0);
|
||||
pdp ? pdp->data : nullptr, cdp ? cdp->data : nullptr);
|
||||
if (keys) {
|
||||
delete[] keys;
|
||||
}
|
||||
@ -1262,7 +1263,7 @@ std::pair<SigningResult, EncryptionResult> Context::signAndEncrypt(const std::ve
|
||||
Data::Private *const cdp = cipherText.impl();
|
||||
gpgme_key_t *const keys = getKeysFromRecipients(recipients);
|
||||
d->lasterr = gpgme_op_encrypt_sign(d->ctx, keys, encryptflags2encryptflags(flags),
|
||||
pdp ? pdp->data : 0, cdp ? cdp->data : 0);
|
||||
pdp ? pdp->data : nullptr, cdp ? cdp->data : nullptr);
|
||||
if (keys) {
|
||||
delete[] keys;
|
||||
}
|
||||
@ -1277,7 +1278,7 @@ Error Context::startCombinedSigningAndEncryption(const std::vector<Key> &recipie
|
||||
Data::Private *const cdp = cipherText.impl();
|
||||
gpgme_key_t *const keys = getKeysFromRecipients(recipients);
|
||||
d->lasterr = gpgme_op_encrypt_sign_start(d->ctx, keys, encryptflags2encryptflags(flags),
|
||||
pdp ? pdp->data : 0, cdp ? cdp->data : 0);
|
||||
pdp ? pdp->data : nullptr, cdp ? cdp->data : nullptr);
|
||||
if (keys) {
|
||||
delete[] keys;
|
||||
}
|
||||
@ -1294,7 +1295,7 @@ Error Context::createVFS(const char *containerFile, const std::vector< Key > &re
|
||||
*keys_it++ = it->impl();
|
||||
}
|
||||
}
|
||||
*keys_it++ = 0;
|
||||
*keys_it++ = nullptr;
|
||||
|
||||
gpgme_error_t op_err;
|
||||
d->lasterr = gpgme_op_vfs_create(d->ctx, keys, containerFile, 0, &op_err);
|
||||
@ -1662,12 +1663,12 @@ std::ostream &operator<<(std::ostream &os, Context::AuditLogFlags flags)
|
||||
|
||||
GpgME::Error GpgME::setDefaultLocale(int cat, const char *val)
|
||||
{
|
||||
return Error(gpgme_set_locale(0, cat, val));
|
||||
return Error(gpgme_set_locale(nullptr, cat, val));
|
||||
}
|
||||
|
||||
GpgME::EngineInfo GpgME::engineInfo(GpgME::Protocol proto)
|
||||
{
|
||||
gpgme_engine_info_t ei = 0;
|
||||
gpgme_engine_info_t ei = nullptr;
|
||||
if (gpgme_get_engine_info(&ei)) {
|
||||
return EngineInfo();
|
||||
}
|
||||
@ -1718,7 +1719,7 @@ static gpgme_protocol_t engine2protocol(const GpgME::Engine engine)
|
||||
|
||||
GpgME::EngineInfo GpgME::engineInfo(GpgME::Engine engine)
|
||||
{
|
||||
gpgme_engine_info_t ei = 0;
|
||||
gpgme_engine_info_t ei = nullptr;
|
||||
if (gpgme_get_engine_info(&ei)) {
|
||||
return EngineInfo();
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ public:
|
||||
static Context *createForProtocol(Protocol proto);
|
||||
/** Same as above but returning a unique ptr. */
|
||||
static std::unique_ptr<Context> create(Protocol proto);
|
||||
static std::unique_ptr<Context> createForEngine(Engine engine, Error *err = 0);
|
||||
static std::unique_ptr<Context> createForEngine(Engine engine, Error *err = nullptr);
|
||||
virtual ~Context();
|
||||
|
||||
//
|
||||
@ -161,7 +161,7 @@ public:
|
||||
// Key Listing
|
||||
//
|
||||
|
||||
GpgME::Error startKeyListing(const char *pattern = 0, bool secretOnly = false);
|
||||
GpgME::Error startKeyListing(const char *pattern = nullptr, bool secretOnly = false);
|
||||
GpgME::Error startKeyListing(const char *patterns[], bool secretOnly = false);
|
||||
|
||||
Key nextKey(GpgME::Error &e);
|
||||
|
@ -69,7 +69,7 @@ public:
|
||||
EndMarker
|
||||
};
|
||||
|
||||
Private(gpgme_ctx_t c = 0);
|
||||
Private(gpgme_ctx_t c = nullptr);
|
||||
~Private();
|
||||
|
||||
gpgme_ctx_t ctx;
|
||||
|
@ -30,10 +30,10 @@
|
||||
|
||||
GIOChannel *GpgME::getGIOChannel(int)
|
||||
{
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QIODevice *GpgME::getQIODevice(int)
|
||||
{
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -48,11 +48,11 @@ GpgME::Data::Data()
|
||||
{
|
||||
gpgme_data_t data;
|
||||
const gpgme_error_t e = gpgme_data_new(&data);
|
||||
d.reset(new Private(e ? 0 : data));
|
||||
d.reset(new Private(e ? nullptr : data));
|
||||
}
|
||||
|
||||
GpgME::Data::Data(const Null &)
|
||||
: d(new Private(0))
|
||||
: d(new Private(nullptr))
|
||||
{
|
||||
|
||||
}
|
||||
@ -70,14 +70,14 @@ GpgME::Data::Data(const char *buffer, size_t size, bool copy)
|
||||
std::string sizestr = std::to_string(size);
|
||||
// Ignore errors as this is optional
|
||||
gpgme_data_set_flag(data, "size-hint", sizestr.c_str());
|
||||
d.reset(new Private(e ? 0 : data));
|
||||
d.reset(new Private(e ? nullptr : data));
|
||||
}
|
||||
|
||||
GpgME::Data::Data(const char *filename)
|
||||
{
|
||||
gpgme_data_t data;
|
||||
const gpgme_error_t e = gpgme_data_new(&data);
|
||||
d.reset(new Private(e ? 0 : data));
|
||||
d.reset(new Private(e ? nullptr : data));
|
||||
if (!e) {
|
||||
setFileName(filename);
|
||||
}
|
||||
@ -86,29 +86,29 @@ GpgME::Data::Data(const char *filename)
|
||||
GpgME::Data::Data(const char *filename, off_t offset, size_t length)
|
||||
{
|
||||
gpgme_data_t data;
|
||||
const gpgme_error_t e = gpgme_data_new_from_filepart(&data, filename, 0, offset, length);
|
||||
d.reset(new Private(e ? 0 : data));
|
||||
const gpgme_error_t e = gpgme_data_new_from_filepart(&data, filename, nullptr, offset, length);
|
||||
d.reset(new Private(e ? nullptr : data));
|
||||
}
|
||||
|
||||
GpgME::Data::Data(FILE *fp)
|
||||
{
|
||||
gpgme_data_t data;
|
||||
const gpgme_error_t e = gpgme_data_new_from_stream(&data, fp);
|
||||
d.reset(new Private(e ? 0 : data));
|
||||
d.reset(new Private(e ? nullptr : data));
|
||||
}
|
||||
|
||||
GpgME::Data::Data(FILE *fp, off_t offset, size_t length)
|
||||
{
|
||||
gpgme_data_t data;
|
||||
const gpgme_error_t e = gpgme_data_new_from_filepart(&data, 0, fp, offset, length);
|
||||
d.reset(new Private(e ? 0 : data));
|
||||
const gpgme_error_t e = gpgme_data_new_from_filepart(&data, nullptr, fp, offset, length);
|
||||
d.reset(new Private(e ? nullptr : data));
|
||||
}
|
||||
|
||||
GpgME::Data::Data(int fd)
|
||||
{
|
||||
gpgme_data_t data;
|
||||
const gpgme_error_t e = gpgme_data_new_from_fd(&data, fd);
|
||||
d.reset(new Private(e ? 0 : data));
|
||||
d.reset(new Private(e ? nullptr : data));
|
||||
}
|
||||
|
||||
GpgME::Data::Data(DataProvider *dp)
|
||||
@ -118,20 +118,20 @@ GpgME::Data::Data(DataProvider *dp)
|
||||
return;
|
||||
}
|
||||
if (!dp->isSupported(DataProvider::Read)) {
|
||||
d->cbs.read = 0;
|
||||
d->cbs.read = nullptr;
|
||||
}
|
||||
if (!dp->isSupported(DataProvider::Write)) {
|
||||
d->cbs.write = 0;
|
||||
d->cbs.write = nullptr;
|
||||
}
|
||||
if (!dp->isSupported(DataProvider::Seek)) {
|
||||
d->cbs.seek = 0;
|
||||
d->cbs.seek = nullptr;
|
||||
}
|
||||
if (!dp->isSupported(DataProvider::Release)) {
|
||||
d->cbs.release = 0;
|
||||
d->cbs.release = nullptr;
|
||||
}
|
||||
const gpgme_error_t e = gpgme_data_new_from_cbs(&d->data, &d->cbs, dp);
|
||||
if (e) {
|
||||
d->data = 0;
|
||||
d->data = nullptr;
|
||||
}
|
||||
if (dp->isSupported(DataProvider::Seek)) {
|
||||
off_t size = seek(0, SEEK_END);
|
||||
|
@ -31,7 +31,7 @@
|
||||
class GpgME::Data::Private
|
||||
{
|
||||
public:
|
||||
explicit Private(gpgme_data_t d = 0)
|
||||
explicit Private(gpgme_data_t d = nullptr)
|
||||
: data(d), cbs(data_provider_callbacks) {}
|
||||
~Private();
|
||||
|
||||
|
@ -59,22 +59,22 @@ public:
|
||||
for (gpgme_recipient_t r = res.recipients ; r ; r = r->next) {
|
||||
recipients.push_back(*r);
|
||||
}
|
||||
res.recipients = 0;
|
||||
res.recipients = nullptr;
|
||||
}
|
||||
~Private()
|
||||
{
|
||||
if (res.unsupported_algorithm) {
|
||||
std::free(res.unsupported_algorithm);
|
||||
}
|
||||
res.unsupported_algorithm = 0;
|
||||
res.unsupported_algorithm = nullptr;
|
||||
if (res.file_name) {
|
||||
std::free(res.file_name);
|
||||
}
|
||||
res.file_name = 0;
|
||||
res.file_name = nullptr;
|
||||
if (res.symkey_algo) {
|
||||
std::free(res.symkey_algo);
|
||||
}
|
||||
res.symkey_algo = 0;
|
||||
res.symkey_algo = nullptr;
|
||||
}
|
||||
|
||||
_gpgme_op_decrypt_result res;
|
||||
@ -109,7 +109,7 @@ make_standard_stuff(DecryptionResult)
|
||||
|
||||
const char *GpgME::DecryptionResult::unsupportedAlgorithm() const
|
||||
{
|
||||
return d ? d->res.unsupported_algorithm : 0 ;
|
||||
return d ? d->res.unsupported_algorithm : nullptr ;
|
||||
}
|
||||
|
||||
bool GpgME::DecryptionResult::isWrongKeyUsage() const
|
||||
@ -124,7 +124,7 @@ bool GpgME::DecryptionResult::isDeVs() const
|
||||
|
||||
const char *GpgME::DecryptionResult::fileName() const
|
||||
{
|
||||
return d ? d->res.file_name : 0 ;
|
||||
return d ? d->res.file_name : nullptr ;
|
||||
}
|
||||
|
||||
unsigned int GpgME::DecryptionResult::numRecipients() const
|
||||
@ -208,7 +208,7 @@ const char *GpgME::DecryptionResult::Recipient::keyID() const
|
||||
if (d) {
|
||||
return d->_keyid;
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const char *GpgME::DecryptionResult::Recipient::shortKeyID() const
|
||||
@ -217,7 +217,7 @@ const char *GpgME::DecryptionResult::Recipient::shortKeyID() const
|
||||
if (d) {
|
||||
return d->_keyid + 8;
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
unsigned int GpgME::DecryptionResult::Recipient::publicKeyAlgorithm() const
|
||||
@ -233,7 +233,7 @@ const char *GpgME::DecryptionResult::Recipient::publicKeyAlgorithmAsString() con
|
||||
if (d) {
|
||||
return gpgme_pubkey_algo_name(d->pubkey_algo);
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
GpgME::Error GpgME::DecryptionResult::Recipient::status() const
|
||||
|
@ -53,9 +53,9 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
/* reimp */ Error data(const char *data, size_t datalen);
|
||||
/* reimp */ Data inquire(const char *name, const char *args, Error &err);
|
||||
/* reimp */ Error status(const char *status, const char *args);
|
||||
Error data(const char *data, size_t datalen) override;
|
||||
Data inquire(const char *name, const char *args, Error &err) override;
|
||||
Error status(const char *status, const char *args) override;
|
||||
|
||||
private:
|
||||
std::vector< std::pair<std::string, std::string> > m_status;
|
||||
|
@ -176,7 +176,7 @@ EditInteractor::Private::Private(EditInteractor *qq)
|
||||
: q(qq),
|
||||
state(StartState),
|
||||
error(),
|
||||
debug(0)
|
||||
debug(nullptr)
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ public:
|
||||
if (ik->fpr) {
|
||||
copy->fpr = strdup(ik->fpr);
|
||||
}
|
||||
copy->next = 0;
|
||||
copy->next = nullptr;
|
||||
invalid.push_back(copy);
|
||||
}
|
||||
}
|
||||
@ -61,7 +61,7 @@ public:
|
||||
{
|
||||
for (std::vector<gpgme_invalid_key_t>::iterator it = invalid.begin() ; it != invalid.end() ; ++it) {
|
||||
std::free((*it)->fpr);
|
||||
delete *it; *it = 0;
|
||||
delete *it; *it = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@ -132,7 +132,7 @@ bool GpgME::InvalidRecipient::isNull() const
|
||||
|
||||
const char *GpgME::InvalidRecipient::fingerprint() const
|
||||
{
|
||||
return isNull() ? 0 : d->invalid[idx]->fpr ;
|
||||
return isNull() ? nullptr : d->invalid[idx]->fpr ;
|
||||
}
|
||||
|
||||
GpgME::Error GpgME::InvalidRecipient::reason() const
|
||||
|
@ -33,10 +33,10 @@
|
||||
class GpgME::EngineInfo::Private
|
||||
{
|
||||
public:
|
||||
Private(gpgme_engine_info_t engine = 0) : info(engine) {}
|
||||
Private(gpgme_engine_info_t engine = nullptr) : info(engine) {}
|
||||
~Private()
|
||||
{
|
||||
info = 0;
|
||||
info = nullptr;
|
||||
}
|
||||
|
||||
gpgme_engine_info_t info;
|
||||
@ -70,12 +70,12 @@ GpgME::Protocol GpgME::EngineInfo::protocol() const
|
||||
|
||||
const char *GpgME::EngineInfo::fileName() const
|
||||
{
|
||||
return isNull() ? 0 : d->info->file_name;
|
||||
return isNull() ? nullptr : d->info->file_name;
|
||||
}
|
||||
|
||||
const char *GpgME::EngineInfo::version() const
|
||||
{
|
||||
return isNull() ? 0 : d->info->version;
|
||||
return isNull() ? nullptr : d->info->version;
|
||||
}
|
||||
|
||||
GpgME::EngineInfo::Version GpgME::EngineInfo::engineVersion() const
|
||||
@ -85,10 +85,10 @@ GpgME::EngineInfo::Version GpgME::EngineInfo::engineVersion() const
|
||||
|
||||
const char *GpgME::EngineInfo::requiredVersion() const
|
||||
{
|
||||
return isNull() ? 0 : d->info->req_version;
|
||||
return isNull() ? nullptr : d->info->req_version;
|
||||
}
|
||||
|
||||
const char *GpgME::EngineInfo::homeDirectory() const
|
||||
{
|
||||
return isNull() ? 0 : d->info->home_dir;
|
||||
return isNull() ? nullptr : d->info->home_dir;
|
||||
}
|
||||
|
@ -77,10 +77,10 @@ public:
|
||||
|
||||
const gpgme_io_cbs EventLoopInteractor::Private::iocbs = {
|
||||
&EventLoopInteractor::Private::registerIOCb,
|
||||
0,
|
||||
nullptr,
|
||||
&EventLoopInteractor::Private::removeIOCb,
|
||||
&EventLoopInteractor::Private::eventIOCb,
|
||||
0
|
||||
nullptr
|
||||
};
|
||||
|
||||
//
|
||||
@ -114,7 +114,7 @@ void EventLoopInteractor::Private::removeIOCb(void *tag)
|
||||
it != instance()->d->mCallbacks.end() ; ++it) {
|
||||
if (*it == tag) {
|
||||
instance()->unregisterWatcher((*it)->externalTag);
|
||||
delete *it; *it = 0;
|
||||
delete *it; *it = nullptr;
|
||||
instance()->d->mCallbacks.erase(it);
|
||||
return;
|
||||
}
|
||||
@ -159,7 +159,7 @@ void EventLoopInteractor::Private::eventIOCb(void *data, gpgme_event_io_t type,
|
||||
// EventLoopInteractor Implementation
|
||||
//
|
||||
|
||||
EventLoopInteractor *EventLoopInteractor::mSelf = 0;
|
||||
EventLoopInteractor *EventLoopInteractor::mSelf = nullptr;
|
||||
|
||||
EventLoopInteractor::EventLoopInteractor() : d(new Private)
|
||||
{
|
||||
@ -170,7 +170,7 @@ EventLoopInteractor::EventLoopInteractor() : d(new Private)
|
||||
EventLoopInteractor::~EventLoopInteractor()
|
||||
{
|
||||
// warn if there are still callbacks registered
|
||||
mSelf = 0;
|
||||
mSelf = nullptr;
|
||||
delete d;
|
||||
}
|
||||
|
||||
|
@ -165,7 +165,7 @@ GPGMEPP_EXPORT bool hasFeature(unsigned long feature, unsigned long feature2);
|
||||
struct __safe_bool_dummy__ { void nonnull() {} }; \
|
||||
typedef void ( __safe_bool_dummy__::*unspecified_bool_type )(); \
|
||||
public: \
|
||||
operator unspecified_bool_type() const { return ( Cond ) ? &__safe_bool_dummy__::nonnull : 0 ; }
|
||||
operator unspecified_bool_type() const { return ( Cond ) ? &__safe_bool_dummy__::nonnull : nullptr; }
|
||||
# endif
|
||||
|
||||
inline int _gpgmepp_strcmp(const char *s1, const char *s2)
|
||||
|
@ -105,10 +105,10 @@ const char *GpgAddUserIDEditInteractor::action(Error &err) const
|
||||
return "Y";
|
||||
case START:
|
||||
case ERROR:
|
||||
return 0;
|
||||
return nullptr;
|
||||
default:
|
||||
err = Error::fromCode(GPG_ERR_GENERAL);
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -57,8 +57,8 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
/* reimp */ const char *action(Error &err) const;
|
||||
/* reimp */ unsigned int nextState(unsigned int statusCode, const char *args, Error &err) const;
|
||||
const char *action(Error &err) const override;
|
||||
unsigned int nextState(unsigned int statusCode, const char *args, Error &err) const override;
|
||||
|
||||
private:
|
||||
std::string m_name, m_email, m_comment;
|
||||
|
@ -56,10 +56,10 @@ public:
|
||||
std::string sshSocketName() const;
|
||||
|
||||
private:
|
||||
/* reimp */ const char *command() const;
|
||||
/* reimp */ Error data(const char *data, size_t datalen);
|
||||
/* reimp */ Data inquire(const char *name, const char *args, Error &err);
|
||||
/* reimp */ Error status(const char *status, const char *args);
|
||||
const char *command() const;
|
||||
Error data(const char *data, size_t datalen) override;
|
||||
Data inquire(const char *name, const char *args, Error &err) override;
|
||||
Error status(const char *status, const char *args) override;
|
||||
|
||||
private:
|
||||
void makeCommand() const;
|
||||
|
@ -143,10 +143,10 @@ const char *GpgGenCardKeyInteractor::action(Error &err) const
|
||||
case GOT_SERIAL:
|
||||
case BACKUP_KEY_CREATED:
|
||||
case ERROR:
|
||||
return 0;
|
||||
return nullptr;
|
||||
default:
|
||||
err = Error::fromCode(GPG_ERR_GENERAL);
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -59,8 +59,8 @@ public:
|
||||
std::string backupFileName() const;
|
||||
|
||||
private:
|
||||
/* reimp */ const char *action(Error &err) const;
|
||||
/* reimp */ unsigned int nextState(unsigned int statusCode, const char *args, Error &err) const;
|
||||
const char *action(Error &err) const override;
|
||||
unsigned int nextState(unsigned int statusCode, const char *args, Error &err) const override;
|
||||
|
||||
private:
|
||||
class Private;
|
||||
|
@ -81,10 +81,10 @@ const char *GpgSetExpiryTimeEditInteractor::action(Error &err) const
|
||||
return "Y";
|
||||
case START:
|
||||
case ERROR:
|
||||
return 0;
|
||||
return nullptr;
|
||||
default:
|
||||
err = Error::fromCode(GPG_ERR_GENERAL);
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -39,8 +39,8 @@ public:
|
||||
~GpgSetExpiryTimeEditInteractor();
|
||||
|
||||
private:
|
||||
/* reimp */ const char *action(Error &err) const;
|
||||
/* reimp */ unsigned int nextState(unsigned int statusCode, const char *args, Error &err) const;
|
||||
const char *action(Error &err) const override;
|
||||
unsigned int nextState(unsigned int statusCode, const char *args, Error &err) const override;
|
||||
|
||||
private:
|
||||
const std::string m_strtime;
|
||||
|
@ -85,10 +85,10 @@ const char *GpgSetOwnerTrustEditInteractor::action(Error &err) const
|
||||
return "Y";
|
||||
case START:
|
||||
case ERROR:
|
||||
return 0;
|
||||
return nullptr;
|
||||
default:
|
||||
err = Error::fromCode(GPG_ERR_GENERAL);
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -40,8 +40,8 @@ public:
|
||||
~GpgSetOwnerTrustEditInteractor();
|
||||
|
||||
private:
|
||||
/* reimp */ const char *action(Error &err) const;
|
||||
/* reimp */ unsigned int nextState(unsigned int statusCode, const char *args, Error &err) const;
|
||||
const char *action(Error &err) const override;
|
||||
unsigned int nextState(unsigned int statusCode, const char *args, Error &err) const override;
|
||||
|
||||
private:
|
||||
const Key::OwnerTrust m_ownertrust;
|
||||
|
@ -233,7 +233,7 @@ const char *GpgSignKeyEditInteractor::action(Error &err) const
|
||||
//TODO
|
||||
case SET_TRUST_REGEXP:
|
||||
//TODO
|
||||
return 0;
|
||||
return nullptr;
|
||||
case SET_CHECK_LEVEL:
|
||||
return check_level_strings[d->checkLevel];
|
||||
case CONFIRM2:
|
||||
@ -253,7 +253,7 @@ const char *GpgSignKeyEditInteractor::action(Error &err) const
|
||||
// fall through
|
||||
case ERROR:
|
||||
err = Error::fromCode(GPG_ERR_GENERAL);
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -53,8 +53,8 @@ public:
|
||||
void setSigningOptions(int options);
|
||||
|
||||
private:
|
||||
/* reimp */ const char *action(Error &err) const;
|
||||
/* reimp */ unsigned int nextState(unsigned int statusCode, const char *args, Error &err) const;
|
||||
const char *action(Error &err) const override;
|
||||
unsigned int nextState(unsigned int statusCode, const char *args, Error &err) const override;
|
||||
|
||||
private:
|
||||
class Private;
|
||||
|
@ -46,16 +46,16 @@ public:
|
||||
for (gpgme_import_status_t is = r.imports ; is ; is = is->next) {
|
||||
gpgme_import_status_t copy = new _gpgme_import_status(*is);
|
||||
copy->fpr = strdup(is->fpr);
|
||||
copy->next = 0;
|
||||
copy->next = nullptr;
|
||||
imports.push_back(copy);
|
||||
}
|
||||
res.imports = 0;
|
||||
res.imports = nullptr;
|
||||
}
|
||||
~Private()
|
||||
{
|
||||
for (std::vector<gpgme_import_status_t>::iterator it = imports.begin() ; it != imports.end() ; ++it) {
|
||||
std::free((*it)->fpr);
|
||||
delete *it; *it = 0;
|
||||
delete *it; *it = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@ -192,7 +192,7 @@ bool GpgME::Import::isNull() const
|
||||
|
||||
const char *GpgME::Import::fingerprint() const
|
||||
{
|
||||
return isNull() ? 0 : d->imports[idx]->fpr ;
|
||||
return isNull() ? nullptr : d->imports[idx]->fpr ;
|
||||
}
|
||||
|
||||
GpgME::Error GpgME::Import::error() const
|
||||
|
@ -165,7 +165,7 @@ Protocol Key::protocol() const
|
||||
|
||||
const char *Key::protocolAsString() const
|
||||
{
|
||||
return key ? gpgme_get_protocol_name(key->protocol) : 0 ;
|
||||
return key ? gpgme_get_protocol_name(key->protocol) : nullptr ;
|
||||
}
|
||||
|
||||
bool Key::isRevoked() const
|
||||
@ -252,26 +252,26 @@ bool Key::isDeVs() const
|
||||
|
||||
const char *Key::issuerSerial() const
|
||||
{
|
||||
return key ? key->issuer_serial : 0 ;
|
||||
return key ? key->issuer_serial : nullptr ;
|
||||
}
|
||||
const char *Key::issuerName() const
|
||||
{
|
||||
return key ? key->issuer_name : 0 ;
|
||||
return key ? key->issuer_name : nullptr ;
|
||||
}
|
||||
const char *Key::chainID() const
|
||||
{
|
||||
return key ? key->chain_id : 0 ;
|
||||
return key ? key->chain_id : nullptr ;
|
||||
}
|
||||
|
||||
const char *Key::keyID() const
|
||||
{
|
||||
return key && key->subkeys ? key->subkeys->keyid : 0 ;
|
||||
return key && key->subkeys ? key->subkeys->keyid : nullptr ;
|
||||
}
|
||||
|
||||
const char *Key::shortKeyID() const
|
||||
{
|
||||
if (!key || !key->subkeys || !key->subkeys->keyid) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
const int len = strlen(key->subkeys->keyid);
|
||||
if (len > 8) {
|
||||
@ -299,7 +299,7 @@ const char *Key::primaryFingerprint() const
|
||||
|
||||
unsigned int Key::keyListMode() const
|
||||
{
|
||||
return key ? convert_from_gpgme_keylist_mode_t(key->keylist_mode) : 0 ;
|
||||
return key ? convert_from_gpgme_keylist_mode_t(key->keylist_mode) : 0;
|
||||
}
|
||||
|
||||
const Key &Key::mergeWith(const Key &other)
|
||||
@ -410,7 +410,7 @@ gpgme_sub_key_t find_subkey(const shared_gpgme_key_t &key, unsigned int idx)
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
gpgme_sub_key_t verify_subkey(const shared_gpgme_key_t &key, gpgme_sub_key_t subkey)
|
||||
@ -422,10 +422,10 @@ gpgme_sub_key_t verify_subkey(const shared_gpgme_key_t &key, gpgme_sub_key_t sub
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Subkey::Subkey() : key(), subkey(0) {}
|
||||
Subkey::Subkey() : key(), subkey(nullptr) {}
|
||||
|
||||
Subkey::Subkey(const shared_gpgme_key_t &k, unsigned int idx)
|
||||
: key(k), subkey(find_subkey(k, idx))
|
||||
@ -446,12 +446,12 @@ Key Subkey::parent() const
|
||||
|
||||
const char *Subkey::keyID() const
|
||||
{
|
||||
return subkey ? subkey->keyid : 0 ;
|
||||
return subkey ? subkey->keyid : nullptr ;
|
||||
}
|
||||
|
||||
const char *Subkey::fingerprint() const
|
||||
{
|
||||
return subkey ? subkey->fpr : 0 ;
|
||||
return subkey ? subkey->fpr : nullptr ;
|
||||
}
|
||||
|
||||
Subkey::PubkeyAlgo Subkey::publicKeyAlgorithm() const
|
||||
@ -589,7 +589,7 @@ gpgme_user_id_t find_uid(const shared_gpgme_key_t &key, unsigned int idx)
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
gpgme_user_id_t verify_uid(const shared_gpgme_key_t &key, gpgme_user_id_t uid)
|
||||
@ -601,10 +601,10 @@ gpgme_user_id_t verify_uid(const shared_gpgme_key_t &key, gpgme_user_id_t uid)
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
UserID::UserID() : key(), uid(0) {}
|
||||
UserID::UserID() : key(), uid(nullptr) {}
|
||||
|
||||
UserID::UserID(const shared_gpgme_key_t &k, gpgme_user_id_t u)
|
||||
: key(k), uid(verify_uid(k, u))
|
||||
@ -656,22 +656,22 @@ std::vector<UserID::Signature> UserID::signatures() const
|
||||
|
||||
const char *UserID::id() const
|
||||
{
|
||||
return uid ? uid->uid : 0 ;
|
||||
return uid ? uid->uid : nullptr ;
|
||||
}
|
||||
|
||||
const char *UserID::name() const
|
||||
{
|
||||
return uid ? uid->name : 0 ;
|
||||
return uid ? uid->name : nullptr ;
|
||||
}
|
||||
|
||||
const char *UserID::email() const
|
||||
{
|
||||
return uid ? uid->email : 0 ;
|
||||
return uid ? uid->email : nullptr ;
|
||||
}
|
||||
|
||||
const char *UserID::comment() const
|
||||
{
|
||||
return uid ? uid->comment : 0 ;
|
||||
return uid ? uid->comment : nullptr ;
|
||||
}
|
||||
|
||||
UserID::Validity UserID::validity() const
|
||||
@ -739,7 +739,7 @@ gpgme_key_sig_t find_signature(gpgme_user_id_t uid, unsigned int idx)
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
gpgme_key_sig_t verify_signature(gpgme_user_id_t uid, gpgme_key_sig_t sig)
|
||||
@ -751,10 +751,10 @@ gpgme_key_sig_t verify_signature(gpgme_user_id_t uid, gpgme_key_sig_t sig)
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
UserID::Signature::Signature() : key(), uid(0), sig(0) {}
|
||||
UserID::Signature::Signature() : key(), uid(nullptr), sig(nullptr) {}
|
||||
|
||||
UserID::Signature::Signature(const shared_gpgme_key_t &k, gpgme_user_id_t u, unsigned int idx)
|
||||
: key(k), uid(verify_uid(k, u)), sig(find_signature(uid, idx))
|
||||
@ -775,7 +775,7 @@ UserID UserID::Signature::parent() const
|
||||
|
||||
const char *UserID::Signature::signerKeyID() const
|
||||
{
|
||||
return sig ? sig->keyid : 0 ;
|
||||
return sig ? sig->keyid : nullptr ;
|
||||
}
|
||||
|
||||
const char *UserID::Signature::algorithmAsString() const
|
||||
@ -825,22 +825,22 @@ bool UserID::Signature::isExportable() const
|
||||
|
||||
const char *UserID::Signature::signerUserID() const
|
||||
{
|
||||
return sig ? sig->uid : 0 ;
|
||||
return sig ? sig->uid : nullptr ;
|
||||
}
|
||||
|
||||
const char *UserID::Signature::signerName() const
|
||||
{
|
||||
return sig ? sig->name : 0 ;
|
||||
return sig ? sig->name : nullptr ;
|
||||
}
|
||||
|
||||
const char *UserID::Signature::signerEmail() const
|
||||
{
|
||||
return sig ? sig->email : 0 ;
|
||||
return sig ? sig->email : nullptr ;
|
||||
}
|
||||
|
||||
const char *UserID::Signature::signerComment() const
|
||||
{
|
||||
return sig ? sig->comment : 0 ;
|
||||
return sig ? sig->comment : nullptr ;
|
||||
}
|
||||
|
||||
unsigned int UserID::Signature::certClass() const
|
||||
@ -923,14 +923,14 @@ std::vector<Notation> UserID::Signature::notations() const
|
||||
const char *UserID::Signature::policyURL() const
|
||||
{
|
||||
if (!sig) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
for (gpgme_sig_notation_t nota = sig->notations ; nota ; nota = nota->next) {
|
||||
if (!nota->name) {
|
||||
return nota->value;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::string UserID::addrSpecFromString(const char *userid)
|
||||
|
@ -50,7 +50,7 @@ public:
|
||||
if (res.fpr) {
|
||||
std::free(res.fpr);
|
||||
}
|
||||
res.fpr = 0;
|
||||
res.fpr = nullptr;
|
||||
}
|
||||
|
||||
_gpgme_op_genkey_result res;
|
||||
@ -94,5 +94,5 @@ bool GpgME::KeyGenerationResult::isSubkeyGenerated() const
|
||||
|
||||
const char *GpgME::KeyGenerationResult::fingerprint() const
|
||||
{
|
||||
return d ? d->res.fpr : 0 ;
|
||||
return d ? d->res.fpr : nullptr ;
|
||||
}
|
||||
|
@ -59,10 +59,10 @@ public:
|
||||
std::vector<std::string> applicationList() const;
|
||||
|
||||
private:
|
||||
/* reimp */ const char *command() const;
|
||||
/* reimp */ Error data(const char *data, size_t datalen);
|
||||
/* reimp */ Data inquire(const char *name, const char *args, Error &err);
|
||||
/* reimp */ Error status(const char *status, const char *args);
|
||||
const char *command() const;
|
||||
Error data(const char *data, size_t datalen) override;
|
||||
Data inquire(const char *name, const char *args, Error &err) override;
|
||||
Error status(const char *status, const char *args) override;
|
||||
|
||||
private:
|
||||
void makeCommand() const;
|
||||
|
@ -53,7 +53,7 @@ public:
|
||||
if (is->fpr) {
|
||||
copy->fpr = strdup(is->fpr);
|
||||
}
|
||||
copy->next = 0;
|
||||
copy->next = nullptr;
|
||||
created.push_back(copy);
|
||||
}
|
||||
for (gpgme_invalid_key_t ik = r->invalid_signers ; ik ; ik = ik->next) {
|
||||
@ -61,7 +61,7 @@ public:
|
||||
if (ik->fpr) {
|
||||
copy->fpr = strdup(ik->fpr);
|
||||
}
|
||||
copy->next = 0;
|
||||
copy->next = nullptr;
|
||||
invalid.push_back(copy);
|
||||
}
|
||||
}
|
||||
@ -69,11 +69,11 @@ public:
|
||||
{
|
||||
for (std::vector<gpgme_new_signature_t>::iterator it = created.begin() ; it != created.end() ; ++it) {
|
||||
std::free((*it)->fpr);
|
||||
delete *it; *it = 0;
|
||||
delete *it; *it = nullptr;
|
||||
}
|
||||
for (std::vector<gpgme_invalid_key_t>::iterator it = invalid.begin() ; it != invalid.end() ; ++it) {
|
||||
std::free((*it)->fpr);
|
||||
delete *it; *it = 0;
|
||||
delete *it; *it = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@ -158,7 +158,7 @@ bool GpgME::InvalidSigningKey::isNull() const
|
||||
|
||||
const char *GpgME::InvalidSigningKey::fingerprint() const
|
||||
{
|
||||
return isNull() ? 0 : d->invalid[idx]->fpr ;
|
||||
return isNull() ? nullptr : d->invalid[idx]->fpr ;
|
||||
}
|
||||
|
||||
GpgME::Error GpgME::InvalidSigningKey::reason() const
|
||||
@ -181,7 +181,7 @@ bool GpgME::CreatedSignature::isNull() const
|
||||
|
||||
const char *GpgME::CreatedSignature::fingerprint() const
|
||||
{
|
||||
return isNull() ? 0 : d->created[idx]->fpr ;
|
||||
return isNull() ? nullptr : d->created[idx]->fpr ;
|
||||
}
|
||||
|
||||
time_t GpgME::CreatedSignature::creationTime() const
|
||||
|
@ -67,7 +67,7 @@ TrustItem::~TrustItem()
|
||||
if (d->item) {
|
||||
gpgme_trust_item_unref(d->item);
|
||||
}
|
||||
delete d; d = 0;
|
||||
delete d; d = nullptr;
|
||||
}
|
||||
|
||||
bool TrustItem::isNull() const
|
||||
@ -82,22 +82,22 @@ gpgme_trust_item_t TrustItem::impl() const
|
||||
|
||||
const char *TrustItem::keyID() const
|
||||
{
|
||||
return d->item ? d->item->keyid : 0 ;
|
||||
return d->item ? d->item->keyid : nullptr ;
|
||||
}
|
||||
|
||||
const char *TrustItem::userID() const
|
||||
{
|
||||
return d->item ? d->item->name : 0 ;
|
||||
return d->item ? d->item->name : nullptr ;
|
||||
}
|
||||
|
||||
const char *TrustItem::ownerTrustAsString() const
|
||||
{
|
||||
return d->item ? d->item->owner_trust : 0 ;
|
||||
return d->item ? d->item->owner_trust : nullptr ;
|
||||
}
|
||||
|
||||
const char *TrustItem::validityAsString() const
|
||||
{
|
||||
return d->item ? d->item->validity : 0 ;
|
||||
return d->item ? d->item->validity : nullptr ;
|
||||
}
|
||||
|
||||
int TrustItem::trustLevel() const
|
||||
|
@ -41,7 +41,7 @@ class GPGMEPP_EXPORT TrustItem
|
||||
{
|
||||
friend class ::GpgME::Context;
|
||||
public:
|
||||
explicit TrustItem(gpgme_trust_item_t item = 0);
|
||||
explicit TrustItem(gpgme_trust_item_t item = nullptr);
|
||||
TrustItem(const TrustItem &other);
|
||||
virtual ~TrustItem();
|
||||
|
||||
|
@ -68,9 +68,9 @@ public:
|
||||
scopy->pka_address = strdup(is->pka_address);
|
||||
}
|
||||
# else
|
||||
scopy->pka_address = 0;
|
||||
scopy->pka_address = nullptr;
|
||||
# endif
|
||||
scopy->next = 0;
|
||||
scopy->next = nullptr;
|
||||
sigs.push_back(scopy);
|
||||
// copy keys
|
||||
if (scopy->key) {
|
||||
@ -80,7 +80,7 @@ public:
|
||||
}
|
||||
// copy notations:
|
||||
nota.push_back(std::vector<Nota>());
|
||||
purls.push_back(0);
|
||||
purls.push_back(nullptr);
|
||||
for (gpgme_sig_notation_t in = is->notations ; in ; in = in->next) {
|
||||
if (!in->name) {
|
||||
if (in->value) {
|
||||
@ -88,7 +88,7 @@ public:
|
||||
}
|
||||
continue;
|
||||
}
|
||||
Nota n = { 0, 0, in->flags };
|
||||
Nota n = { nullptr, nullptr, in->flags };
|
||||
n.name = strdup(in->name);
|
||||
if (in->value) {
|
||||
n.value = strdup(in->value);
|
||||
@ -102,12 +102,12 @@ public:
|
||||
for (std::vector<gpgme_signature_t>::iterator it = sigs.begin() ; it != sigs.end() ; ++it) {
|
||||
std::free((*it)->fpr);
|
||||
std::free((*it)->pka_address);
|
||||
delete *it; *it = 0;
|
||||
delete *it; *it = nullptr;
|
||||
}
|
||||
for (std::vector< std::vector<Nota> >::iterator it = nota.begin() ; it != nota.end() ; ++it) {
|
||||
for (std::vector<Nota>::iterator jt = it->begin() ; jt != it->end() ; ++jt) {
|
||||
std::free(jt->name); jt->name = 0;
|
||||
std::free(jt->value); jt->value = 0;
|
||||
std::free(jt->name); jt->name = nullptr;
|
||||
std::free(jt->value); jt->value = nullptr;
|
||||
}
|
||||
}
|
||||
std::for_each(purls.begin(), purls.end(), &std::free);
|
||||
@ -159,7 +159,7 @@ make_standard_stuff(VerificationResult)
|
||||
|
||||
const char *GpgME::VerificationResult::fileName() const
|
||||
{
|
||||
return d ? d->file_name.c_str() : 0 ;
|
||||
return d ? d->file_name.c_str() : nullptr ;
|
||||
}
|
||||
|
||||
unsigned int GpgME::VerificationResult::numSignatures() const
|
||||
@ -245,7 +245,7 @@ GpgME::Signature::Summary GpgME::Signature::summary() const
|
||||
|
||||
const char *GpgME::Signature::fingerprint() const
|
||||
{
|
||||
return isNull() ? 0 : d->sigs[idx]->fpr ;
|
||||
return isNull() ? nullptr : d->sigs[idx]->fpr ;
|
||||
}
|
||||
|
||||
GpgME::Error GpgME::Signature::status() const
|
||||
@ -296,7 +296,7 @@ const char *GpgME::Signature::pkaAddress() const
|
||||
if (!isNull()) {
|
||||
return d->sigs[idx]->pka_address;
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
GpgME::Signature::Validity GpgME::Signature::validity() const
|
||||
@ -349,7 +349,7 @@ const char *GpgME::Signature::publicKeyAlgorithmAsString() const
|
||||
if (!isNull()) {
|
||||
return gpgme_pubkey_algo_name(d->sigs[idx]->pubkey_algo);
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
unsigned int GpgME::Signature::hashAlgorithm() const
|
||||
@ -365,12 +365,12 @@ const char *GpgME::Signature::hashAlgorithmAsString() const
|
||||
if (!isNull()) {
|
||||
return gpgme_hash_algo_name(d->sigs[idx]->hash_algo);
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const char *GpgME::Signature::policyURL() const
|
||||
{
|
||||
return isNull() ? 0 : d->purls[idx] ;
|
||||
return isNull() ? nullptr : d->purls[idx] ;
|
||||
}
|
||||
|
||||
GpgME::Notation GpgME::Signature::notation(unsigned int nidx) const
|
||||
@ -429,14 +429,14 @@ GpgME::Key GpgME::Signature::key(bool search, bool update) const
|
||||
class GpgME::Notation::Private
|
||||
{
|
||||
public:
|
||||
Private() : d(), sidx(0), nidx(0), nota(0) {}
|
||||
Private() : d(), sidx(0), nidx(0), nota(nullptr) {}
|
||||
Private(const std::shared_ptr<VerificationResult::Private> &priv, unsigned int sindex, unsigned int nindex)
|
||||
: d(priv), sidx(sindex), nidx(nindex), nota(0)
|
||||
: d(priv), sidx(sindex), nidx(nindex), nota(nullptr)
|
||||
{
|
||||
|
||||
}
|
||||
Private(gpgme_sig_notation_t n)
|
||||
: d(), sidx(0), nidx(0), nota(n ? new _gpgme_sig_notation(*n) : 0)
|
||||
: d(), sidx(0), nidx(0), nota(n ? new _gpgme_sig_notation(*n) : nullptr)
|
||||
{
|
||||
if (nota && nota->name) {
|
||||
nota->name = strdup(nota->name);
|
||||
@ -456,8 +456,8 @@ public:
|
||||
~Private()
|
||||
{
|
||||
if (nota) {
|
||||
std::free(nota->name); nota->name = 0;
|
||||
std::free(nota->value); nota->value = 0;
|
||||
std::free(nota->name); nota->name = nullptr;
|
||||
std::free(nota->value); nota->value = nullptr;
|
||||
delete nota;
|
||||
}
|
||||
}
|
||||
@ -495,24 +495,24 @@ bool GpgME::Notation::isNull() const
|
||||
const char *GpgME::Notation::name() const
|
||||
{
|
||||
return
|
||||
isNull() ? 0 :
|
||||
isNull() ? nullptr :
|
||||
d->d ? d->d->nota[d->sidx][d->nidx].name :
|
||||
d->nota ? d->nota->name : 0 ;
|
||||
d->nota ? d->nota->name : nullptr ;
|
||||
}
|
||||
|
||||
const char *GpgME::Notation::value() const
|
||||
{
|
||||
return
|
||||
isNull() ? 0 :
|
||||
isNull() ? nullptr :
|
||||
d->d ? d->d->nota[d->sidx][d->nidx].value :
|
||||
d->nota ? d->nota->value : 0 ;
|
||||
d->nota ? d->nota->value : nullptr ;
|
||||
}
|
||||
|
||||
GpgME::Notation::Flags GpgME::Notation::flags() const
|
||||
{
|
||||
return
|
||||
convert_from_gpgme_sig_notation_flags_t(
|
||||
isNull() ? 0 :
|
||||
isNull() ? 0:
|
||||
d->d ? d->d->nota[d->sidx][d->nidx].flags :
|
||||
d->nota ? d->nota->flags : 0);
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ using namespace GpgME;
|
||||
class VfsMountResult::Private
|
||||
{
|
||||
public:
|
||||
explicit Private(const gpgme_vfs_mount_result_t r) : mountDir(0)
|
||||
explicit Private(const gpgme_vfs_mount_result_t r) : mountDir(nullptr)
|
||||
{
|
||||
if (r && r->mount_dir) {
|
||||
mountDir = strdup(r->mount_dir);
|
||||
@ -81,7 +81,7 @@ const char *VfsMountResult::mountDir() const
|
||||
if (d) {
|
||||
return d->mountDir;
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::ostream &GpgME::operator<<(std::ostream &os, const VfsMountResult &result)
|
||||
|
@ -219,7 +219,8 @@ libqgpgme_la_SOURCES = $(qgpgme_sources) $(qgpgme_headers) $(private_qgpgme_head
|
||||
|
||||
AM_CPPFLAGS = -I$(top_srcdir)/lang/cpp/src -I$(top_builddir)/src \
|
||||
@GPGME_QT_CFLAGS@ @GPG_ERROR_CFLAGS@ @LIBASSUAN_CFLAGS@ \
|
||||
-DBUILDING_QGPGME
|
||||
-DBUILDING_QGPGME -Wsuggest-override \
|
||||
-Wzero-as-null-pointer-constant
|
||||
|
||||
libqgpgme_la_LIBADD = ../../cpp/src/libgpgmepp.la ../../../src/libgpgme.la \
|
||||
@LIBASSUAN_LIBS@ @GPGME_QT_LIBS@
|
||||
|
@ -382,8 +382,8 @@ public:
|
||||
CryptoConfigEntry *entry(const QString &componentName, const QString &groupName, const QString &entryName) const
|
||||
{
|
||||
const QGpgME::CryptoConfigComponent *comp = component(componentName);
|
||||
const QGpgME::CryptoConfigGroup *group = comp ? comp->group(groupName) : 0;
|
||||
return group ? group->entry(entryName) : 0;
|
||||
const QGpgME::CryptoConfigGroup *group = comp ? comp->group(groupName) : nullptr;
|
||||
return group ? group->entry(entryName) : nullptr;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -51,14 +51,14 @@ public:
|
||||
private:
|
||||
// these shall only be accessed through the dataprovider
|
||||
// interface, where they're public:
|
||||
bool isSupported(Operation) const
|
||||
bool isSupported(Operation) const override
|
||||
{
|
||||
return true;
|
||||
}
|
||||
ssize_t read(void *buffer, size_t bufSize);
|
||||
ssize_t write(const void *buffer, size_t bufSize);
|
||||
off_t seek(off_t offset, int whence);
|
||||
void release();
|
||||
ssize_t read(void *buffer, size_t bufSize) override;
|
||||
ssize_t write(const void *buffer, size_t bufSize) override;
|
||||
off_t seek(off_t offset, int whence) override;
|
||||
void release() override;
|
||||
|
||||
private:
|
||||
QByteArray mArray;
|
||||
@ -79,11 +79,11 @@ public:
|
||||
private:
|
||||
// these shall only be accessed through the dataprovider
|
||||
// interface, where they're public:
|
||||
bool isSupported(Operation) const;
|
||||
ssize_t read(void *buffer, size_t bufSize);
|
||||
ssize_t write(const void *buffer, size_t bufSize);
|
||||
off_t seek(off_t offset, int whence);
|
||||
void release();
|
||||
bool isSupported(Operation) const override;
|
||||
ssize_t read(void *buffer, size_t bufSize) override;
|
||||
ssize_t write(const void *buffer, size_t bufSize) override;
|
||||
off_t seek(off_t offset, int whence) override;
|
||||
void release() override;
|
||||
|
||||
private:
|
||||
const std::shared_ptr<QIODevice> mIO;
|
||||
|
@ -256,7 +256,7 @@ parse_dn(const unsigned char *string)
|
||||
break; /* ready */
|
||||
}
|
||||
|
||||
DnPair pair = { 0, 0 };
|
||||
DnPair pair = { nullptr, nullptr };
|
||||
string = parse_dn_part(&pair, string);
|
||||
if (!string) {
|
||||
goto failure;
|
||||
|
@ -47,9 +47,9 @@
|
||||
#include <assert.h>
|
||||
|
||||
QGpgME::MultiDeleteJob::MultiDeleteJob(const Protocol *protocol)
|
||||
: Job(0),
|
||||
: Job(nullptr),
|
||||
mProtocol(protocol),
|
||||
mJob(0)
|
||||
mJob(nullptr)
|
||||
{
|
||||
assert(protocol);
|
||||
}
|
||||
@ -83,7 +83,7 @@ void QGpgME::MultiDeleteJob::slotCancel()
|
||||
|
||||
void QGpgME::MultiDeleteJob::slotResult(const GpgME::Error &err)
|
||||
{
|
||||
mJob = 0;
|
||||
mJob = nullptr;
|
||||
GpgME::Error error = err;
|
||||
if (error || // error in last op
|
||||
mIt == mKeys.end() || // (shouldn't happen)
|
||||
|
@ -93,14 +93,14 @@ public:
|
||||
|
||||
QGpgME::SpecialJob *specialJob(const char *, const QMap<QString, QVariant> &) const Q_DECL_OVERRIDE
|
||||
{
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QGpgME::KeyListJob *keyListJob(bool remote, bool includeSigs, bool validate) const Q_DECL_OVERRIDE
|
||||
{
|
||||
GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol);
|
||||
if (!context) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
unsigned int mode = context->keyListMode();
|
||||
@ -125,7 +125,7 @@ public:
|
||||
{
|
||||
GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol);
|
||||
if (!context) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
unsigned int mode = context->keyListMode();
|
||||
@ -152,7 +152,7 @@ public:
|
||||
{
|
||||
GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol);
|
||||
if (!context) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
context->setArmor(armor);
|
||||
@ -164,7 +164,7 @@ public:
|
||||
{
|
||||
GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol);
|
||||
if (!context) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return new QGpgME::QGpgMEDecryptJob(context);
|
||||
}
|
||||
@ -173,7 +173,7 @@ public:
|
||||
{
|
||||
GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol);
|
||||
if (!context) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
context->setArmor(armor);
|
||||
@ -185,7 +185,7 @@ public:
|
||||
{
|
||||
GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol);
|
||||
if (!context) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
context->setTextMode(textMode);
|
||||
@ -196,7 +196,7 @@ public:
|
||||
{
|
||||
GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol);
|
||||
if (!context) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
context->setTextMode(textMode);
|
||||
@ -207,7 +207,7 @@ public:
|
||||
{
|
||||
GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol);
|
||||
if (!context) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return new QGpgME::QGpgMEKeyGenerationJob(context);
|
||||
}
|
||||
@ -216,7 +216,7 @@ public:
|
||||
{
|
||||
GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol);
|
||||
if (!context) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return new QGpgME::QGpgMEImportJob(context);
|
||||
}
|
||||
@ -225,7 +225,7 @@ public:
|
||||
{
|
||||
GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol);
|
||||
if (!context) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return new QGpgME::QGpgMEImportFromKeyserverJob(context);
|
||||
}
|
||||
@ -234,7 +234,7 @@ public:
|
||||
{
|
||||
GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol);
|
||||
if (!context) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
context->setArmor(armor);
|
||||
@ -244,7 +244,7 @@ public:
|
||||
QGpgME::ExportJob *secretKeyExportJob(bool armor, const QString &charset) const Q_DECL_OVERRIDE
|
||||
{
|
||||
if (mProtocol != GpgME::CMS) { // fixme: add support for gpg, too
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// this operation is not supported by gpgme, so we have to call gpgsm ourselves:
|
||||
@ -254,7 +254,7 @@ public:
|
||||
QGpgME::RefreshKeysJob *refreshKeysJob() const Q_DECL_OVERRIDE
|
||||
{
|
||||
if (mProtocol != GpgME::CMS) { // fixme: add support for gpg, too
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// this operation is not supported by gpgme, so we have to call gpgsm ourselves:
|
||||
@ -265,7 +265,7 @@ public:
|
||||
{
|
||||
GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol);
|
||||
if (!context) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
context->setArmor(armor);
|
||||
@ -278,7 +278,7 @@ public:
|
||||
{
|
||||
GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol);
|
||||
if (!context) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return new QGpgME::QGpgMEDeleteJob(context);
|
||||
}
|
||||
@ -287,7 +287,7 @@ public:
|
||||
{
|
||||
GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol);
|
||||
if (!context) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
context->setArmor(armor);
|
||||
@ -299,7 +299,7 @@ public:
|
||||
{
|
||||
GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol);
|
||||
if (!context) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
context->setTextMode(textMode);
|
||||
@ -309,12 +309,12 @@ public:
|
||||
QGpgME::ChangeExpiryJob *changeExpiryJob() const Q_DECL_OVERRIDE
|
||||
{
|
||||
if (mProtocol != GpgME::OpenPGP) {
|
||||
return 0; // only supported by gpg
|
||||
return nullptr; // only supported by gpg
|
||||
}
|
||||
|
||||
GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol);
|
||||
if (!context) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return new QGpgME::QGpgMEChangeExpiryJob(context);
|
||||
}
|
||||
@ -322,11 +322,11 @@ public:
|
||||
QGpgME::ChangePasswdJob *changePasswdJob() const Q_DECL_OVERRIDE
|
||||
{
|
||||
if (!GpgME::hasFeature(GpgME::PasswdFeature, 0)) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol);
|
||||
if (!context) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return new QGpgME::QGpgMEChangePasswdJob(context);
|
||||
}
|
||||
@ -334,12 +334,12 @@ public:
|
||||
QGpgME::SignKeyJob *signKeyJob() const Q_DECL_OVERRIDE
|
||||
{
|
||||
if (mProtocol != GpgME::OpenPGP) {
|
||||
return 0; // only supported by gpg
|
||||
return nullptr; // only supported by gpg
|
||||
}
|
||||
|
||||
GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol);
|
||||
if (!context) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return new QGpgME::QGpgMESignKeyJob(context);
|
||||
}
|
||||
@ -347,12 +347,12 @@ public:
|
||||
QGpgME::ChangeOwnerTrustJob *changeOwnerTrustJob() const Q_DECL_OVERRIDE
|
||||
{
|
||||
if (mProtocol != GpgME::OpenPGP) {
|
||||
return 0; // only supported by gpg
|
||||
return nullptr; // only supported by gpg
|
||||
}
|
||||
|
||||
GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol);
|
||||
if (!context) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return new QGpgME::QGpgMEChangeOwnerTrustJob(context);
|
||||
}
|
||||
@ -360,12 +360,12 @@ public:
|
||||
QGpgME::AddUserIDJob *addUserIDJob() const Q_DECL_OVERRIDE
|
||||
{
|
||||
if (mProtocol != GpgME::OpenPGP) {
|
||||
return 0; // only supported by gpg
|
||||
return nullptr; // only supported by gpg
|
||||
}
|
||||
|
||||
GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol);
|
||||
if (!context) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return new QGpgME::QGpgMEAddUserIDJob(context);
|
||||
}
|
||||
@ -373,11 +373,11 @@ public:
|
||||
QGpgME::KeyListJob *locateKeysJob() const Q_DECL_OVERRIDE
|
||||
{
|
||||
if (mProtocol != GpgME::OpenPGP) {
|
||||
return Q_NULLPTR;
|
||||
return nullptr;
|
||||
}
|
||||
GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol);
|
||||
if (!context) {
|
||||
return Q_NULLPTR;
|
||||
return nullptr;
|
||||
}
|
||||
context->setKeyListMode(GpgME::Extern | GpgME::Local | GpgME::Signatures | GpgME::Validate);
|
||||
return new QGpgME::QGpgMEKeyListJob(context);
|
||||
@ -387,7 +387,7 @@ public:
|
||||
{
|
||||
GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol);
|
||||
if (!context) {
|
||||
return Q_NULLPTR;
|
||||
return nullptr;
|
||||
}
|
||||
return new QGpgME::QGpgMEKeyForMailboxJob(context);
|
||||
}
|
||||
@ -395,11 +395,11 @@ public:
|
||||
QGpgME::WKSPublishJob *wksPublishJob() const Q_DECL_OVERRIDE
|
||||
{
|
||||
if (mProtocol != GpgME::OpenPGP) {
|
||||
return Q_NULLPTR;
|
||||
return nullptr;
|
||||
}
|
||||
auto context = GpgME::Context::createForEngine(GpgME::SpawnEngine);
|
||||
if (!context) {
|
||||
return Q_NULLPTR;
|
||||
return nullptr;
|
||||
}
|
||||
return new QGpgME::QGpgMEWKSPublishJob(context.release());
|
||||
}
|
||||
@ -407,11 +407,11 @@ public:
|
||||
QGpgME::TofuPolicyJob *tofuPolicyJob() const Q_DECL_OVERRIDE
|
||||
{
|
||||
if (mProtocol != GpgME::OpenPGP) {
|
||||
return Q_NULLPTR;
|
||||
return nullptr;
|
||||
}
|
||||
GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol);
|
||||
if (!context) {
|
||||
return Q_NULLPTR;
|
||||
return nullptr;
|
||||
}
|
||||
return new QGpgME::QGpgMETofuPolicyJob(context);
|
||||
}
|
||||
@ -419,11 +419,11 @@ public:
|
||||
QGpgME::QuickJob *quickJob() const Q_DECL_OVERRIDE
|
||||
{
|
||||
if (mProtocol != GpgME::OpenPGP) {
|
||||
return Q_NULLPTR;
|
||||
return nullptr;
|
||||
}
|
||||
GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol);
|
||||
if (!context) {
|
||||
return Q_NULLPTR;
|
||||
return nullptr;
|
||||
}
|
||||
return new QGpgME::QGpgMEQuickJob(context);
|
||||
}
|
||||
|
@ -52,18 +52,18 @@ const char QGpgME::QGpgMEBackend::SMIME[] = "SMIME";
|
||||
|
||||
|
||||
QGpgME::QGpgMEBackend::QGpgMEBackend()
|
||||
: mCryptoConfig(0),
|
||||
mOpenPGPProtocol(0),
|
||||
mSMIMEProtocol(0)
|
||||
: mCryptoConfig(nullptr),
|
||||
mOpenPGPProtocol(nullptr),
|
||||
mSMIMEProtocol(nullptr)
|
||||
{
|
||||
GpgME::initializeLibrary();
|
||||
}
|
||||
|
||||
QGpgME::QGpgMEBackend::~QGpgMEBackend()
|
||||
{
|
||||
delete mCryptoConfig; mCryptoConfig = 0;
|
||||
delete mOpenPGPProtocol; mOpenPGPProtocol = 0;
|
||||
delete mSMIMEProtocol; mSMIMEProtocol = 0;
|
||||
delete mCryptoConfig; mCryptoConfig = nullptr;
|
||||
delete mOpenPGPProtocol; mOpenPGPProtocol = nullptr;
|
||||
delete mSMIMEProtocol; mSMIMEProtocol = nullptr;
|
||||
}
|
||||
|
||||
QString QGpgME::QGpgMEBackend::name() const
|
||||
@ -163,7 +163,7 @@ QGpgME::Protocol *QGpgME::QGpgMEBackend::protocol(const char *name) const
|
||||
if (qstricmp(name, SMIME) == 0) {
|
||||
return smime();
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool QGpgME::QGpgMEBackend::supportsProtocol(const char *name) const
|
||||
@ -176,7 +176,7 @@ const char *QGpgME::QGpgMEBackend::enumerateProtocols(int i) const
|
||||
switch (i) {
|
||||
case 0: return OpenPGP;
|
||||
case 1: return SMIME;
|
||||
default: return 0;
|
||||
default: return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -100,7 +100,7 @@ static QGpgMEDecryptJob::result_type decrypt_qba(Context *ctx, const QByteArray
|
||||
if (!buffer->open(QIODevice::ReadOnly)) {
|
||||
assert(!"This should never happen: QBuffer::open() failed");
|
||||
}
|
||||
return decrypt(ctx, 0, buffer, std::shared_ptr<QIODevice>());
|
||||
return decrypt(ctx, nullptr, buffer, std::shared_ptr<QIODevice>());
|
||||
}
|
||||
|
||||
Error QGpgMEDecryptJob::start(const QByteArray &cipherText)
|
||||
|
@ -108,7 +108,7 @@ static QGpgMEDecryptVerifyJob::result_type decrypt_verify_qba(Context *ctx, cons
|
||||
if (!buffer->open(QIODevice::ReadOnly)) {
|
||||
assert(!"This should never happen: QBuffer::open() failed");
|
||||
}
|
||||
return decrypt_verify(ctx, 0, buffer, std::shared_ptr<QIODevice>());
|
||||
return decrypt_verify(ctx, nullptr, buffer, std::shared_ptr<QIODevice>());
|
||||
}
|
||||
|
||||
Error QGpgMEDecryptVerifyJob::start(const QByteArray &cipherText)
|
||||
|
@ -118,7 +118,7 @@ static QGpgMEEncryptJob::result_type encrypt_qba(Context *ctx, const std::vector
|
||||
if (!buffer->open(QIODevice::ReadOnly)) {
|
||||
assert(!"This should never happen: QBuffer::open() failed");
|
||||
}
|
||||
return encrypt(ctx, 0, recipients, buffer, std::shared_ptr<QIODevice>(), eflags, outputIsBsse64Encoded);
|
||||
return encrypt(ctx, nullptr, recipients, buffer, std::shared_ptr<QIODevice>(), eflags, outputIsBsse64Encoded);
|
||||
}
|
||||
|
||||
Error QGpgMEEncryptJob::start(const std::vector<Key> &recipients, const QByteArray &plainText, bool alwaysTrust)
|
||||
|
@ -69,7 +69,7 @@ static KeyListResult do_list_keys(Context *ctx, const QStringList &pats, std::ve
|
||||
const _detail::PatternConverter pc(pats);
|
||||
|
||||
if (const Error err = ctx->startKeyListing(pc.patterns(), secretOnly)) {
|
||||
return KeyListResult(0, err);
|
||||
return KeyListResult(nullptr, err);
|
||||
}
|
||||
|
||||
Error err;
|
||||
|
@ -64,9 +64,9 @@ QGpgMEListAllKeysJob::~QGpgMEListAllKeysJob() {}
|
||||
static KeyListResult do_list_keys(Context *ctx, std::vector<Key> &keys, bool secretOnly)
|
||||
{
|
||||
|
||||
const char **pat = 0;
|
||||
const char **pat = nullptr;
|
||||
if (const Error err = ctx->startKeyListing(pat, secretOnly)) {
|
||||
return KeyListResult(0, err);
|
||||
return KeyListResult(nullptr, err);
|
||||
}
|
||||
|
||||
Error err;
|
||||
|
@ -53,8 +53,8 @@
|
||||
#include <assert.h>
|
||||
|
||||
QGpgME::QGpgMERefreshKeysJob::QGpgMERefreshKeysJob()
|
||||
: RefreshKeysJob(0),
|
||||
mProcess(0),
|
||||
: RefreshKeysJob(nullptr),
|
||||
mProcess(nullptr),
|
||||
mError(0)
|
||||
{
|
||||
|
||||
@ -142,7 +142,7 @@ void QGpgME::QGpgMERefreshKeysJob::slotCancel()
|
||||
if (mProcess) {
|
||||
mProcess->kill();
|
||||
}
|
||||
mProcess = 0;
|
||||
mProcess = nullptr;
|
||||
mError = GpgME::Error::fromCode(GPG_ERR_CANCELED, GPG_ERR_SOURCE_GPGSM);
|
||||
}
|
||||
|
||||
|
@ -52,8 +52,8 @@
|
||||
#include <assert.h>
|
||||
|
||||
QGpgME::QGpgMESecretKeyExportJob::QGpgMESecretKeyExportJob(bool armour, const QString &charset)
|
||||
: ExportJob(0),
|
||||
mProcess(0),
|
||||
: ExportJob(nullptr),
|
||||
mProcess(nullptr),
|
||||
mError(0),
|
||||
mArmour(armour),
|
||||
mCharset(charset)
|
||||
@ -114,7 +114,7 @@ void QGpgME::QGpgMESecretKeyExportJob::slotCancel()
|
||||
if (mProcess) {
|
||||
mProcess->kill();
|
||||
}
|
||||
mProcess = 0;
|
||||
mProcess = nullptr;
|
||||
mError = GpgME::Error::fromCode(GPG_ERR_CANCELED, GPG_ERR_SOURCE_GPGSM);
|
||||
}
|
||||
|
||||
|
@ -123,7 +123,7 @@ static QGpgMESignEncryptJob::result_type sign_encrypt_qba(Context *ctx, const st
|
||||
if (!buffer->open(QIODevice::ReadOnly)) {
|
||||
assert(!"This should never happen: QBuffer::open() failed");
|
||||
}
|
||||
return sign_encrypt(ctx, 0, signers, recipients, buffer, std::shared_ptr<QIODevice>(), eflags, outputIsBsse64Encoded);
|
||||
return sign_encrypt(ctx, nullptr, signers, recipients, buffer, std::shared_ptr<QIODevice>(), eflags, outputIsBsse64Encoded);
|
||||
}
|
||||
|
||||
Error QGpgMESignEncryptJob::start(const std::vector<Key> &signers, const std::vector<Key> &recipients, const QByteArray &plainText, bool alwaysTrust)
|
||||
|
@ -129,7 +129,7 @@ static QGpgMESignJob::result_type sign_qba(Context *ctx,
|
||||
if (!buffer->open(QIODevice::ReadOnly)) {
|
||||
assert(!"This should never happen: QBuffer::open() failed");
|
||||
}
|
||||
return sign(ctx, 0, signers, buffer, std::shared_ptr<QIODevice>(), mode, outputIsBsse64Encoded);
|
||||
return sign(ctx, nullptr, signers, buffer, std::shared_ptr<QIODevice>(), mode, outputIsBsse64Encoded);
|
||||
}
|
||||
|
||||
Error QGpgMESignJob::start(const std::vector<Key> &signers, const QByteArray &plainText, SignatureMode mode)
|
||||
|
@ -99,7 +99,7 @@ static QGpgMEVerifyOpaqueJob::result_type verify_opaque_qba(Context *ctx, const
|
||||
if (!buffer->open(QIODevice::ReadOnly)) {
|
||||
assert(!"This should never happen: QBuffer::open() failed");
|
||||
}
|
||||
return verify_opaque(ctx, 0, buffer, std::shared_ptr<QIODevice>());
|
||||
return verify_opaque(ctx, nullptr, buffer, std::shared_ptr<QIODevice>());
|
||||
}
|
||||
|
||||
Error QGpgMEVerifyOpaqueJob::start(const QByteArray &signedData)
|
||||
|
@ -164,13 +164,13 @@ static QList<QByteArray> single(const QByteArray &ba)
|
||||
}
|
||||
|
||||
_detail::PatternConverter::PatternConverter(const QByteArray &ba)
|
||||
: m_list(single(ba)), m_patterns(0) {}
|
||||
: m_list(single(ba)), m_patterns(nullptr) {}
|
||||
_detail::PatternConverter::PatternConverter(const QString &s)
|
||||
: m_list(single(s.toUtf8())), m_patterns(0) {}
|
||||
: m_list(single(s.toUtf8())), m_patterns(nullptr) {}
|
||||
_detail::PatternConverter::PatternConverter(const QList<QByteArray> &lba)
|
||||
: m_list(lba), m_patterns(0) {}
|
||||
: m_list(lba), m_patterns(nullptr) {}
|
||||
_detail::PatternConverter::PatternConverter(const QStringList &sl)
|
||||
: m_list(from_sl(sl)), m_patterns(0) {}
|
||||
: m_list(from_sl(sl)), m_patterns(nullptr) {}
|
||||
|
||||
const char **_detail::PatternConverter::patterns() const
|
||||
{
|
||||
@ -178,7 +178,7 @@ const char **_detail::PatternConverter::patterns() const
|
||||
m_patterns = new const char *[ m_list.size() + 1 ];
|
||||
const char **end = std::transform(m_list.begin(), m_list.end(), m_patterns,
|
||||
std::mem_fn(&QByteArray::constData));
|
||||
*end = 0;
|
||||
*end = nullptr;
|
||||
}
|
||||
return m_patterns;
|
||||
}
|
||||
|
@ -148,7 +148,7 @@ protected:
|
||||
"Last result type not a GpgME::Error");
|
||||
|
||||
explicit ThreadedJobMixin(GpgME::Context *ctx)
|
||||
: T_base(0), m_ctx(ctx), m_thread(), m_auditLog(), m_auditLogError()
|
||||
: T_base(nullptr), m_ctx(ctx), m_thread(), m_auditLog(), m_auditLogError()
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -320,6 +320,8 @@ _gpgme_release_result (gpgme_ctx_t ctx)
|
||||
}
|
||||
|
||||
|
||||
/* Note that setting the protocol will intentionally not fail if the
|
||||
* engine is not available. */
|
||||
gpgme_error_t
|
||||
gpgme_set_protocol (gpgme_ctx_t ctx, gpgme_protocol_t protocol)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user