From 72e7cfd776dee2edfa513f8f1a8f45136de1d8ba Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Sat, 24 Jun 2017 00:50:31 +0200 Subject: gpg4libre: save some space, extract binary key/sign data Since callers will base64-encode this anyway, again Change-Id: I0962d102fa0f2b95eaa2e608539cc291125f0321 Reviewed-on: https://gerrit.libreoffice.org/39193 Reviewed-by: Thorsten Behrens Tested-by: Thorsten Behrens --- xmlsecurity/source/gpg/CertificateImpl.cxx | 1 + xmlsecurity/source/gpg/xmlsignature_gpgimpl.cxx | 2 ++ 2 files changed, 3 insertions(+) (limited to 'xmlsecurity') diff --git a/xmlsecurity/source/gpg/CertificateImpl.cxx b/xmlsecurity/source/gpg/CertificateImpl.cxx index e87316e15005..20fa35c52d5d 100644 --- a/xmlsecurity/source/gpg/CertificateImpl.cxx +++ b/xmlsecurity/source/gpg/CertificateImpl.cxx @@ -211,6 +211,7 @@ void CertificateImpl::setCertificate(GpgME::Context* ctx, const GpgME::Key& key) // extract key data, store into m_aBits GpgME::Data data_out; + ctx->setArmor(false); // caller will base64-encode anyway GpgME::Error err = ctx->exportPublicKeys(key.keyID(), data_out); if (err) diff --git a/xmlsecurity/source/gpg/xmlsignature_gpgimpl.cxx b/xmlsecurity/source/gpg/xmlsignature_gpgimpl.cxx index 6d3aece7dc32..4b48e11d577b 100644 --- a/xmlsecurity/source/gpg/xmlsignature_gpgimpl.cxx +++ b/xmlsecurity/source/gpg/xmlsignature_gpgimpl.cxx @@ -200,6 +200,8 @@ SAL_CALL XMLSignature_GpgImpl::generate( SAL_INFO("xmlsecurity.xmlsec.gpg", "Generating signature for: " << xmlSecBufferGetData(pDsigCtx->transformCtx.result)); + // we base64-encode anyway + rCtx.setArmor(false); GpgME::SigningResult sign_res=rCtx.sign(data_in, data_out, GpgME::Detached); assert(data_out.seek(0,SEEK_SET) == 0); -- cgit