Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • P poppler
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 665
    • Issues 665
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 46
    • Merge requests 46
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • poppler
  • poppler
  • Merge requests
  • !1313

When signing, only authenticate to required tokens

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Tobias Deiminger requested to merge haxtibal/poppler:bugfix/multitokenauth into master Jan 03, 2023
  • Overview 5
  • Commits 3
  • Pipelines 5
  • Changes 6

This is a proposal to fix #1330. The strategy is to change SignatureHandler::getAvailableSigningCertificates to optionally narrow certificate search with nickname as hint, and to authenticate only where needed.

PK11_FindCertsFromNickname handles all cases fine:

  • narrowed search using a nickname or PKCS#11 URI as used by pdfsig
  • search all available certs as used by QT frontends, by using a hardcoded "pkcs11:type=cert" URI (supported since NSS 3.39, we require NSS >= 3.49 anyways)
  • implicitly calls PK11_Authenticate when needed

We can now call pdfsig -add-signature -nick 'sc0:mycert1' -nss-pwd 'externalpw' -nssdir 'sql:/tmp/nssdb/' doc.pdf doc_signed.pdf, and it works.

Benefit for Qt frontends: Prior to this MR, users had to answer two password dialogs, one for NSS Cert DB and one for smart card, even if NSS Cert DB was empty. Now the empty NSS Cert DB is skipped and users have to answer only a single dialog.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: bugfix/multitokenauth