Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid password or PKCS12 data #354

Open
Torxed opened this issue Jan 4, 2024 · 0 comments
Open

Invalid password or PKCS12 data #354

Torxed opened this issue Jan 4, 2024 · 0 comments

Comments

@Torxed
Copy link

Torxed commented Jan 4, 2024

  • YubiKey Manager version: 5.2.1 / 1.2.5 (ui)
  • How was it installed?: pacman
  • Operating system and version: Arch Linux
  • YubiKey model and version: YubiKey NEO
  • Bug description summary: Invalid password or PKCS12 data

Steps to reproduce

Generate a CSR, sign it, run openssl pkcs12 -export -out test.p12 -inkey test.key.pem -in ssl/newcerts/1000.pem -certfile ssl/cacert.pem
And then try to import the .p12 in ykman-gui.

Expected result

It appears to actually complete the import, as I have it loaded:
screenshot

However the stacktrace below also happens.

Actual results

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/ykman/util.py", line 51, in _parse_pkcs12
    key, cert, cas = pkcs12.load_key_and_certificates(
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/cryptography/hazmat/primitives/serialization/pkcs12.py", line 157, in load_key_and_certificates
    return ossl.load_key_and_certificates_from_pkcs12(data, password)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/cryptography/hazmat/backends/openssl/backend.py", line 1607, in load_key_and_certificates_from_pkcs12
    pkcs12 = self.load_pkcs12(data, password)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/cryptography/hazmat/backends/openssl/backend.py", line 1636, in load_pkcs12
    raise ValueError("Invalid password or PKCS12 data")
ValueError: Invalid password or PKCS12 data

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "qrc:///py/yubikey.py", line 78, in wrapped
    return f(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^
  File "qrc:///py/yubikey.py", line 749, in piv_can_parse
    parse_certificates(data, password=None)
  File "/usr/lib/python3.11/site-packages/ykman/util.py", line 129, in parse_certificates
    return _parse_pkcs12(data, password)[1]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/ykman/util.py", line 58, in _parse_pkcs12
    raise InvalidPasswordError(e)
ykman.util.InvalidPasswordError: Invalid password or PKCS12 data
Cannot convert: QVariant(std::nullptr_t, (nullptr))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant