From 9786f8ea59ccc9225871888d23b5af9ed16a5e5f Mon Sep 17 00:00:00 2001 From: Sarper Akdemir Date: Wed, 31 Jul 2024 11:03:13 +0200 Subject: 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 --- xmlsecurity/source/gpg/CertificateImpl.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'xmlsecurity/source/gpg') 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 #include #include +#include #include #include @@ -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( - keyId, strlen(keyId)+1); + + // get hex fingerprint as byte array + return comphelper::containerToSequence(svl::crypto::DecodeHexString(keyId)); } Sequence CertificateImpl::getSHA256Thumbprint() -- cgit