libksba attribute to string
Closed, ResolvedPublic

Assigned To
None
Authored By
• gniibe
Oct 5 2026, 4:04 AM

Description

Summary of the two issues:

  1. append_ucs2_value
  2. append_ucs4_value

Both are reached via the public accessors ksba_cert_get_issuer/ ksba_cert_get_subject.

Reported-by: Antti Levomäki

Related Objects

Event Timeline

Similar report came from truong nguyen tri.

• gniibe mentioned this in Unknown Object (Maniphest Task).Oct 5 2026, 4:07 AM
• gniibe renamed this task from libksba report by Antti Levomäki to libksba attribute to string.Oct 5 2026, 6:20 AM
• gniibe updated the task description. (Show Details)

Before fixing the issue, we need to fix a mistake of escaping a space at the end.
That's in: rKe748fd1e774e: Fix attribute to string for escaping a space at the end.
See:RFC 4514

This comment was removed by • gniibe.
• werner lowered the priority of this task from Unbreak Now! to Normal.Oct 5 2026, 2:08 PM
• werner changed the visibility from "g10code (Project)" to "Public (No Login Required)".
• werner changed the edit policy from "Custom Policy" to "Contributor (Project)".

Original report in July was:
Message-ID: <cO0EsDTcvFJZAsZZTjBU3qUf_2T67lEPXtoVoutVCK71o8qS8eWklEBn4jjIUVAOdq8htkPr7MbgiuU2zUItI3HXjDnHN5W3xTzz7FLn_j4=@protonmail.com>

It has a problem for encryption.

It's better to handle the case when the length is not multiple of 4 for UCS4 and not multiple of 2 for UCS2.
I include this to the change.

There are multiple issues:

  • wrongly emitting \ at the start in the handling of a space at the end of string
  • wrongly emitting NUL-byte for UCS4 and UCS2 handling
  • possible OOB for UCS4 and UCS2 handling
• gniibe mentioned this in Unknown Object (Maniphest Task).Oct 12 2026, 3:48 AM
• gniibe changed the task status from Open to Testing.Mon, Nov 2, 5:59 AM
• werner removed • gniibe as the assignee of this task.
• werner shifted this object from the Restricted Space space to the S1 Public space.