summaryrefslogtreecommitdiffstats
path: root/pki/base/tps/src/tus/tus_db.c
diff options
context:
space:
mode:
authorcfu <cfu@c9f7a03b-bd48-0410-a16d-cbbf54688b0b>2009-03-31 18:07:34 +0000
committercfu <cfu@c9f7a03b-bd48-0410-a16d-cbbf54688b0b>2009-03-31 18:07:34 +0000
commit4dacaa0ae1446644033e0556677a69cbb0c1f042 (patch)
tree2946435ce7f1ec41b5a908df580540931e579f56 /pki/base/tps/src/tus/tus_db.c
parentdc0acce379db53835a91dde4a005ccb3ffdeeec2 (diff)
downloadpki-4dacaa0ae1446644033e0556677a69cbb0c1f042.tar.gz
pki-4dacaa0ae1446644033e0556677a69cbb0c1f042.tar.xz
pki-4dacaa0ae1446644033e0556677a69cbb0c1f042.zip
488291 - Missing renewal feature for smart cards in TMS
git-svn-id: svn+ssh://svn.fedorahosted.org/svn/pki/trunk@356 c9f7a03b-bd48-0410-a16d-cbbf54688b0b
Diffstat (limited to 'pki/base/tps/src/tus/tus_db.c')
-rw-r--r--pki/base/tps/src/tus/tus_db.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/pki/base/tps/src/tus/tus_db.c b/pki/base/tps/src/tus/tus_db.c
index 4908fab78..951938d8c 100644
--- a/pki/base/tps/src/tus/tus_db.c
+++ b/pki/base/tps/src/tus/tus_db.c
@@ -3813,8 +3813,18 @@ TPS_PUBLIC char *get_token_policy(char *cn)
return ret;
}
+TPS_PUBLIC int allow_token_renew(char *cn)
+{
+ return allow_token_enroll_policy(cn, "RENEW=YES");
+}
+
TPS_PUBLIC int allow_token_reenroll(char *cn)
{
+ return allow_token_enroll_policy(cn, "RE_ENROLL=YES");
+}
+
+TPS_PUBLIC int allow_token_enroll_policy(char *cn, const char *policy)
+{
LDAPMessage *result = NULL;
LDAPMessage *e = NULL;
char **v = NULL;
@@ -3827,7 +3837,7 @@ TPS_PUBLIC int allow_token_reenroll(char *cn)
if (e != NULL) {
if ((v = ldap_get_values(ld, e, TOKEN_POLICY)) != NULL) {
if (v[0] != NULL && PL_strlen(v[0]) > 0) {
- if (PL_strstr(v[0], "RE_ENROLL=YES")) {
+ if (PL_strstr(v[0], policy)) {
can_reenroll = 1;
}
}