security/nss/lib/pki/certdecode.c

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 #ifndef PKIT_H
     6 #include "pkit.h"
     7 #endif /* PKIT_H */
     9 #ifndef PKIM_H
    10 #include "pkim.h"
    11 #endif /* PKIM_H */
    13 /* This is defined in pki3hack.c */
    14 NSS_EXTERN nssDecodedCert *
    15 nssDecodedPKIXCertificate_Create (
    16   NSSArena *arenaOpt,
    17   NSSDER *encoding
    18 );
    20 NSS_IMPLEMENT PRStatus
    21 nssDecodedPKIXCertificate_Destroy (
    22   nssDecodedCert *dc
    23 );
    25 NSS_IMPLEMENT nssDecodedCert *
    26 nssDecodedCert_Create (
    27   NSSArena *arenaOpt,
    28   NSSDER *encoding,
    29   NSSCertificateType type
    30 )
    31 {
    32     nssDecodedCert *rvDC = NULL;
    33     switch(type) {
    34     case NSSCertificateType_PKIX:
    35 	rvDC = nssDecodedPKIXCertificate_Create(arenaOpt, encoding);
    36 	break;
    37     default:
    38 #if 0
    39 	nss_SetError(NSS_ERROR_INVALID_ARGUMENT);
    40 #endif
    41 	return (nssDecodedCert *)NULL;
    42     }
    43     return rvDC;
    44 }
    46 NSS_IMPLEMENT PRStatus
    47 nssDecodedCert_Destroy (
    48   nssDecodedCert *dc
    49 )
    50 {
    51     if (!dc) {
    52 	return PR_FAILURE;
    53     }
    54     switch(dc->type) {
    55     case NSSCertificateType_PKIX:
    56 	return nssDecodedPKIXCertificate_Destroy(dc);
    57     default:
    58 #if 0
    59 	nss_SetError(NSS_ERROR_INVALID_ARGUMENT);
    60 #endif
    61 	break;
    62     }
    63     return PR_FAILURE;
    64 }

mercurial