|
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 */ |
|
10 |
|
11 #include "pkix_revocationmethod.h" |
|
12 #include "pkix_tools.h" |
|
13 |
|
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"); |
|
28 |
|
29 method->methodType = methodType; |
|
30 method->flags = flags; |
|
31 method->priority = priority; |
|
32 method->localRevChecker = localRevChecker; |
|
33 method->externalRevChecker = externalRevChecker; |
|
34 |
|
35 PKIX_RETURN(REVOCATIONMETHOD); |
|
36 } |
|
37 |
|
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; |
|
47 |
|
48 PKIX_ENTER(REVOCATIONMETHOD, "pkix_RevocationMethod_Duplicate"); |
|
49 PKIX_NULLCHECK_TWO(object, newObject); |
|
50 |
|
51 method = (pkix_RevocationMethod *)object; |
|
52 |
|
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); |
|
62 |
|
63 cleanup: |
|
64 |
|
65 PKIX_RETURN(REVOCATIONMETHOD); |
|
66 } |