github / smimesign

An S/MIME signing utility for use with Git

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Certificate that can not be parsed

aetos382 opened this issue · comments

commented

I am using Microsoft Skype for Business.
This software automatically generates a certificate when I sign in.
smimesign can't parse it.

smimesign --list-keys
WARNING: failed to get identity certificate: certificate parsing failed: asn1: syntax error: PrintableString contains invalid character

The content of the certificate is as follows.
I can not export the private key of this certificate, but I hope that it will give you some clues.

-----BEGIN CERTIFICATE-----
MIIDkjCCAnqgAwIBAgIK/CPxFSbWT3GRATANBgkqhkiG9w0BAQsFADAgMR4wHAYD
VQQDExVDb21tdW5pY2F0aW9ucyBTZXJ2ZXIwHhcNMTgxMTA4MDMxMTQzWhcNMTgx
MTA4MTExMTQzWjAZMRcwFQYDVQQDEw5hZXRvc0BhZXJpZS5qcDCCASIwDQYJKoZI
hvcNAQEBBQADggEPADCCAQoCggEBAJleXQfrjQGptnfAjT6e6G0zCQbVXliZcak1
uSRyPrhMpL0P82crX6yfT1GW2qbeQzHBu4EwfpPEZYSr9MQPiMK+6S23CxVCD/FM
L2HRxFVJSCORefA3ZMiu81dG2wac0t+pUXJngwTAoVN0c0Xzkm6rL1JGcLDTK1qP
ZEfiTIR8teCn2iB8lFsOO3BPKIS3UH3icqOQyh5cqNQsLJ24EDuF8yT1JIKasAwx
Q9MVeLRTIvCqKty/81wZriN6oBDBzKw0qZ9BgC/EM71B5Wd734YTptEwn4IK2C5j
HjjuHie5gDkJq+Bze94ks+Tn/M6K7qIhQwEpJMzX1dtXB4V/t4kCAwEAAaOB1DCB
0TATBgNVHSUEDDAKBggrBgEFBQcDAjAtBgNVHQ4EJgQkNzQ1RTIyMDYtMDY0OS01
M0IyLTgyNDYtQzE3NDZGNTdDMTA1MEcGA1UdIwRAMD6AHHR5MWpwMTA2ZmVzMDIu
aW5mcmEubHluYy5jb22hHoIcdHkxanAxMDZmZXMwMi5pbmZyYS5seW5jLmNvbTAn
BgNVHRIEIDAeghx0eTFqcDEwNmZlczAyLmluZnJhLmx5bmMuY29tMBkGA1UdEQQS
MBCBDmFldG9zQGFlcmllLmpwMA0GCSqGSIb3DQEBCwUAA4IBAQCZDJOf6fMta56I
3A5coCk+NdC8Vz6Eda2GcRHNkimA1S+3l1bZlnlQKsR/pHfuS//F6xPhLqxQ8UFL
t6a9lPwYxcvd7wYiMUPb7TARLcamZvKXqusCjaA8VUBNhcUlild2WLj6LhODpY0A
ExsU7BY11HfMvtfYl0B+TdjRWHDyI1ajJQV8Xl/mKfPlUm7LRrvnnnDJzeROzkYa
7TAjrfqYYiq4rWBt4namTapo9/MJlsyNLFmJmpWWzUuKnRycUowMR/NUuvWMMqtb
IDzuqu75PMowS4OWpNODNTSjNoaHW22FCf54MKwGKxtKU68EGK9tNm1+iX9oJBx2
brbYB8Tw
-----END CERTIFICATE-----

smimesign --version
0.0.6

The subject common name in that certificate is an ASN.1 PrintableString type containing an email address. This string type does now allow for the @ character contained in the email address, which explains the error from Go's crypto library.

commented

@mastahyeti

If this certificate is in my certificate store, the "git commit -S" command will fail with an error, even if this certificate is not used for signing (the error message is same as the smimesign --list-keys).

Thanks for clarifying. This being in your keychain shouldn’t prevent you from signing with a different identity.

This should be fixed by #38. Sorry to take so long with that. This change is included in v0.0.8.