Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #include "ksm/ksm.h"
00039 #include "ksm/ksmdef.h"
00040 #include "ksm/message.h"
00041
00042 #define max(x,y) ((x) > (y) ? (x) : (y))
00043 #define min(x,y) ((x) < (y) ? (x) : (y))
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062 int KsmPolicyClockskew(KSM_SIGNATURE_POLICY *policy)
00063 {
00064
00065 if (policy == NULL) {
00066 MsgLog(KSM_INVARG, "NULL policy");
00067 return -1;
00068 }
00069 return policy->clockskew;
00070 }
00071
00072 int KsmPolicyKeyLifetime(KSM_KEY_POLICY *policy)
00073 {
00074
00075 if (policy == NULL) {
00076 MsgLog(KSM_INVARG, "NULL policy");
00077 return -1;
00078 }
00079 return policy->lifetime;
00080 }
00081
00082 int KsmPolicyStandbyKeys(KSM_KEY_POLICY *policy)
00083 {
00084
00085 if (policy == NULL) {
00086 MsgLog(KSM_INVARG, "NULL policy");
00087 return -1;
00088 }
00089 return policy->overlap;
00090 }
00091
00092 int KsmPolicyPropagationDelay(KSM_SIGNER_POLICY *policy)
00093 {
00094
00095 if (policy == NULL) {
00096 MsgLog(KSM_INVARG, "NULL policy");
00097 return -1;
00098 }
00099 return policy->propdelay;
00100 }
00101
00102
00103
00104
00105
00106
00107 int KsmPolicySoaMin(KSM_SIGNER_POLICY *policy)
00108 {
00109
00110 if (policy == NULL) {
00111 MsgLog(KSM_INVARG, "NULL policy");
00112 return -1;
00113 }
00114 return policy->soamin;
00115 }
00116
00117 int KsmPolicySoaTtl(KSM_SIGNER_POLICY *policy)
00118 {
00119
00120 if (policy == NULL) {
00121 MsgLog(KSM_INVARG, "NULL policy");
00122 return -1;
00123 }
00124 return policy->soattl;
00125 }
00126
00127 int KsmPolicyKeyTtl(KSM_KEY_POLICY *policy)
00128 {
00129
00130 if (policy == NULL) {
00131 MsgLog(KSM_INVARG, "NULL policy");
00132 return -1;
00133 }
00134 return policy->ttl;
00135 }
00136
00137
00138
00139
00140 int KsmPolicyInitialPublicationInterval(KSM_POLICY *policy)
00141 {
00142 int ncache;
00143 int pubint;
00144
00145
00146 if (policy == NULL) {
00147 MsgLog(KSM_INVARG, "NULL policy");
00148 return -1;
00149 }
00150 ncache = min(policy->signer->soattl, policy->signer->soamin);
00151 pubint = max(policy->zsk->ttl, ncache) + policy->signer->propdelay;
00152
00153 return pubint;
00154 }