[Libreoffice-commits] core.git: xmlsecurity/source

Thorsten Behrens Thorsten.Behrens at CIB.de
Sat Jun 24 23:32:34 UTC 2017


 xmlsecurity/source/gpg/CertificateImpl.cxx      |    1 +
 xmlsecurity/source/gpg/xmlsignature_gpgimpl.cxx |    2 ++
 2 files changed, 3 insertions(+)

New commits:
commit 72e7cfd776dee2edfa513f8f1a8f45136de1d8ba
Author: Thorsten Behrens <Thorsten.Behrens at CIB.de>
Date:   Sat Jun 24 00:50:31 2017 +0200

    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 <Thorsten.Behrens at CIB.de>
    Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

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);


More information about the Libreoffice-commits mailing list