summaryrefslogtreecommitdiff
path: root/xmlsecurity/source/gpg/CertificateImpl.cxx
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2017-06-23 09:52:23 +0200
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2017-06-23 12:36:10 +0200
commit7add9c24af8ea965f0411d4b852491af337822df (patch)
tree2b7b5726300f9614e59f059aa7f5650281e8990e /xmlsecurity/source/gpg/CertificateImpl.cxx
parent40c9ebbb6fbba3fbb70ae652acd53928d8f26803 (diff)
gpg4libre: Handle error when retrieving public key
Change-Id: I9543e47fb3302a5ca146a606305b24733f015a5d
Diffstat (limited to 'xmlsecurity/source/gpg/CertificateImpl.cxx')
-rw-r--r--xmlsecurity/source/gpg/CertificateImpl.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/xmlsecurity/source/gpg/CertificateImpl.cxx b/xmlsecurity/source/gpg/CertificateImpl.cxx
index e40f59323a04..e87316e15005 100644
--- a/xmlsecurity/source/gpg/CertificateImpl.cxx
+++ b/xmlsecurity/source/gpg/CertificateImpl.cxx
@@ -211,7 +211,10 @@ void CertificateImpl::setCertificate(GpgME::Context* ctx, const GpgME::Key& key)
// extract key data, store into m_aBits
GpgME::Data data_out;
- ctx->exportPublicKeys(key.keyID(), data_out);
+ GpgME::Error err = ctx->exportPublicKeys(key.keyID(), data_out);
+
+ if (err)
+ throw RuntimeException("The GpgME library failed to retrieve the public key");
assert(data_out.seek(0,SEEK_SET) == 0);
int len=0, curr=0; char buf;