Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | /* |
michael@0 | 5 | * pkix_revocationmethod.c |
michael@0 | 6 | * |
michael@0 | 7 | * RevocationMethod Object Functions |
michael@0 | 8 | * |
michael@0 | 9 | */ |
michael@0 | 10 | |
michael@0 | 11 | #include "pkix_revocationmethod.h" |
michael@0 | 12 | #include "pkix_tools.h" |
michael@0 | 13 | |
michael@0 | 14 | /* Constructor of revocation method object. Does not create an object, |
michael@0 | 15 | * but just initializez PKIX_RevocationMethodStruct fields. Object |
michael@0 | 16 | * suppose to be already created. */ |
michael@0 | 17 | PKIX_Error * |
michael@0 | 18 | pkix_RevocationMethod_Init( |
michael@0 | 19 | pkix_RevocationMethod *method, |
michael@0 | 20 | PKIX_RevocationMethodType methodType, |
michael@0 | 21 | PKIX_UInt32 flags, |
michael@0 | 22 | PKIX_UInt32 priority, |
michael@0 | 23 | pkix_LocalRevocationCheckFn localRevChecker, |
michael@0 | 24 | pkix_ExternalRevocationCheckFn externalRevChecker, |
michael@0 | 25 | void *plContext) |
michael@0 | 26 | { |
michael@0 | 27 | PKIX_ENTER(REVOCATIONMETHOD, "PKIX_RevocationMethod_Init"); |
michael@0 | 28 | |
michael@0 | 29 | method->methodType = methodType; |
michael@0 | 30 | method->flags = flags; |
michael@0 | 31 | method->priority = priority; |
michael@0 | 32 | method->localRevChecker = localRevChecker; |
michael@0 | 33 | method->externalRevChecker = externalRevChecker; |
michael@0 | 34 | |
michael@0 | 35 | PKIX_RETURN(REVOCATIONMETHOD); |
michael@0 | 36 | } |
michael@0 | 37 | |
michael@0 | 38 | /* Data duplication data. Not create an object. Only initializes fields |
michael@0 | 39 | * in the new object by data from "object". */ |
michael@0 | 40 | PKIX_Error * |
michael@0 | 41 | pkix_RevocationMethod_Duplicate( |
michael@0 | 42 | PKIX_PL_Object *object, |
michael@0 | 43 | PKIX_PL_Object *newObject, |
michael@0 | 44 | void *plContext) |
michael@0 | 45 | { |
michael@0 | 46 | pkix_RevocationMethod *method = NULL; |
michael@0 | 47 | |
michael@0 | 48 | PKIX_ENTER(REVOCATIONMETHOD, "pkix_RevocationMethod_Duplicate"); |
michael@0 | 49 | PKIX_NULLCHECK_TWO(object, newObject); |
michael@0 | 50 | |
michael@0 | 51 | method = (pkix_RevocationMethod *)object; |
michael@0 | 52 | |
michael@0 | 53 | PKIX_CHECK( |
michael@0 | 54 | pkix_RevocationMethod_Init((pkix_RevocationMethod*)newObject, |
michael@0 | 55 | method->methodType, |
michael@0 | 56 | method->flags, |
michael@0 | 57 | method->priority, |
michael@0 | 58 | method->localRevChecker, |
michael@0 | 59 | method->externalRevChecker, |
michael@0 | 60 | plContext), |
michael@0 | 61 | PKIX_COULDNOTCREATEREVOCATIONMETHODOBJECT); |
michael@0 | 62 | |
michael@0 | 63 | cleanup: |
michael@0 | 64 | |
michael@0 | 65 | PKIX_RETURN(REVOCATIONMETHOD); |
michael@0 | 66 | } |