andre@0: /* This Source Code Form is subject to the terms of the Mozilla Public andre@0: * License, v. 2.0. If a copy of the MPL was not distributed with this andre@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ andre@0: /* andre@0: * pkix_revocationmethod.c andre@0: * andre@0: * RevocationMethod Object Functions andre@0: * andre@0: */ andre@0: andre@0: #include "pkix_revocationmethod.h" andre@0: #include "pkix_tools.h" andre@0: andre@0: /* Constructor of revocation method object. Does not create an object, andre@0: * but just initializez PKIX_RevocationMethodStruct fields. Object andre@0: * suppose to be already created. */ andre@0: PKIX_Error * andre@0: pkix_RevocationMethod_Init( andre@0: pkix_RevocationMethod *method, andre@0: PKIX_RevocationMethodType methodType, andre@0: PKIX_UInt32 flags, andre@0: PKIX_UInt32 priority, andre@0: pkix_LocalRevocationCheckFn localRevChecker, andre@0: pkix_ExternalRevocationCheckFn externalRevChecker, andre@0: void *plContext) andre@0: { andre@0: PKIX_ENTER(REVOCATIONMETHOD, "PKIX_RevocationMethod_Init"); andre@0: andre@0: method->methodType = methodType; andre@0: method->flags = flags; andre@0: method->priority = priority; andre@0: method->localRevChecker = localRevChecker; andre@0: method->externalRevChecker = externalRevChecker; andre@0: andre@0: PKIX_RETURN(REVOCATIONMETHOD); andre@0: } andre@0: andre@0: /* Data duplication data. Not create an object. Only initializes fields andre@0: * in the new object by data from "object". */ andre@0: PKIX_Error * andre@0: pkix_RevocationMethod_Duplicate( andre@0: PKIX_PL_Object *object, andre@0: PKIX_PL_Object *newObject, andre@0: void *plContext) andre@0: { andre@0: pkix_RevocationMethod *method = NULL; andre@0: andre@0: PKIX_ENTER(REVOCATIONMETHOD, "pkix_RevocationMethod_Duplicate"); andre@0: PKIX_NULLCHECK_TWO(object, newObject); andre@0: andre@0: method = (pkix_RevocationMethod *)object; andre@0: andre@0: PKIX_CHECK( andre@0: pkix_RevocationMethod_Init((pkix_RevocationMethod*)newObject, andre@0: method->methodType, andre@0: method->flags, andre@0: method->priority, andre@0: method->localRevChecker, andre@0: method->externalRevChecker, andre@0: plContext), andre@0: PKIX_COULDNOTCREATEREVOCATIONMETHODOBJECT); andre@0: andre@0: cleanup: andre@0: andre@0: PKIX_RETURN(REVOCATIONMETHOD); andre@0: }