From: Oliver Kurth Date: Fri, 15 Sep 2017 18:23:21 +0000 (-0700) Subject: Improve debugging X-Git-Tag: stable-10.2.0~378 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5d4fb852891e7fc0944d49dc11b4ec3b7fc4b1d1;p=thirdparty%2Fopen-vm-tools.git Improve debugging Clarify some debugging messages. --- diff --git a/open-vm-tools/vgauth/serviceImpl/verify.c b/open-vm-tools/vgauth/serviceImpl/verify.c index 3cbd7f216..3a7841433 100644 --- a/open-vm-tools/vgauth/serviceImpl/verify.c +++ b/open-vm-tools/vgauth/serviceImpl/verify.c @@ -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);