Bug 131733

Summary: UI Select Certificate dialog shows extra info in “Issued to” column for RSA certs
Product: LibreOffice Reporter: NISZ LibreOffice Team <libreoffice>
Component: UIAssignee: Gabor Kelemen (allotropia) <kelemeng>
Status: RESOLVED FIXED    
Severity: normal CC: heiko.tietze, mentoring, nemeth, samuel.mehrbrodt, xiscofauli
Priority: medium Keywords: bibisected, bisected, difficultyBeginner, easyHack, skillCpp
Version: 5.4.0.3 release   
Hardware: All   
OS: All   
Whiteboard: target:7.0.0 target:6.4.4
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 105605    
Attachments: Screenshot of the dialog in 5.3 and current master
Example document signed with most of my cert zoo before and after the patch

Description NISZ LibreOffice Team 2020-03-31 09:07:36 UTC
Created attachment 159177 [details]
Screenshot of the dialog in 5.3 and current master

The Select Certificate dialog shows a lot of information in the “Issued to” column, basically the whole Subject of the certificate, which is too long to be readable in the narrow column.
In 5.3 only the CN was displayed here, which seems to be a more reasonable choice.

Steps to reproduce:
    1. Open any document file
    2. File -> Digital Signatures –> Digital Signatures
    3. Press the Sign Document button


Actual results:
Select Certificate dialog appears with a lot of information in the Issued to column.

Expected results:
Only CN info appears in the Issued to column.

LibreOffice details:
Version: 7.0.0.0.alpha0+ (x64)
Build ID: bc898e2c2784e36ad4d4cdf6d962e39069d2c82d
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: default; VCL: win; 
Locale: hu-HU (hu_HU); UI-Language: en-US
Calc: CL

Bibisected using bibisect-win32-5.4 to:
URL: https://cgit.freedesktop.org/libreoffice/core/commit/?id=88ac77c0bc21accfd6f5c404217c3c2aaef2d674 
author	Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>	2017-02-02 17:33:30 +0100
committer	Thorsten Behrens <Thorsten.Behrens@CIB.de>	2017-03-04 10:26:43 +0000
gpg4libre: List and view GPG keys

Adding CC to: Samuel Mehrbrodt
Comment 1 Xisco Faulí 2020-03-31 11:46:15 UTC
I don't think this is a regression, just a matter of personal taste.
Adding UX team to decide which info would be better to display
Comment 2 Heiko Tietze 2020-03-31 13:02:33 UTC
I agree with short information (CN and O) as the long version is available after selection. Any reason why this was changed, Samuel?
Comment 3 Samuel Mehrbrodt (allotropia) 2020-03-31 13:06:59 UTC
The change was for displaying OpenPGP keys, the side effect was unintended.

Whoever fixes this, please make sure that both OpenPGP keys and X.509 certs are displayed correctly.

This can be an easy hack. Check GetContentPart in xmlsecurity/source/dialogs/resourcemanager.cxx .
Comment 4 Gabor Kelemen (allotropia) 2020-04-22 08:36:25 UTC
Created attachment 159806 [details]
Example document signed with most of my cert zoo before and after the patch

Proposed patch: https://gerrit.libreoffice.org/c/core/+/92675
Comment 5 Commit Notification 2020-04-29 05:06:49 UTC
Gabor Kelemen committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/bedba76adb9b1421a7d939cfef44b8194e987888

tdf#131733 Show only CN part of X.509 subject info

It will be available in 7.0.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Commit Notification 2020-04-29 09:18:33 UTC
Gabor Kelemen committed a patch related to this issue.
It has been pushed to "libreoffice-6-4":

https://git.libreoffice.org/core/commit/c6b6ac53e71661e1fd8ae2ee99df3eb3ea4bd517

tdf#131733 Show only CN part of X.509 subject info

It will be available in 6.4.4.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.