Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Unified Diff: mozilla/security/nss/lib/certhigh/certvfypkixprint.c

Issue 14249009: Change the NSS and NSPR source tree to the new directory structure to be (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/nss/
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mozilla/security/nss/lib/certhigh/certvfypkix.c ('k') | mozilla/security/nss/lib/certhigh/crlv2.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mozilla/security/nss/lib/certhigh/certvfypkixprint.c
===================================================================
--- mozilla/security/nss/lib/certhigh/certvfypkixprint.c (revision 191424)
+++ mozilla/security/nss/lib/certhigh/certvfypkixprint.c (working copy)
@@ -1,206 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-/*
- * nss_pkix_proxy.h
- *
- * PKIX - NSS proxy functions
- *
- */
-#include "cert.h"
-#include "pkix_pl_common.h"
-
-#ifdef DEBUG
-
-char *
-pkix_Error2ASCII(PKIX_Error *error, void *plContext)
-{
- PKIX_UInt32 length;
- char *asciiString = NULL;
- PKIX_PL_String *pkixString = NULL;
- PKIX_Error *errorResult = NULL;
-
- errorResult = PKIX_PL_Object_ToString
- ((PKIX_PL_Object*)error, &pkixString, plContext);
- if (errorResult) goto cleanup;
-
- errorResult = PKIX_PL_String_GetEncoded
- (pkixString,
- PKIX_ESCASCII,
- (void **)&asciiString,
- &length,
- plContext);
-
-cleanup:
-
- if (pkixString){
- if (PKIX_PL_Object_DecRef
- ((PKIX_PL_Object*)pkixString, plContext)){
- return (NULL);
- }
- }
-
- if (errorResult){
- PKIX_PL_Object_DecRef((PKIX_PL_Object*)errorResult, plContext);
- return (NULL);
- }
-
- return (asciiString);
-}
-
-char *
-pkix_Object2ASCII(PKIX_PL_Object *object)
-{
- PKIX_UInt32 length;
- char *asciiString = NULL;
- PKIX_PL_String *pkixString = NULL;
- PKIX_Error *errorResult = NULL;
-
- errorResult = PKIX_PL_Object_ToString
- (object, &pkixString, NULL);
- if (errorResult) goto cleanup;
-
- errorResult = PKIX_PL_String_GetEncoded
- (pkixString, PKIX_ESCASCII, (void **)&asciiString, &length, NULL);
-
-cleanup:
-
- if (pkixString){
- if (PKIX_PL_Object_DecRef((PKIX_PL_Object*)pkixString, NULL)){
- return (NULL);
- }
- }
-
- if (errorResult){
- return (NULL);
- }
-
- return (asciiString);
-}
-
-char *
-pkix_Cert2ASCII(PKIX_PL_Cert *cert)
-{
- PKIX_PL_X500Name *issuer = NULL;
- void *issuerAscii = NULL;
- PKIX_PL_X500Name *subject = NULL;
- void *subjectAscii = NULL;
- void *asciiString = NULL;
- PKIX_Error *errorResult = NULL;
- PKIX_UInt32 numChars;
- PKIX_UInt32 refCount = 0;
-
- /* Issuer */
- errorResult = PKIX_PL_Cert_GetIssuer(cert, &issuer, NULL);
- if (errorResult) goto cleanup;
-
- issuerAscii = pkix_Object2ASCII((PKIX_PL_Object*)issuer);
-
- /* Subject */
- errorResult = PKIX_PL_Cert_GetSubject(cert, &subject, NULL);
- if (errorResult) goto cleanup;
-
- if (subject){
- subjectAscii = pkix_Object2ASCII((PKIX_PL_Object*)subject);
- }
-
-/* errorResult = PKIX_PL_Object_GetRefCount((PKIX_PL_Object*)cert, &refCount, NULL); */
- if (errorResult) goto cleanup;
-
- errorResult = PKIX_PL_Malloc(200, &asciiString, NULL);
- if (errorResult) goto cleanup;
-
- numChars =
- PR_snprintf
- (asciiString,
- 200,
- "Ref: %d Subject=%s\nIssuer=%s\n",
- refCount,
- subjectAscii,
- issuerAscii);
-
- if (!numChars) goto cleanup;
-
-cleanup:
-
- if (issuer){
- if (PKIX_PL_Object_DecRef((PKIX_PL_Object*)issuer, NULL)){
- return (NULL);
- }
- }
-
- if (subject){
- if (PKIX_PL_Object_DecRef((PKIX_PL_Object*)subject, NULL)){
- return (NULL);
- }
- }
-
- if (PKIX_PL_Free((PKIX_PL_Object*)issuerAscii, NULL)){
- return (NULL);
- }
-
- if (PKIX_PL_Free((PKIX_PL_Object*)subjectAscii, NULL)){
- return (NULL);
- }
-
- if (errorResult){
- return (NULL);
- }
-
- return (asciiString);
-}
-
-PKIX_Error *
-cert_PrintCertChain(
- PKIX_List *pkixCertChain,
- void *plContext)
-{
- PKIX_PL_Cert *cert = NULL;
- PKIX_UInt32 numCerts = 0, i = 0;
- char *asciiResult = NULL;
-
- PKIX_ENTER(CERTVFYPKIX, "cert_PrintCertChain");
-
- PKIX_CHECK(
- PKIX_List_GetLength(pkixCertChain, &numCerts, plContext),
- PKIX_LISTGETLENGTHFAILED);
-
- fprintf(stderr, "\n");
-
- for (i = 0; i < numCerts; i++){
- PKIX_CHECK
- (PKIX_List_GetItem
- (pkixCertChain, i, (PKIX_PL_Object**)&cert, plContext),
- PKIX_LISTGETITEMFAILED);
-
- asciiResult = pkix_Cert2ASCII(cert);
-
- fprintf(stderr, "CERT[%d]:\n%s\n", i, asciiResult);
-
- PKIX_PL_Free(asciiResult, plContext);
- asciiResult = NULL;
-
- PKIX_DECREF(cert);
- }
-
-cleanup:
- PKIX_DECREF(cert);
-
- PKIX_RETURN(CERTVFYPKIX);
-}
-
-void
-cert_PrintCert(
- PKIX_PL_Cert *pkixCert,
- void *plContext)
-{
- char *asciiResult = NULL;
-
- asciiResult = pkix_Cert2ASCII(pkixCert);
-
- fprintf(stderr, "CERT[0]:\n%s\n", asciiResult);
-
- PKIX_PL_Free(asciiResult, plContext);
-}
-
-#endif /* DEBUG */
« no previous file with comments | « mozilla/security/nss/lib/certhigh/certvfypkix.c ('k') | mozilla/security/nss/lib/certhigh/crlv2.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698