yubikey-manager-qt
yubikey-manager-qt copied to clipboard
Country name must be a 2 character country code
- 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: Country name must be a 2 character country code
Steps to reproduce
Applications -> PIV -> Card Authentication -> Generate CSR
Enter the subject string: C=SE/ST=StateName/L=CityName/O=CompanyName/OU=CompanySectionName/CN=Test
Expected result
For this window to produce the CSR at the specified location:
Actual results
Failed to generate the CSR with the following stack trace:
Failed to open device
Traceback (most recent call last):
File "qrc:///py/yubikey.py", line 78, in wrapped
return f(*args, **kwargs)
^^^^^^^^^^^^^^^^^^
File "qrc:///py/yubikey.py", line 632, in piv_generate_certificate
csr = generate_csr(session,
^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/ykman/piv.py", line 749, in generate_csr
parse_rfc4514_string(subject_str)
File "/usr/lib/python3.11/site-packages/ykman/piv.py", line 141, in parse_rfc4514_string
parts.append(x509.NameAttribute(attr, v))
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/cryptography/x509/name.py", line 142, in __init__
raise ValueError(
ValueError: Country name must be a 2 character country code
Try using , instead of / for the subject. In your case C=SE,ST=StateName,L=CityName,O=CompanyName,OU=CompanySectionName,CN=Test
That worked. Is this intended behavior? As the praxis is / for most libraries and examples.