summaryrefslogtreecommitdiff
path: root/xmlsecurity/source/gpg
diff options
context:
space:
mode:
authorSarper Akdemir <sarper.akdemir@allotropia.de>2024-07-31 11:03:13 +0200
committerSarper Akdemir <sarper.akdemir@allotropia.de>2024-08-05 13:15:31 +0200
commit9786f8ea59ccc9225871888d23b5af9ed16a5e5f (patch)
tree5553cceb80caa1efa8e1b1713b2cd3728f7e3927 /xmlsecurity/source/gpg
parent50455fa6a223f34b59aca3c837ce79aebf9bb5aa (diff)
tdf#159040 tdf#162206: better the user key selection and test sign with default
fix GPG CertificateImpl::getSHA1Thumbprint not returning a sequence of bytes as the thumbprint. (that is what the documented API states, and what all of the code assumed.) now /org.openoffice.UserProfile/Data/signingkey and encryptionkey stores the key's SHA1Thumbprint for better identification of keys. Previously on the key name was being used. fix annoying NSS Certificate Database password prompt appearing on Tools->Options if the certificate database is password protected. improve Tools->Options->UserData user key selection and display of information. add a ui test for "Sign with default certificate" interaction in the save dialog. Change-Id: I1036856003f58f494838e0f81ca0fe18e821f528 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171395 Tested-by: Jenkins Reviewed-by: Sarper Akdemir <sarper.akdemir@allotropia.de>
Diffstat (limited to 'xmlsecurity/source/gpg')
-rw-r--r--xmlsecurity/source/gpg/CertificateImpl.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/xmlsecurity/source/gpg/CertificateImpl.cxx b/xmlsecurity/source/gpg/CertificateImpl.cxx
index 7e3d942313d6..b13faa8696de 100644
--- a/xmlsecurity/source/gpg/CertificateImpl.cxx
+++ b/xmlsecurity/source/gpg/CertificateImpl.cxx
@@ -15,6 +15,7 @@
#include <com/sun/star/security/KeyUsage.hpp>
#include <officecfg/Office/Common.hxx>
#include <svl/sigstruct.hxx>
+#include <svl/cryptosign.hxx>
#include <context.h>
#include <data.h>
@@ -184,8 +185,9 @@ Sequence< sal_Int8 > SAL_CALL CertificateImpl::getSHA1Thumbprint()
{
// This is mapped to the fingerprint for gpg
const char* keyId = m_pKey.primaryFingerprint();
- return comphelper::arrayToSequence<sal_Int8>(
- keyId, strlen(keyId)+1);
+
+ // get hex fingerprint as byte array
+ return comphelper::containerToSequence<sal_Int8>(svl::crypto::DecodeHexString(keyId));
}
Sequence<sal_Int8> CertificateImpl::getSHA256Thumbprint()