]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Improve debugging
authorOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:23:21 +0000 (11:23 -0700)
committerOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:23:21 +0000 (11:23 -0700)
Clarify some debugging messages.

open-vm-tools/vgauth/serviceImpl/verify.c

index 3cbd7f2166877bcb651acb6932713b4bad8882d8..3a7841433b311284b42c3804fc481ab35ff3746d 100644 (file)
@@ -119,6 +119,19 @@ ServiceVerifyAndCheckTrustCertChainForSubject(int numCerts,
    ASSERT(subj);
    ASSERT(numCerts > 0);
 
+   /*
+    * Dump the token cert chain for debugging purposes.
+    */
+   if (gVerboseLogging) {
+      gchar *chainx509;
+
+      for (i = 0; i < numCerts; i++) {
+         chainx509 = CertVerify_CertToX509String(pemCertChain[i]);
+         Debug("%s: Token chain cert #%d:\n%s", __FUNCTION__, i, chainx509);
+         g_free(chainx509);
+      }
+   }
+
    /*
     * If we have no userName, look through the mapping file for a match
     * from the cert chain.
@@ -177,7 +190,7 @@ ServiceVerifyAndCheckTrustCertChainForSubject(int numCerts,
        * Subject went unmatched, so fail.
        */
       if (NULL == queryUserName) {
-         Debug("%s: no matching subject found in mapping file\n",
+         Debug("%s: no matching cert and subject found in mapping file\n",
                __FUNCTION__);
          err = VGAUTH_E_AUTHENTICATION_DENIED;
          goto done;
@@ -186,19 +199,6 @@ ServiceVerifyAndCheckTrustCertChainForSubject(int numCerts,
       queryUserName = g_strdup(userName);
    }
 
-   /*
-    * Dump the token cert chain for debugging purposes.
-    */
-   if (gVerboseLogging) {
-      gchar *chainx509;
-
-      for (i = 0; i < numCerts; i++) {
-         chainx509 = CertVerify_CertToX509String(pemCertChain[i]);
-         Debug("%s: Token chain cert #%d:\n%s", __FUNCTION__, i, chainx509);
-         g_free(chainx509);
-      }
-   }
-
    /*
     * Make sure the user exists -- Query supports deleted users
     * to allow for cleanup.
@@ -220,6 +220,8 @@ ServiceVerifyAndCheckTrustCertChainForSubject(int numCerts,
    if (gVerboseLogging) {
       gchar *storex509;
 
+      Debug("%s: %d certs in store for user %s\n",  __FUNCTION__,
+            numStoreCerts, queryUserName);
       for (i = 0; i < numStoreCerts; i++) {
          storex509 = CertVerify_CertToX509String(aList[i].pemCert);
          Debug("%s: Store chain cert #%d:\n%s", __FUNCTION__, i, storex509);