summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralexei.volkov.bugs%sun.com <devnull@localhost>2007-10-09 22:30:15 +0000
committeralexei.volkov.bugs%sun.com <devnull@localhost>2007-10-09 22:30:15 +0000
commitc1acf261fecdd32f103a4d4eaf5855a87d9bb568 (patch)
treefa194924acd183dd42f2ecb9107fc1a841cd4892
parent99220051c7aadaff75cd35ff27aca5508c427451 (diff)
downloadnss-hg-c1acf261fecdd32f103a4d4eaf5855a87d9bb568.tar.gz
399236 - pkix wrapper must print debug output into stderr. r=nelson
-rw-r--r--security/nss/lib/certhigh/certvfypkix.c24
-rw-r--r--security/nss/lib/certhigh/certvfypkixprint.c6
2 files changed, 15 insertions, 15 deletions
diff --git a/security/nss/lib/certhigh/certvfypkix.c b/security/nss/lib/certhigh/certvfypkix.c
index ab7cc69d1..31d0c47de 100644
--- a/security/nss/lib/certhigh/certvfypkix.c
+++ b/security/nss/lib/certhigh/certvfypkix.c
@@ -59,7 +59,7 @@
#include "pkix_pl_common.h"
#include "pkix_pl_ekuchecker.h"
-#ifdef DEBUG
+#ifdef DEBUG_volkov
/* Temporary declarations of functioins. Will be removed with fix for
* 391183 */
extern char *
@@ -853,9 +853,9 @@ cert_GetLogFromVerifyNode(
if (children == NULL) {
PKIX_ERRORCODE errCode = PKIX_ANCHORDIDNOTCHAINTOCERT;
if (node->error && node->error->errCode != errCode) {
-#ifdef DEBUG
+#ifdef DEBUG_volkov
char *string = pkix_Error2ASCII(node->error, plContext);
- printf("Branch search finished with error: \t%s\n", string);
+ fprintf(stderr, "Branch search finished with error: \t%s\n", string);
PKIX_PL_Free(string, NULL);
#endif
if (log != NULL) {
@@ -973,9 +973,9 @@ cert_GetBuildResults(
if (error) {
unsigned long nssErrorCode = 0;
-#ifdef DEBUG
+#ifdef DEBUG_volkov
char *temp = pkix_Error2ASCII(error, plContext);
- printf("BUILD ERROR:\n%s\n", temp);
+ fprintf(stderr, "BUILD ERROR:\n%s\n", temp);
PKIX_PL_Free(temp, NULL);
#endif /* DEBUG */
cert_PkixErrorToNssCode(error, &nssErrorCode, plContext);
@@ -997,7 +997,7 @@ cert_GetBuildResults(
plContext),
PKIX_BUILDRESULTGETCERTCHAINFAILED);
-#ifdef DEBUG
+#ifdef DEBUG_volkov
tmpPkixError = cert_PrintCertChain(pkixCertChain, plContext);
if (tmpPkixError) {
PKIX_PL_Object_DecRef((PKIX_PL_Object*)tmpPkixError, plContext);
@@ -1025,7 +1025,7 @@ cert_GetBuildResults(
plContext),
PKIX_TRUSTANCHORGETTRUSTEDCERTFAILED);
-#ifdef DEBUG
+#ifdef DEBUG_volkov
if (pvalidChain == NULL) {
cert_PrintCert(trustedCert, plContext);
}
@@ -1118,7 +1118,7 @@ cert_VerifyCertChainPkix(
SECStatus rv = SECFailure;
void *plContext = NULL;
-#ifdef DEBUG
+#ifdef DEBUG_volkov
CERTCertificate *trustedRoot = NULL;
CERTCertList *validChain = NULL;
#endif /* DEBUG */
@@ -1156,21 +1156,21 @@ cert_VerifyCertChainPkix(
cleanup:
error = cert_GetBuildResults(result, verifyNode, error, log,
-#ifdef DEBUG
+#ifdef DEBUG_volkov
&trustedRoot, &validChain,
#else
NULL, NULL,
#endif /* DEBUG */
plContext);
if (error) {
-#ifdef DEBUG
+#ifdef DEBUG_volkov
char *temp = pkix_Error2ASCII(error, plContext);
- printf("GET BUILD RES ERRORS:\n%s\n", temp);
+ fprintf(stderr, "GET BUILD RES ERRORS:\n%s\n", temp);
PKIX_PL_Free(temp, NULL);
#endif /* DEBUG */
PKIX_PL_Object_DecRef((PKIX_PL_Object *)error, plContext);
}
-#ifdef DEBUG
+#ifdef DEBUG_volkov
if (trustedRoot) {
CERT_DestroyCertificate(trustedRoot);
}
diff --git a/security/nss/lib/certhigh/certvfypkixprint.c b/security/nss/lib/certhigh/certvfypkixprint.c
index 76c94bb01..a52e82d44 100644
--- a/security/nss/lib/certhigh/certvfypkixprint.c
+++ b/security/nss/lib/certhigh/certvfypkixprint.c
@@ -197,7 +197,7 @@ cert_PrintCertChain(
PKIX_List_GetLength(pkixCertChain, &numCerts, plContext),
PKIX_LISTGETLENGTHFAILED);
- printf("\n");
+ fprintf(stderr, "\n");
for (i = 0; i < numCerts; i++){
PKIX_CHECK
@@ -207,7 +207,7 @@ cert_PrintCertChain(
asciiResult = pkix_Cert2ASCII(cert);
- printf("CERT[%d]:\n%s\n", i, asciiResult);
+ fprintf(stderr, "CERT[%d]:\n%s\n", i, asciiResult);
PKIX_PL_Free(asciiResult, plContext);
asciiResult = NULL;
@@ -230,7 +230,7 @@ cert_PrintCert(
asciiResult = pkix_Cert2ASCII(pkixCert);
- printf("CERT[0]:\n%s\n", asciiResult);
+ fprintf(stderr, "CERT[0]:\n%s\n", asciiResult);
PKIX_PL_Free(asciiResult, plContext);
}