Provide WIN32 function to return the address of PKIX_ERRORNAMES array, NSS_LIBPKIX_BRANCH
authorrichard.freedman%sun.com
Thu, 18 May 2006 21:46:34 +0000
branchNSS_LIBPKIX_BRANCH
changeset 7111 08052faec4dc6b0e2c429704260f829484540e74
parent 7092 5dcff83f7626fe892409825ee8d0a2575409e968
child 7116 f90ff30718e50253270dc5f8270a6403b157d99e
push idunknown
push userunknown
push dateunknown
Provide WIN32 function to return the address of PKIX_ERRORNAMES array, since we are unable to reference it directly from the test directory.
security/nss/cmd/libpkix/pkix/top/validatechain_NB/test_validatechain_NB.c
security/nss/lib/libpkix/pkix/util/pkix_error.c
security/nss/lib/libpkix/pkix/util/pkix_error.h
security/nss/lib/nss/nss.def
--- a/security/nss/cmd/libpkix/pkix/top/validatechain_NB/test_validatechain_NB.c
+++ b/security/nss/cmd/libpkix/pkix/top/validatechain_NB/test_validatechain_NB.c
@@ -153,17 +153,21 @@ PKIX_Error *loggerCallback(
         char result[resultSize];
 
         PKIX_TEST_STD_VARS();
 
         msg = PKIX_String2ASCII(message, plContext);
         PR_snprintf(result, resultSize,
             "Logging %s (%s): %s",
 	    levels[logLevel],
-	    PKIX_ERRORNAMES[logComponent],
+#if defined(_WIN32)
+	    PKIX_Error_GetErrorString(logComponent),
+#else
+            PKIX_ERRORNAMES[logComponent],
+#endif
 	    msg);
         subTest(result);
 
 cleanup:
         PKIX_TEST_EXPECT_NO_ERROR(PKIX_PL_Free(msg, plContext));
         PKIX_TEST_RETURN();
 }
 
--- a/security/nss/lib/libpkix/pkix/util/pkix_error.c
+++ b/security/nss/lib/libpkix/pkix/util/pkix_error.c
@@ -543,8 +543,16 @@ PKIX_Error_GetDescription(
         if (error != PKIX_ALLOC_ERROR()){
                 PKIX_INCREF(error->desc);
         }
 
         *pDesc = error->desc;
 
         PKIX_RETURN(ERROR);
 }
+
+#if defined(_WIN32)
+const char *
+PKIX_Error_GetErrorString(PKIX_ERRORNUM error)
+{
+        return PKIX_ERRORNAMES[error];
+}
+#endif
--- a/security/nss/lib/libpkix/pkix/util/pkix_error.h
+++ b/security/nss/lib/libpkix/pkix/util/pkix_error.h
@@ -56,13 +56,17 @@ struct PKIX_ErrorStruct {
         PKIX_PL_Object *info;
         PKIX_PL_String *desc;
 };
 
 /* see source file for function documentation */
 
 PKIX_Error * pkix_Error_RegisterSelf(void *plContext);
 
+#if defined(_WIN32)
+const char *PKIX_Error_GetErrorString(PKIX_ERRORNUM error);
+#endif
+
 #ifdef __cplusplus
 }
 #endif
 
 #endif /* _PKIX_ERROR_H */
--- a/security/nss/lib/nss/nss.def
+++ b/security/nss/lib/nss/nss.def
@@ -949,16 +949,17 @@ PKIX_CRLSelector_GetCRLSelectorContext;
 PKIX_CRLSelector_GetMatchCallback;
 PKIX_CRLSelector_SetCommonCRLSelectorParams;
 pkix_DefaultRevChecker_Initialize;
 PKIX_Error_Create;
 PKIX_Error_GetCause;
 PKIX_Error_GetDescription;
 PKIX_Error_GetErrorCode;
 PKIX_Error_GetSupplementaryInfo;
+PKIX_Error_GetErrorString;
 PKIX_ERRORNAMES;
 PKIX_Initialize;
 PKIX_Initialize_SetConfigDir;
 PKIX_List_AppendItem;
 PKIX_List_Create;
 PKIX_List_DeleteItem;
 PKIX_List_GetItem;
 PKIX_List_GetLength;