From 46d519ae31630dc7d3adfe56246226bdceba8d4d Mon Sep 17 00:00:00 2001 From: Justin Karneges Date: Wed, 13 Jun 2007 00:34:06 +0000 Subject: [PATCH] remove unnecessary secure memory usage in pgp api svn path=/trunk/kdesupport/qca/; revision=674773 --- include/QtCrypto/qca_cert.h | 4 ++-- include/QtCrypto/qcaprovider.h | 4 ++-- plugins/qca-gnupg/qca-gnupg.cpp | 6 +++--- src/qca_cert.cpp | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/QtCrypto/qca_cert.h b/include/QtCrypto/qca_cert.h index 842a8d05..5abd7d29 100644 --- a/include/QtCrypto/qca_cert.h +++ b/include/QtCrypto/qca_cert.h @@ -2280,7 +2280,7 @@ public: \sa fromArray for a static import method. \sa toString for an "ascii armoured" export method. */ - SecureArray toArray() const; + QByteArray toArray() const; /** Export the key to a string @@ -2308,7 +2308,7 @@ public: \param provider the provider to use, if a particular provider is required */ - static PGPKey fromArray(const SecureArray &a, ConvertResult *result = 0, const QString &provider = QString()); + static PGPKey fromArray(const QByteArray &a, ConvertResult *result = 0, const QString &provider = QString()); /** Import the key from a string diff --git a/include/QtCrypto/qcaprovider.h b/include/QtCrypto/qcaprovider.h index f915d593..22a46a82 100644 --- a/include/QtCrypto/qcaprovider.h +++ b/include/QtCrypto/qcaprovider.h @@ -366,9 +366,9 @@ public: virtual const PGPKeyContextProps *props() const = 0; - virtual SecureArray toBinary() const = 0; + virtual QByteArray toBinary() const = 0; virtual QString toAscii() const = 0; - virtual ConvertResult fromBinary(const SecureArray &a) = 0; + virtual ConvertResult fromBinary(const QByteArray &a) = 0; virtual ConvertResult fromAscii(const QString &s) = 0; }; diff --git a/plugins/qca-gnupg/qca-gnupg.cpp b/plugins/qca-gnupg/qca-gnupg.cpp index 885c1baa..143ba076 100644 --- a/plugins/qca-gnupg/qca-gnupg.cpp +++ b/plugins/qca-gnupg/qca-gnupg.cpp @@ -126,10 +126,10 @@ public: return &_props; } - virtual SecureArray toBinary() const + virtual QByteArray toBinary() const { // TODO - return SecureArray(); + return QByteArray(); } virtual QString toAscii() const @@ -149,7 +149,7 @@ public: return str; } - virtual ConvertResult fromBinary(const SecureArray &a) + virtual ConvertResult fromBinary(const QByteArray &a) { // TODO Q_UNUSED(a); diff --git a/src/qca_cert.cpp b/src/qca_cert.cpp index b9426fd5..372b919e 100644 --- a/src/qca_cert.cpp +++ b/src/qca_cert.cpp @@ -2733,7 +2733,7 @@ bool PGPKey::isTrusted() const return static_cast(context())->props()->isTrusted; } -SecureArray PGPKey::toArray() const +QByteArray PGPKey::toArray() const { return static_cast(context())->toBinary(); } @@ -2748,7 +2748,7 @@ bool PGPKey::toFile(const QString &fileName) const return stringToFile(fileName, toString()); } -PGPKey PGPKey::fromArray(const SecureArray &a, ConvertResult *result, const QString &provider) +PGPKey PGPKey::fromArray(const QByteArray &a, ConvertResult *result, const QString &provider) { PGPKey k; PGPKeyContext *kc = static_cast(getContext("pgpkey", provider));