Getting PKCS11 to read the correct CN on an AD CA signed cert

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












0















So I've done a lot of testing the past week on this, and it seems that opensc_pkcs11 only reads the very first CN on a certificate which is very annoying. I've been generating the certs via AD which maps the CN the user is in as well as the CN of the user. So Centos/Ubuntu reads the cert as being for "Users" and not for "bfrown".



Now if I write the certificate on my FreeIPA server I can load it into the userCertificate attribute and it correctly recognizes and authenticates the cert against the user. I figured I could do this via the userCertificate attribute on AD as well, so I did an ldapmodify and loaded it onto "bfrown", I can see it if I do a Get-ADUser and view the properties but it's not verifying it at all. I have my sssd.conf with [pam] set to pam_cert_auth = True and ldap_user_certificate = userCertificate:binary but it still fails to properly pop up a smartcard login on GDM gui.



The certificates correctly map to their users in the context of, if the cert is for CN=Users,CN=bfrown and it can map "bfrown" to a user on the linux system or through SSSD against the domain, it will login as "bfrown", and you can't use that same cert to login as "CN=Users,CN=notbfrown" on the same domain...I just hate that it says "Welcome Users!" at the prompt and feel there has to be same way to make it read the last CN in the cert instead of the very first or something...



Looking at .crt on Windows it reads as "CN=btown,CN=Users,DC=example,DC=com" but on linux it's reversed in being "DC=com,DC=example,CN=Users,CN=btown". Opensc grabs that first CN and just uses that as the prompt when issuing a "Welcome".










share|improve this question




























    0















    So I've done a lot of testing the past week on this, and it seems that opensc_pkcs11 only reads the very first CN on a certificate which is very annoying. I've been generating the certs via AD which maps the CN the user is in as well as the CN of the user. So Centos/Ubuntu reads the cert as being for "Users" and not for "bfrown".



    Now if I write the certificate on my FreeIPA server I can load it into the userCertificate attribute and it correctly recognizes and authenticates the cert against the user. I figured I could do this via the userCertificate attribute on AD as well, so I did an ldapmodify and loaded it onto "bfrown", I can see it if I do a Get-ADUser and view the properties but it's not verifying it at all. I have my sssd.conf with [pam] set to pam_cert_auth = True and ldap_user_certificate = userCertificate:binary but it still fails to properly pop up a smartcard login on GDM gui.



    The certificates correctly map to their users in the context of, if the cert is for CN=Users,CN=bfrown and it can map "bfrown" to a user on the linux system or through SSSD against the domain, it will login as "bfrown", and you can't use that same cert to login as "CN=Users,CN=notbfrown" on the same domain...I just hate that it says "Welcome Users!" at the prompt and feel there has to be same way to make it read the last CN in the cert instead of the very first or something...



    Looking at .crt on Windows it reads as "CN=btown,CN=Users,DC=example,DC=com" but on linux it's reversed in being "DC=com,DC=example,CN=Users,CN=btown". Opensc grabs that first CN and just uses that as the prompt when issuing a "Welcome".










    share|improve this question


























      0












      0








      0








      So I've done a lot of testing the past week on this, and it seems that opensc_pkcs11 only reads the very first CN on a certificate which is very annoying. I've been generating the certs via AD which maps the CN the user is in as well as the CN of the user. So Centos/Ubuntu reads the cert as being for "Users" and not for "bfrown".



      Now if I write the certificate on my FreeIPA server I can load it into the userCertificate attribute and it correctly recognizes and authenticates the cert against the user. I figured I could do this via the userCertificate attribute on AD as well, so I did an ldapmodify and loaded it onto "bfrown", I can see it if I do a Get-ADUser and view the properties but it's not verifying it at all. I have my sssd.conf with [pam] set to pam_cert_auth = True and ldap_user_certificate = userCertificate:binary but it still fails to properly pop up a smartcard login on GDM gui.



      The certificates correctly map to their users in the context of, if the cert is for CN=Users,CN=bfrown and it can map "bfrown" to a user on the linux system or through SSSD against the domain, it will login as "bfrown", and you can't use that same cert to login as "CN=Users,CN=notbfrown" on the same domain...I just hate that it says "Welcome Users!" at the prompt and feel there has to be same way to make it read the last CN in the cert instead of the very first or something...



      Looking at .crt on Windows it reads as "CN=btown,CN=Users,DC=example,DC=com" but on linux it's reversed in being "DC=com,DC=example,CN=Users,CN=btown". Opensc grabs that first CN and just uses that as the prompt when issuing a "Welcome".










      share|improve this question
















      So I've done a lot of testing the past week on this, and it seems that opensc_pkcs11 only reads the very first CN on a certificate which is very annoying. I've been generating the certs via AD which maps the CN the user is in as well as the CN of the user. So Centos/Ubuntu reads the cert as being for "Users" and not for "bfrown".



      Now if I write the certificate on my FreeIPA server I can load it into the userCertificate attribute and it correctly recognizes and authenticates the cert against the user. I figured I could do this via the userCertificate attribute on AD as well, so I did an ldapmodify and loaded it onto "bfrown", I can see it if I do a Get-ADUser and view the properties but it's not verifying it at all. I have my sssd.conf with [pam] set to pam_cert_auth = True and ldap_user_certificate = userCertificate:binary but it still fails to properly pop up a smartcard login on GDM gui.



      The certificates correctly map to their users in the context of, if the cert is for CN=Users,CN=bfrown and it can map "bfrown" to a user on the linux system or through SSSD against the domain, it will login as "bfrown", and you can't use that same cert to login as "CN=Users,CN=notbfrown" on the same domain...I just hate that it says "Welcome Users!" at the prompt and feel there has to be same way to make it read the last CN in the cert instead of the very first or something...



      Looking at .crt on Windows it reads as "CN=btown,CN=Users,DC=example,DC=com" but on linux it's reversed in being "DC=com,DC=example,CN=Users,CN=btown". Opensc grabs that first CN and just uses that as the prompt when issuing a "Welcome".







      linux smartcard






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 20 at 7:20









      user1794469

      1,5801822




      1,5801822










      asked Jan 20 at 1:44









      btownbtown

      11




      11




















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f495548%2fgetting-pkcs11-to-read-the-correct-cn-on-an-ad-ca-signed-cert%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Unix & Linux Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f495548%2fgetting-pkcs11-to-read-the-correct-cn-on-an-ad-ca-signed-cert%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown






          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Displaying single band from multi-band raster using QGIS

          How many registers does an x86_64 CPU actually have?