security/nss/lib/libpkix/pkix/checker/pkix_revocationmethod.c

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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/. */
     4 /*
     5  * pkix_revocationmethod.c
     6  *
     7  * RevocationMethod Object Functions
     8  *
     9  */
    11 #include "pkix_revocationmethod.h"
    12 #include "pkix_tools.h"
    14 /* Constructor of revocation method object. Does not create an object,
    15  * but just initializez PKIX_RevocationMethodStruct fields. Object
    16  * suppose to be already created. */
    17 PKIX_Error *
    18 pkix_RevocationMethod_Init(
    19     pkix_RevocationMethod *method,
    20     PKIX_RevocationMethodType methodType,
    21     PKIX_UInt32 flags,
    22     PKIX_UInt32 priority,
    23     pkix_LocalRevocationCheckFn localRevChecker,
    24     pkix_ExternalRevocationCheckFn externalRevChecker,
    25     void *plContext) 
    26 {
    27     PKIX_ENTER(REVOCATIONMETHOD, "PKIX_RevocationMethod_Init");
    29     method->methodType = methodType;
    30     method->flags = flags;
    31     method->priority = priority;
    32     method->localRevChecker = localRevChecker;
    33     method->externalRevChecker = externalRevChecker;
    35     PKIX_RETURN(REVOCATIONMETHOD);
    36 }
    38 /* Data duplication data. Not create an object. Only initializes fields
    39  * in the new object by data from "object". */
    40 PKIX_Error *
    41 pkix_RevocationMethod_Duplicate(
    42         PKIX_PL_Object *object,
    43         PKIX_PL_Object *newObject,
    44         void *plContext)
    45 {
    46         pkix_RevocationMethod *method = NULL;
    48         PKIX_ENTER(REVOCATIONMETHOD, "pkix_RevocationMethod_Duplicate");
    49         PKIX_NULLCHECK_TWO(object, newObject);
    51         method = (pkix_RevocationMethod *)object;
    53         PKIX_CHECK(
    54             pkix_RevocationMethod_Init((pkix_RevocationMethod*)newObject,
    55                                        method->methodType,
    56                                        method->flags,
    57                                        method->priority,
    58                                        method->localRevChecker,
    59                                        method->externalRevChecker,
    60                                        plContext),
    61             PKIX_COULDNOTCREATEREVOCATIONMETHODOBJECT);
    63 cleanup:
    65         PKIX_RETURN(REVOCATIONMETHOD);
    66 }

mercurial