From fedora-directory-commits at redhat.com Wed Jul 5 15:20:03 2006 From: fedora-directory-commits at redhat.com (Robert Crittenden (rcritten)) Date: Wed, 5 Jul 2006 08:20:03 -0700 Subject: [Fedora-directory-commits] mod_nss nss_engine_config.c,1.11,1.12 Message-ID: <200607051520.k65FK3K8004347@cvs-int.fedora.redhat.com> Author: rcritten Update of /cvs/dirsec/mod_nss In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv4330 Modified Files: nss_engine_config.c Log Message: 197681 Initialize the ECC certificate and key pointers to NULL. Index: nss_engine_config.c =================================================================== RCS file: /cvs/dirsec/mod_nss/nss_engine_config.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- nss_engine_config.c 20 Jun 2006 20:25:20 -0000 1.11 +++ nss_engine_config.c 5 Jul 2006 15:20:00 -0000 1.12 @@ -82,6 +82,8 @@ mctx->nickname = NULL; #ifdef NSS_ENABLE_ECC mctx->eccnickname = NULL; + mctx->eccservercert = NULL; + mctx->eccserverkey = NULL; #endif mctx->servercert = NULL; mctx->serverkey = NULL; From fedora-directory-commits at redhat.com Thu Jul 13 21:32:47 2006 From: fedora-directory-commits at redhat.com (Robert Relyea (rrelyea)) Date: Thu, 13 Jul 2006 14:32:47 -0700 Subject: [Fedora-directory-commits] coolkey/src/coolkey machdep.cpp,1.1,1.2 Message-ID: <200607132132.k6DLWlkn014779@cvs-int.fedora.redhat.com> Author: rrelyea Update of /cvs/dirsec/coolkey/src/coolkey In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv14747/src/coolkey Modified Files: machdep.cpp Log Message: fix pthread issue. Index: machdep.cpp =================================================================== RCS file: /cvs/dirsec/coolkey/src/coolkey/machdep.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- machdep.cpp 9 Jun 2006 18:39:11 -0000 1.1 +++ machdep.cpp 13 Jul 2006 21:32:39 -0000 1.2 @@ -328,7 +328,7 @@ pthread_mutex_t mutex; }; -static pthread_mutexattr_t OSLock_attr; +static pthread_mutexattr_t OSLock_attr = {0}; static int OSLock_attr_init = 0; OSLock::OSLock(bool exceptionAllowed) @@ -336,6 +336,7 @@ int rc; lockData = NULL; +#ifdef MAC if (!OSLock_attr_init) { rc = pthread_mutexattr_init(&OSLock_attr); if (rc < 0) { @@ -347,6 +348,7 @@ } OSLock_attr_init = 1; } +#endif lockData = new OSLockData; if (lockData) { rc = pthread_mutex_init(&lockData->mutex, &OSLock_attr); From fedora-directory-commits at redhat.com Thu Jul 13 21:32:41 2006 From: fedora-directory-commits at redhat.com (Robert Relyea (rrelyea)) Date: Thu, 13 Jul 2006 14:32:41 -0700 Subject: [Fedora-directory-commits] coolkey coolkey.spec,1.4,1.5 Message-ID: <200607132133.k6DLXBkZ014782@cvs-int.fedora.redhat.com> Author: rrelyea Update of /cvs/dirsec/coolkey In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv14747 Modified Files: coolkey.spec Log Message: fix pthread issue. Index: coolkey.spec =================================================================== RCS file: /cvs/dirsec/coolkey/coolkey.spec,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- coolkey.spec 12 Jun 2006 20:51:32 -0000 1.4 +++ coolkey.spec 13 Jul 2006 21:32:39 -0000 1.5 @@ -18,7 +18,7 @@ # END COPYRIGHT BLOCK Name: coolkey -Version: 1.0.0 +Version: 1.0.1 Release: 1 Summary: CoolKey PKCS #11 module License: LGPL @@ -30,8 +30,10 @@ BuildRequires: zlib-devel Requires: pcsc-lite Requires: ifd-egate +Requires: ccid Provides: CoolKey Openkey Obsoletes: CoolKey Openkey +ExcludeArch: s390 s390x # 390 does not have libusb or smartCards %description Linux Driver support for the CoolKey and CAC products. @@ -81,5 +83,11 @@ %changelog +* Mon Jul 10 2006 Bob Relyea - 1.0.1-1 +- Don't require pthread library in coolkey + +* Mon Jul 10 2006 Bob Relyea - 1.0.0-2 +- remove s390 from the build + * Mon Jun 5 2006 Bob Relyea - 1.0.0-1 - Initial revision for fedora From fedora-directory-commits at redhat.com Mon Jul 17 19:01:42 2006 From: fedora-directory-commits at redhat.com (Noriko Hosoi (nhosoi)) Date: Mon, 17 Jul 2006 12:01:42 -0700 Subject: [Fedora-directory-commits] mod_admserv mod_admserv.c,1.25,1.26 Message-ID: <200607171901.k6HJ1gdi004093@cvs-int.fedora.redhat.com> Author: nhosoi Update of /cvs/dirsec/mod_admserv In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv1621 Modified Files: mod_admserv.c Log Message: [197757] ??? Strange random 'Cannot Connect to the Directory Server - Invalid Credentials' message (comment #9) Changes [Change(1) and (2) in Comment#2]: 1) updated the auth_user_cache after all the password update is successfully done. 2) eliminated unnecessary ldap_search. Index: mod_admserv.c =================================================================== RCS file: /cvs/dirsec/mod_admserv/mod_admserv.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- mod_admserv.c 15 Jun 2006 17:00:29 -0000 1.25 +++ mod_admserv.c 17 Jul 2006 19:01:29 -0000 1.26 @@ -110,6 +110,7 @@ static int sync_task_sie_data(const char *name, char *query, void *arg, request_rec *r); static int change_sie_password(const char *name, char *query, void* arg, request_rec *r); +static int create_auth_users_cache_entry(char *user, char *userDN, const char *userPW, char *ldapURL); static int admserv_check_user_id(request_rec *r); @@ -1141,13 +1142,13 @@ * Return value: if successful, 1; otherwise, 0 is returned. */ static int -task_update_registry_server_bindpw(char *uid, char *password, char* bindpw) +task_update_registry_server_bindpw(char *uid, char *password, + const char* bindpw, request_rec *r) { LDAP *ld; int ldapError; - char *filter = NULL; - char *userDN = NULL; - LDAPMessage *result; + char *ldapURL = NULL; + const char *userDN = NULL; LDAPMod mod, *mods[2]; char *vals[2]; char *attrs[2]; @@ -1160,35 +1161,7 @@ return rval; } - filter = (char *)malloc(strlen(uid) + 5); /* "uid=" */ - if (NULL == filter) { - ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL, - "task_update_registry_server_bindpw(): cannot allocate %d byte memory", - strlen(uid) + 5); - goto bailout; - } - attrs[0] = "dn"; /* we just need dn ... */ - attrs[1] = NULL; - sprintf(filter, "uid=%s", uid); - ldapError = ldap_search_s(ld, NETSCAPE_ROOT_BASEDN, LDAP_SCOPE_SUBTREE, - filter, attrs, 0, &result); - if (ldapError != LDAP_SUCCESS || ldap_count_entries(ld, result) == 0) { - ldap_msgfree(result); - ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL, - "task_update_registry_server_bindpw(): ldap_search %s under %s failed: %s", - filter, NETSCAPE_ROOT_BASEDN, ldap_err2string(ldapError)); - goto bailout; - } else { - LDAPMessage *entry = ldap_first_entry(ld, result); - userDN = ldap_get_dn(ld, entry); - ldap_msgfree(result); - } - if (NULL == userDN || 0 == strlen(userDN)) { - ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL, - "task_update_registry_server_bindpw(): ldap_search %s under %s returned %s", - filter, NETSCAPE_ROOT_BASEDN, userDN?"empty string":"NULL"); - goto bailout; - } + userDN = apr_table_get(r->notes, RQ_NOTES_USERDN); /* authenticate to LDAP server */ if (LDAP_SUCCESS != (ldapError = ldap_simple_bind_s(ld, userDN, bindpw))) { @@ -1229,13 +1202,16 @@ userDN, ldap_err2string(ldapError)); goto bailout; } + /* update the auth_users cache */ + ldapURL = formLdapURL(®istryServer, r->pool); + create_auth_users_cache_entry(uid, (char *)userDN, password, ldapURL); registryServer.bindPW = password; rval = 1; bailout: closeLDAPConnection(ld); - if (NULL != filter) - free(filter); + if (NULL != ldapURL) + free(ldapURL); return rval; } @@ -1245,16 +1221,16 @@ static int change_sie_password(const char *name, char *query, void* arg, request_rec *r) { - FILE *f; - char *uid=NULL ,*pw=NULL, *col=NULL; - char *newpw=query; - char filename[BIG_LINE]; - char inbuf[BIG_LINE]; - char outbuf[64]; /* needs at least 36 bytes */ - char path[PATH_MAX]; - char *origpw = apr_table_get(r->notes, RQ_NOTES_USERPW); - int ds_done = 0; - int admpwd_done = 0; + FILE *f; + char *uid=NULL ,*pw=NULL, *col=NULL; + char *newpw=query; + char filename[BIG_LINE]; + char inbuf[BIG_LINE]; + char outbuf[64]; /* needs at least 36 bytes */ + char path[PATH_MAX]; + char *origpw = (char *)apr_table_get(r->notes, RQ_NOTES_USERPW); + int ds_done = 0; + int admpwd_done = 0; apr_snprintf(path, sizeof(path), "%s%cadmin-serv%cconfig", serverroot, FILE_PATHSEP, FILE_PATHSEP); @@ -1303,7 +1279,7 @@ } admpwd_done = 1; - if (!task_update_registry_server_bindpw(uid, strdup(newpw), origpw)) { + if (!task_update_registry_server_bindpw(uid, strdup(newpw), origpw, r)) { ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL, "failed to update server bindpw"); goto recover; From fedora-directory-commits at redhat.com Mon Jul 24 12:48:17 2006 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Mon, 24 Jul 2006 05:48:17 -0700 Subject: [Fedora-directory-commits] adminserver/admserv filter-dupfiles.sh, 1.3, NONE Message-ID: <200607241248.k6OCmHx0008776@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/adminserver/admserv In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv8742/adminserver/admserv Removed Files: filter-dupfiles.sh Log Message: These files are obsolete. --- filter-dupfiles.sh DELETED --- From fedora-directory-commits at redhat.com Mon Jul 24 12:48:18 2006 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Mon, 24 Jul 2006 05:48:18 -0700 Subject: [Fedora-directory-commits] adminserver/admserv/html Makefile.int, 1.5, NONE acladminapplet.h, 1.3, NONE acladminmain.h, 1.3, NONE acladminpanel.h, 1.3, NONE acladminprogram.h, 1.3, NONE acladvance.h, 1.3, NONE aclapplet.h, 1.3, NONE aclauth.h, 1.3, NONE aclempty.h, 1.3, NONE aclhelp.h, 1.3, NONE aclipdns.h, 1.3, NONE aclmain.h, 1.3, NONE aclonoff.h, 1.3, NONE aclpanel.h, 1.3, NONE aclprogram.h, 1.3, NONE aclrawedit.h, 1.3, NONE aclredirect.h, 1.3, NONE aclusergroup.h, 1.3, NONE certconv20.h, 1.3, NONE cladd.h, 1.3, NONE clmod.h, 1.3, NONE clnone.h, 1.3, NONE clrem.h, 1.3, NONE clscrn.h, 1.3, NONE confacc.h, 1.3, NONE confadm.h, 1.3, NONE confopt.h, 1.3, NONE cronctrl.h, 1.3, NONE cronrestart.h, 1.3, NONE cronstart.h, 1.3, NONE cronstop.h, 1.3, NONE dbconv20.h, 1.3, NONE distacl.h, 1.3, NONE distacledit.h, 1.3, NONE distadm.h, 1.3, NONE error.h, 1.3, NONE getImport.h, 1.3, NONE htmladmin.h, 1.5, NONE import.h, 1.3, NONE index.h, 1.5, NONE index.lst, 1.4, NONE infoerr.h, 1.3, NONE infonav.h, 1.3, NONE localized.js, 1.4, NONE monreplication.h, 1.3, NONE pgmgrps.lst, 1.3, NONE register.! h, 1.4, NONE registerBeta.h, 1.4, NONE rmhttp.h, 1.3, NONE sec-act.h, 1.3, NONE sec-cralias.h, 1.3, NONE sec-crtmap.h, 1.3, NONE sec-ecrl.h, 1.3, NONE sec-ecrt.h, 1.3, NONE sec-emap.h, 1.3, NONE sec-enf.h, 1.3, NONE sec-for.h, 1.3, NONE sec-gcrt.h, 1.5, NONE sec-gkey.h, 1.3, NONE sec-icrl.h, 1.3, NONE sec-icrt.h, 1.3, NONE sec-jscrt.h, 1.3, NONE sec-lmap.h, 1.3, NONE sec-lsalias.h, 1.3, NONE sec-lscalias.h, 1.3, NONE sec-lskalias.h, 1.3, NONE sec-mcrl.h, 1.3, NONE sec-mcrt.h, 1.3, NONE sec-mdalias.h, 1.3, NONE sec-mgcrt.h, 1.3, NONE sec-pref.h, 1.3, NONE sec-pswd.h, 1.3, NONE sec-rcrt.h, 1.3, NONE sec-rmalias.h, 1.3, NONE snmpcomm.h, 1.3, NONE snmpmctl.h, 1.3, NONE snmpmrestart.h, 1.3, NONE snmpmstart.h, 1.3, NONE snmpmstop.h, 1.3, NONE snmptrpc.h, 1.3, NONE stopadm.h, 1.3, NONE stoptadm.h, 1.3, NONE success.h, 1.3, NONE viewacc.h, 1.3, NONE viewacc.html, 1.3, NONE viewdata.h, 1.3, NONE viewerr.h, 1.3, NONE viewerr.html, 1.3, NONE viewlog.h, 1.3, NONE Message-ID: <200607241248.k6OCmI77008781@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/adminserver/admserv/html In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv8742/adminserver/admserv/html Removed Files: Makefile.int acladminapplet.h acladminmain.h acladminpanel.h acladminprogram.h acladvance.h aclapplet.h aclauth.h aclempty.h aclhelp.h aclipdns.h aclmain.h aclonoff.h aclpanel.h aclprogram.h aclrawedit.h aclredirect.h aclusergroup.h certconv20.h cladd.h clmod.h clnone.h clrem.h clscrn.h confacc.h confadm.h confopt.h cronctrl.h cronrestart.h cronstart.h cronstop.h dbconv20.h distacl.h distacledit.h distadm.h error.h getImport.h htmladmin.h import.h index.h index.lst infoerr.h infonav.h localized.js monreplication.h pgmgrps.lst register.h registerBeta.h rmhttp.h sec-act.h sec-cralias.h sec-crtmap.h sec-ecrl.h sec-ecrt.h sec-emap.h sec-enf.h sec-for.h sec-gcrt.h sec-gkey.h sec-icrl.h sec-icrt.h sec-jscrt.h sec-lmap.h sec-lsalias.h sec-lscalias.h sec-lskalias.h sec-mcrl.h sec-mcrt.h sec-mdalias.h sec-mgcrt.h sec-pref.h sec-pswd.h sec-rcrt.h sec-rmalias.h snmpcomm.h snmpmctl.h snmpmrestart.h snmpmstart.h snmpmstop.h snmptrpc.h stopadm.h stoptadm.h success.h viewacc.h viewacc.html viewdata.h viewerr.h viewerr.html viewlog.h Log Message: These files are obsolete. --- Makefile.int DELETED --- --- acladminapplet.h DELETED --- --- acladminmain.h DELETED --- --- acladminpanel.h DELETED --- --- acladminprogram.h DELETED --- --- acladvance.h DELETED --- --- aclapplet.h DELETED --- --- aclauth.h DELETED --- --- aclempty.h DELETED --- --- aclhelp.h DELETED --- --- aclipdns.h DELETED --- --- aclmain.h DELETED --- --- aclonoff.h DELETED --- --- aclpanel.h DELETED --- --- aclprogram.h DELETED --- --- aclrawedit.h DELETED --- --- aclredirect.h DELETED --- --- aclusergroup.h DELETED --- --- certconv20.h DELETED --- --- cladd.h DELETED --- --- clmod.h DELETED --- --- clnone.h DELETED --- --- clrem.h DELETED --- --- clscrn.h DELETED --- --- confacc.h DELETED --- --- confadm.h DELETED --- --- confopt.h DELETED --- --- cronctrl.h DELETED --- --- cronrestart.h DELETED --- --- cronstart.h DELETED --- --- cronstop.h DELETED --- --- dbconv20.h DELETED --- --- distacl.h DELETED --- --- distacledit.h DELETED --- --- distadm.h DELETED --- --- error.h DELETED --- --- getImport.h DELETED --- --- htmladmin.h DELETED --- --- import.h DELETED --- --- index.h DELETED --- --- index.lst DELETED --- --- infoerr.h DELETED --- --- infonav.h DELETED --- --- localized.js DELETED --- --- monreplication.h DELETED --- --- pgmgrps.lst DELETED --- --- register.h DELETED --- --- registerBeta.h DELETED --- --- rmhttp.h DELETED --- --- sec-act.h DELETED --- --- sec-cralias.h DELETED --- --- sec-crtmap.h DELETED --- --- sec-ecrl.h DELETED --- --- sec-ecrt.h DELETED --- --- sec-emap.h DELETED --- --- sec-enf.h DELETED --- --- sec-for.h DELETED --- --- sec-gcrt.h DELETED --- --- sec-gkey.h DELETED --- --- sec-icrl.h DELETED --- --- sec-icrt.h DELETED --- --- sec-jscrt.h DELETED --- --- sec-lmap.h DELETED --- --- sec-lsalias.h DELETED --- --- sec-lscalias.h DELETED --- --- sec-lskalias.h DELETED --- --- sec-mcrl.h DELETED --- --- sec-mcrt.h DELETED --- --- sec-mdalias.h DELETED --- --- sec-mgcrt.h DELETED --- --- sec-pref.h DELETED --- --- sec-pswd.h DELETED --- --- sec-rcrt.h DELETED --- --- sec-rmalias.h DELETED --- --- snmpcomm.h DELETED --- --- snmpmctl.h DELETED --- --- snmpmrestart.h DELETED --- --- snmpmstart.h DELETED --- --- snmpmstop.h DELETED --- --- snmptrpc.h DELETED --- --- stopadm.h DELETED --- --- stoptadm.h DELETED --- --- success.h DELETED --- --- viewacc.h DELETED --- --- viewacc.html DELETED --- --- viewdata.h DELETED --- --- viewerr.h DELETED --- --- viewerr.html DELETED --- --- viewlog.h DELETED --- From fedora-directory-commits at redhat.com Mon Jul 24 12:48:25 2006 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Mon, 24 Jul 2006 05:48:25 -0700 Subject: [Fedora-directory-commits] adminserver/admserv/icons Makefile, 1.5, NONE Makefile.int, 1.4, NONE access.gif, 1.1.1.1, NONE acss_off.gif, 1.1.1.1, NONE acss_on.gif, 1.1.1.1, NONE admin.gif, 1.1.1.1, NONE apply.gif, 1.1.1.1, NONE arrowdown.gif, 1.1.1.1, NONE b-open.gif, 1.1.1.1, NONE back.gif, 1.1.1.1, NONE back.jpg, 1.1.1.1, NONE back1.gif, 1.1.1.1, NONE back2.gif, 1.1.1.1, NONE back3.gif, 1.1.1.1, NONE banner.gif, 1.1.1.1, NONE clst_off.gif, 1.1.1.1, NONE clst_on.gif, 1.1.1.1, NONE cluster.gif, 1.1.1.1, NONE content1.gif, 1.1.1.1, NONE contents.jpg, 1.1.1.1, NONE custom.gif, 1.1.1.1, NONE encrypt.gif, 1.1.1.1, NONE exit.jpg, 1.1.1.1, NONE exit1.gif, 1.1.1.1, NONE forward.jpg, 1.1.1.1, NONE forward1.gif, 1.1.1.1, NONE glob_off.gif, 1.1.1.1, NONE glob_on.gif, 1.1.1.1, NONE greendot.gif, 1.1.1.1, NONE index.jpg, 1.1.1.1, NONE index1.gif, 1.1.1.1, NONE item_off.gif, 1.1.1.1, NONE item_on.gif, 1.1.1.1, NONE keyscert.gif, 1.1.1.1, NONE keyscert_off.gif, 1.1.1.1, NONE keyscert_on.gif, 1.1.1.1, NONE logging.gif, 1.1.1.1, NONE netscape.gif, 1.1.1.1, NONE othersrv.gif, 1.1.1.1, ! NONE pref_off.gif, 1.1.1.1, NONE pref_on.gif, 1.1.1.1, NONE prefer.gif, 1.1.1.1, NONE process.gif, 1.1.1.1, NONE report.gif, 1.1.1.1, NONE rprt_off.gif, 1.1.1.1, NONE rprt_on.gif, 1.1.1.1, NONE secy_off.gif, 1.1.1.1, NONE secy_on.gif, 1.1.1.1, NONE serv_cf.gif, 1.1.1.1, NONE serv_off.gif, 1.1.1.1, NONE serv_on.gif, 1.1.1.1, NONE serv_unk.gif, 1.1.1.1, NONE server.gif, 1.1.1.1, NONE servsupt.gif, 1.1.1.1, NONE suite.gif, 1.1.1.1, NONE suite2.gif, 1.1.1.1, NONE title.gif, 1.1.1.1, NONE title2.gif, 1.1.1.1, NONE togoff.gif, 1.1.1.1, NONE togon.gif, 1.1.1.1, NONE user_off.gif, 1.1.1.1, NONE user_on.gif, 1.1.1.1, NONE users.gif, 1.1.1.1, NONE Message-ID: <200607241248.k6OCmPcX008834@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/adminserver/admserv/icons In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv8742/adminserver/admserv/icons Removed Files: Makefile Makefile.int access.gif acss_off.gif acss_on.gif admin.gif apply.gif arrowdown.gif b-open.gif back.gif back.jpg back1.gif back2.gif back3.gif banner.gif clst_off.gif clst_on.gif cluster.gif content1.gif contents.jpg custom.gif encrypt.gif exit.jpg exit1.gif forward.jpg forward1.gif glob_off.gif glob_on.gif greendot.gif index.jpg index1.gif item_off.gif item_on.gif keyscert.gif keyscert_off.gif keyscert_on.gif logging.gif netscape.gif othersrv.gif pref_off.gif pref_on.gif prefer.gif process.gif report.gif rprt_off.gif rprt_on.gif secy_off.gif secy_on.gif serv_cf.gif serv_off.gif serv_on.gif serv_unk.gif server.gif servsupt.gif suite.gif suite2.gif title.gif title2.gif togoff.gif togon.gif user_off.gif user_on.gif users.gif Log Message: These files are obsolete. --- Makefile DELETED --- --- Makefile.int DELETED --- From fedora-directory-commits at redhat.com Mon Jul 24 12:48:24 2006 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Mon, 24 Jul 2006 05:48:24 -0700 Subject: [Fedora-directory-commits] adminserver/lib/base util.cpp,1.5,NONE Message-ID: <200607241248.k6OCmO3q008826@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/adminserver/lib/base In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv8742/adminserver/lib/base Removed Files: util.cpp Log Message: These files are obsolete. --- util.cpp DELETED --- From fedora-directory-commits at redhat.com Mon Jul 24 12:48:26 2006 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Mon, 24 Jul 2006 05:48:26 -0700 Subject: [Fedora-directory-commits] adminserver/admserv/ntadmin Makefile, 1.5, NONE admin.cpp, 1.4, NONE admin.h, 1.3, NONE admin.ico, 1.1.1.1, NONE admin.rc, 1.3, NONE dlgadmin.cpp, 1.3, NONE dlgadmin.h, 1.3, NONE resource.h, 1.1.1.1, NONE Message-ID: <200607241248.k6OCmQoJ008839@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/adminserver/admserv/ntadmin In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv8742/adminserver/admserv/ntadmin Removed Files: Makefile admin.cpp admin.h admin.ico admin.rc dlgadmin.cpp dlgadmin.h resource.h Log Message: These files are obsolete. --- Makefile DELETED --- --- admin.cpp DELETED --- --- admin.h DELETED --- --- admin.ico DELETED --- --- admin.rc DELETED --- --- dlgadmin.cpp DELETED --- --- dlgadmin.h DELETED --- --- resource.h DELETED --- From fedora-directory-commits at redhat.com Mon Jul 24 12:48:24 2006 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Mon, 24 Jul 2006 05:48:24 -0700 Subject: [Fedora-directory-commits] adminserver/lib/libadmin admconf.c, 1.6, NONE admserv.c, 1.5, NONE password.c, 1.3, NONE password.h, 1.3, NONE Message-ID: <200607241248.k6OCmO8H008831@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/adminserver/lib/libadmin In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv8742/adminserver/lib/libadmin Removed Files: admconf.c admserv.c password.c password.h Log Message: These files are obsolete. --- admconf.c DELETED --- --- admserv.c DELETED --- --- password.c DELETED --- --- password.h DELETED --- From fedora-directory-commits at redhat.com Mon Jul 24 12:51:13 2006 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Mon, 24 Jul 2006 05:51:13 -0700 Subject: [Fedora-directory-commits] adminserver/lib/base nscputil.cpp, NONE, 1.1 Makefile, 1.7, 1.8 Message-ID: <200607241251.k6OCpDwd008887@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/adminserver/lib/base In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv8870 Modified Files: Makefile Added Files: nscputil.cpp Log Message: renamed util.cpp to nscputil.cpp to avoid object/file naming conflict in autoconf builds --- NEW FILE nscputil.cpp --- /** BEGIN COPYRIGHT BLOCK * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. * Copyright (C) 2005 Red Hat, Inc. * All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * END COPYRIGHT BLOCK **/ /* * util.c: A hodge podge of utility functions and standard functions which * are unavailable on certain systems * * Rob McCool */ #include #include #include #include #include #ifdef XP_UNIX #include #include #include #include "prthread.h" #endif /* XP_UNIX */ #include "base/util.h" #include "base/dbtbase.h" #ifdef XP_UNIX #include #endif /* WIN32 */ #ifdef XP_WIN32 #define VC_EXTRALEAN // Exclude rarely-used stuff from afxwin.h #include // MFC core and standard components` #include #endif #ifdef _WIN32 static char *win_char_converter(const char *instr, int bFromUTF8); #else #include #endif #ifndef _WIN32 #include #include /* for nl_langinfo() */ #endif #if defined(_HPUX_SOURCE) #define UTIL_CHARSET_UTF8 "utf8" /* HP/UX */ #else #define UTIL_CHARSET_UTF8 "UTF-8" /* all others */ #endif #if defined(_HPUX_SOURCE) #define UTIL_CHARSET_DEFAULT "roma8" /* HP/UX */ #elif defined(__GLIBC__) #define UTIL_CHARSET_DEFAULT "US-ASCII" /* glibc, e.g. Linux */ #else #define UTIL_CHARSET_DEFAULT "646" /* all others */ #endif #ifdef __cplusplus extern "C" { #endif static char *convertor( const char *src, int fromUtf8 ); #ifndef _WIN32 static const char *GetCurrentCharset(void); #endif #ifdef __cplusplus } #endif /* ----------------------------- util_getline ----------------------------- */ #define LF 10 #define CR 13 NSAPI_PUBLIC int util_getline(filebuf_t *buf, int lineno, int maxlen, char *l) { int i, x; x = 0; while(1) { switch(i = (int)filebuf_getc(buf)) { case IO_EOF: l[x] = '\0'; return 1; case LF: if(x && (l[x-1] == '\\')) { --x; continue; } l[x] = '\0'; return 0; case IO_ERROR: util_sprintf(l, "I/O error reading file at line %d", lineno); return -1; case CR: continue; default: l[x] = (char) i; if(++x == maxlen) { util_sprintf(l, "line %d is too long", lineno); return -1; } break; } } } /* ---------------------------- util_can_exec ----------------------------- */ #ifdef XP_UNIX NSAPI_PUBLIC int util_can_exec(struct stat *fi, uid_t uid, gid_t gid) { if(!uid) return 1; if((fi->st_mode & S_IXOTH) || ((gid == fi->st_gid) && (fi->st_mode & S_IXGRP)) || ((uid == fi->st_uid) && (fi->st_mode & S_IXUSR))) return 1; return 0; } #endif /* XP_UNIX */ /* --------------------------- util_env_create ---------------------------- */ NSAPI_PUBLIC char **util_env_create(char **env, int n, int *pos) { int x; if(!env) { *pos = 0; return (char **) MALLOC((n + 1)*sizeof(char *)); } else { for(x = 0; (env[x]); x++); env = (char **) REALLOC(env, (n + x + 1)*(sizeof(char *))); *pos = x; return env; } } /* ---------------------------- util_env_free ----------------------------- */ NSAPI_PUBLIC void util_env_free(char **env) { register char **ep = env; for(ep = env; *ep; ep++) FREE(*ep); FREE(env); } /* ----------------------------- util_env_str ----------------------------- */ NSAPI_PUBLIC char *util_env_str(char *name, char *value) { char *t,*tp; t = (char *) MALLOC(strlen(name)+strlen(value)+2); /* 2: '=' and '\0' */ for(tp=t; (*tp = *name); tp++,name++); for(*tp++ = '='; (*tp = *value); tp++,value++); return t; } /* --------------------------- util_env_replace --------------------------- */ NSAPI_PUBLIC void util_env_replace(char **env, char *name, char *value) { int x, y, z; char *i; for(x = 0; env[x]; x++) { i = strchr(env[x], '='); *i = '\0'; if(!strcmp(env[x], name)) { y = strlen(env[x]); z = strlen(value); env[x] = (char *) REALLOC(env[x], y + z + 2); util_sprintf(&env[x][y], "=%s", value); return; } *i = '='; } } /* ---------------------------- util_env_find ----------------------------- */ NSAPI_PUBLIC char *util_env_find(char **env, char *name) { char *i; int x, r; for(x = 0; env[x]; x++) { i = strchr(env[x], '='); *i = '\0'; r = !strcmp(env[x], name); *i = '='; if(r) return i + 1; } return NULL; } /* ---------------------------- util_env_copy ----------------------------- */ NSAPI_PUBLIC char **util_env_copy(char **src, char **dst) { char **src_ptr; int src_cnt; int index; if (!src) return NULL; for (src_cnt = 0, src_ptr = src; *src_ptr; src_ptr++, src_cnt++); if (!src_cnt) return NULL; dst = util_env_create(dst, src_cnt, &index); for (src_ptr = src, index=0; *src_ptr; index++, src_ptr++) dst[index] = STRDUP(*src_ptr); dst[index] = NULL; return dst; } /* ---------------------------- util_hostname ----------------------------- */ /* * MOVED TO NET.C TO AVOID INTERDEPENDENCIES */ /* --------------------------- util_chdir2path ---------------------------- */ NSAPI_PUBLIC int util_chdir2path(char *path) { /* use FILE_PATHSEP to accomodate WIN32 */ char *t = strrchr(path, FILE_PATHSEP); int ret; if(!t) return -1; *t = '\0'; #ifdef XP_UNIX ret = chdir(path); #else /* WIN32 */ ret = SetCurrentDirectory(path); #endif /* XP_UNIX */ /* use FILE_PATHSEP instead of chdir to accomodate WIN32 */ *t = FILE_PATHSEP; return ret; } /* --------------------------- util_is_mozilla ---------------------------- */ NSAPI_PUBLIC int util_is_mozilla(char *ua, char *major, char *minor) { if((!ua) || strncasecmp(ua, "Mozilla/", 8)) return 0; /* Major version. I punted on supporting versions like 10.0 */ if(ua[8] > major[0]) return 1; else if((ua[8] < major[0]) || (ua[9] != '.')) return 0; /* Minor version. Support version numbers like 0.96 */ if(ua[10] < minor[0]) return 0; else if((ua[10] > minor[0]) || (!minor[1])) return 1; if((!isdigit(ua[11])) || (ua[11] < minor[1])) return 0; else return 1; } /* ----------------------------- util_is_url ------------------------------ */ #include /* isalpha */ NSAPI_PUBLIC int util_is_url(char *url) { char *t = url; while(*t) { if(*t == ':') return 1; if(!isalpha(*t)) return 0; ++t; } return 0; } /* --------------------------- util_later_than ---------------------------- */ int _mstr2num(char *str) { if(!strcasecmp(str, "Jan")) return 0; if(!strcasecmp(str, "Feb")) return 1; if(!strcasecmp(str, "Mar")) return 2; if(!strcasecmp(str, "Apr")) return 3; if(!strcasecmp(str, "May")) return 4; if(!strcasecmp(str, "Jun")) return 5; if(!strcasecmp(str, "Jul")) return 6; if(!strcasecmp(str, "Aug")) return 7; if(!strcasecmp(str, "Sep")) return 8; if(!strcasecmp(str, "Oct")) return 9; if(!strcasecmp(str, "Nov")) return 10; if(!strcasecmp(str, "Dec")) return 11; return -1; } int _time_compare(struct tm *lms, char *ims, int later_than_op) { int y = 0, mnum = 0, d = 0, h = 0, m = 0, s = 0, x; char t[128]; /* Supported formats start with weekday (which we don't care about) */ /* The sizeof(t) is to avoid buffer overflow with t */ if((!(ims = strchr(ims,' '))) || (strlen(ims) > (sizeof(t) - 2))) return 0; while(*ims && isspace(*ims)) ++ims; if((!(*ims)) || (strlen(ims) < 2)) return 0; /* Standard HTTP (RFC 850) starts with dd-mon-yy */ if(ims[2] == '-') { /* Warning - hardcoded 128 is sizeof(t) - scanf is not security conscious */ sscanf(ims, "%128s %d:%d:%d", t, &h, &m, &s); t[sizeof(t)-1] = 0; if(strlen(t) < 6) return 0; t[2] = '\0'; t[6] = '\0'; d = atoi(t); mnum = _mstr2num(&t[3]); x = atoi(&t[7]); /* Postpone wraparound until 2070 */ y = x + (x < 70 ? 2000 : 1900); } /* The ctime format starts with a month name */ else if(isalpha(*ims)) { /* Warning - hardcoded 128 is sizeof(t) - scanf is not security conscious */ sscanf(ims,"%128s %d %d:%d:%d %*s %d", t, &d, &h, &m, &s, &y); t[sizeof(t)-1] = 0; mnum = _mstr2num(t); } /* RFC 822 */ else { /* Warning - hardcoded 128 is sizeof(t) - scanf is not security conscious */ sscanf(ims, "%d %128s %d %d:%d:%d", &d, t, &y, &h, &m, &s); t[sizeof(t)-1] = 0; mnum = _mstr2num(t); } if (later_than_op) { if( (x = (1900 + lms->tm_year) - y) ) return x < 0; if(mnum == -1) return 0; /* XXXMB - this will fail if you check if december 31 1996 is later * than january 1 1997 */ if((x = lms->tm_mon - mnum) || (x = lms->tm_mday - d) || (x = lms->tm_hour - h) || (x = lms->tm_min - m) || (x = lms->tm_sec - s)) return x < 0; return 1; } else { return (mnum != -1 && 1900 + lms->tm_year == y && lms->tm_mon == mnum && lms->tm_mday == d && lms->tm_hour == h && lms->tm_min == m && lms->tm_sec == s); } } /* Returns 0 if lms later than ims * Returns 1 if equal * Returns 1 if ims later than lms */ NSAPI_PUBLIC int util_later_than(struct tm *lms, char *ims) { return _time_compare(lms, ims, 1); } NSAPI_PUBLIC int util_time_equal(struct tm *lms, char *ims) { return _time_compare(lms, ims, 0); } /* util_str_time_equal() * * Function to compare if two time strings are equal * * Acceptible date formats: * Saturday, 17-Feb-96 19:41:34 GMT * Sat, 17 Mar 1996 19:41:34 GMT * * Argument t1 MUST be RFC1123 format. * * Note- it is not the intention of this routine to *always* match * There are cases where we would return != when the strings might * be equal (especially with case). The converse should not be true. * * Return 0 if equal, -1 if not equal. */ #define MINIMUM_LENGTH 18 #define RFC1123_DAY 5 #define RFC1123_MONTH 8 #define RFC1123_YEAR 12 #define RFC1123_HOUR 17 #define RFC1123_MINUTE 20 #define RFC1123_SECOND 23 NSAPI_PUBLIC int util_str_time_equal(char *t1, char *t2) { int index; /* skip over leading whitespace... */ while(*t1 && isspace(*t1)) ++t1; while(*t2 && isspace(*t2)) ++t2; /* Check weekday */ if ( (t1[0] != t2[0]) || (t1[1] != t2[1]) ) return -1; /* Skip to date */ while(*t2 && !isspace(*t2)) ++t2; t2++; /* skip if not strings not long enough */ if ( (strlen(t1) < MINIMUM_LENGTH) || (strlen(t2) < MINIMUM_LENGTH) ) return -1; if ( (t1[RFC1123_DAY] != t2[0]) || (t1[RFC1123_DAY+1] != t2[1]) ) return -1; /* Skip to the month */ t2 += 3; if ( (t1[RFC1123_MONTH] != t2[0]) || (t1[RFC1123_MONTH+1] != t2[1]) || (t1[RFC1123_MONTH+2] != t2[2]) ) return -1; /* Skip to year */ t2 += 4; if ( (t1[RFC1123_YEAR] != t2[0]) ) { /* Assume t2 is RFC 850 format */ if ( (t1[RFC1123_YEAR+2] != t2[0]) || (t1[RFC1123_YEAR+3] != t2[1]) ) return -1; /* skip to hour */ t2 += 3; } else { /* Assume t2 is RFC 1123 format */ if ( (t1[RFC1123_YEAR+1] != t2[1]) || (t1[RFC1123_YEAR+2] != t2[2]) || (t1[RFC1123_YEAR+3] != t2[3]) ) return -1; /* skip to hour */ t2 += 5; } /* check date */ for (index=0; index<8; index++) { if ( t1[RFC1123_HOUR+index] != t2[index] ) return -1; } /* Ignore timezone */ return 0; } /* --------------------------- util_uri_is_evil --------------------------- */ NSAPI_PUBLIC int util_uri_is_evil(char *t) { register int x; for(x = 0; t[x]; ++x) { if(t[x] == '/') { if(t[x+1] == '/') return 1; if(t[x+1] == '.') { switch(t[x+2]) { case '.': if((!t[x+3]) || (t[x+3] == '/')) return 1; case '/': case '\0': return 1; } } } #ifdef XP_WIN32 /* On NT, the directory "abc...." is the same as "abc" * The only cheap way to catch this globally is to disallow * names with the trailing "."s. Hopefully this is not over * restrictive */ if ((t[x] == '.') && ( (t[x+1] == '/') || (t[x+1] == '\0') )) { return 1; } #endif } return 0; } /* ---------------------------- util_uri_parse ---------------------------- */ NSAPI_PUBLIC void util_uri_parse(char *uri) { int spos = 0, tpos = 0; int l = strlen(uri); while(uri[spos]) { if(uri[spos] == '/') { if((spos != l) && (uri[spos+1] == '.')) { if(uri[spos+2] == '/') spos += 2; else if((spos <= (l-3)) && (uri[spos+2] == '.') && (uri[spos+3] == '/')) { spos += 3; while((tpos > 0) && (uri[--tpos] != '/')) uri[tpos] = '\0'; } else uri[tpos++] = uri[spos++]; } else { if(uri[spos+1] != '/') uri[tpos++] = uri[spos++]; else spos++; } } else uri[tpos++] = uri[spos++]; } uri[tpos] = '\0'; } /* -------------------- util_uri_unescape_and_normalize -------------------- */ #ifdef XP_WIN32 /* The server calls this function to unescape the URI and also normalize * the uri. Normalizing the uri converts all "\" characters in the URI * and pathinfo portion to "/". Does not touch "\" in query strings. */ void util_uri_unescape_and_normalize(char *s) { char *t, *u; for(t = s, u = s; *t; ++t, ++u) { if((*t == '%') && t[1] && t[2]) { *u = ((t[1] >= 'A' ? ((t[1] & 0xdf) - 'A')+10 : (t[1] - '0'))*16) + (t[2] >= 'A' ? ((t[2] & 0xdf) - 'A')+10 : (t[2] - '0')); t += 2; } else if(u != t) *u = *t; if (*u == '\\') /* normalize */ *u = '/'; } *u = *t; } #endif /* XP_WIN32 */ /* -------------------------- util_uri_unescape --------------------------- */ NSAPI_PUBLIC void util_uri_unescape(char *s) { char *t, *u; for(t = s, u = s; *t; ++t, ++u) { if((*t == '%') && t[1] && t[2]) { *u = ((t[1] >= 'A' ? ((t[1] & 0xdf) - 'A')+10 : (t[1] - '0'))*16) + (t[2] >= 'A' ? ((t[2] & 0xdf) - 'A')+10 : (t[2] - '0')); t += 2; } else if(u != t) *u = *t; } *u = *t; } /* --------------------------- util_uri_escape ---------------------------- */ NSAPI_PUBLIC char *util_uri_escape(char *od, char *s) { char *d; if(!od) od = (char *) MALLOC((strlen(s)*3) + 1); d = od; while(*s) { if(strchr("% ?#:+&*\"<>\r\n", *s)) { sprintf(d, "%%%2x", *s); ++s; d += 3; } else *d++ = *s++; } *d = '\0'; return od; } /* --------------------------- util_url_escape ---------------------------- */ NSAPI_PUBLIC char *util_url_escape(char *od, char *s) { char *d; if(!od) od = (char *) MALLOC((strlen(s)*3) + 1); d = od; while(*s) { if(strchr("% +*\"<>\r\n", *s)) { sprintf(d, "%%%.2x", *s); ++s; d += 3; } else *d++ = *s++; } *d = '\0'; return od; } /* ------------------------- util_mime_separator -------------------------- */ NSAPI_PUBLIC int util_mime_separator(char *sep) { srand(time(NULL)); return util_sprintf(sep, "%c%c--%d%d%d", CR, LF, rand(), rand(), rand()); } /* ------------------------------ util_itoa ------------------------------- */ /* * Assumption: Reversing the digits will be faster in the general case * than doing a log10 or some nasty trick to find the # of digits. */ NSAPI_PUBLIC int util_itoa(int i, char *a) { register int x, y, p; register char c; int negative; negative = 0; if(i < 0) { *a++ = '-'; negative = 1; i = -i; } p = 0; while(i > 9) { a[p++] = (i%10) + '0'; i /= 10; } a[p++] = i + '0'; if(p > 1) { for(x = 0, y = p - 1; x < y; ++x, --y) { c = a[x]; a[x] = a[y]; a[y] = c; } } a[p] = '\0'; return p + negative; } /* ----------------------------- util_sprintf ----------------------------- */ #include "prprf.h" /* XXXrobm the NSPR interfaces don't allow me to just pass in a buffer without a size */ #define UTIL_PRF_MAXSIZE 1048576 NSAPI_PUBLIC int util_vsnprintf(char *s, int n, register const char *fmt, va_list args) { return PR_vsnprintf(s, n, fmt, args); } NSAPI_PUBLIC int util_snprintf(char *s, int n, const char *fmt, ...) { va_list args; va_start(args, fmt); return PR_vsnprintf(s, n, fmt, args); } NSAPI_PUBLIC int util_vsprintf(char *s, register const char *fmt, va_list args) { return PR_vsnprintf(s, UTIL_PRF_MAXSIZE, fmt, args); } NSAPI_PUBLIC int util_sprintf(char *s, const char *fmt, ...) { va_list args; va_start(args, fmt); return PR_vsnprintf(s, UTIL_PRF_MAXSIZE, fmt, args); } /* ---------------------------- util_sh_escape ---------------------------- */ NSAPI_PUBLIC char *util_sh_escape(char *s) { char *ns = (char *) MALLOC(strlen(s) * 2 + 1); /* worst case */ register char *t, *u; for(t = s, u = ns; *t; ++t, ++u) { if(strchr("&;`'\"|*?~<>^()[]{}$\\ #!", *t)) *u++ = '\\'; *u = *t; } *u = '\0'; return ns; } /* --------------------------- util_strcasecmp ---------------------------- */ #ifdef NEED_STRCASECMP /* These are stolen from mcom/lib/xp */ NSAPI_PUBLIC int util_strcasecmp(CASECMPARG_T char *one, CASECMPARG_T char *two) { CASECMPARG_T char *pA; CASECMPARG_T char *pB; for(pA=one, pB=two; *pA && *pB; pA++, pB++) { int tmp = tolower(*pA) - tolower(*pB); if (tmp) return tmp; } if (*pA) return 1; if (*pB) return -1; return 0; } #endif /* NEED_STRCASECMP */ #ifdef NEED_STRNCASECMP NSAPI_PUBLIC int util_strncasecmp(CASECMPARG_T char *one, CASECMPARG_T char *two, int n) { CASECMPARG_T char *pA; CASECMPARG_T char *pB; for(pA=one, pB=two;; pA++, pB++) { int tmp; if (pA == one+n) return 0; if (!(*pA && *pB)) return *pA - *pB; tmp = tolower(*pA) - tolower(*pB); if (tmp) return tmp; } } #endif /* NEED_STRNCASECMP */ #ifdef XP_WIN32 /* util_delete_directory() * This routine deletes all the files in a directory. If delete_directory is * TRUE it will also delete the directory itself. */ VOID util_delete_directory(char *FileName, BOOL delete_directory) { HANDLE firstFile; WIN32_FIND_DATA findData; char *TmpFile, *NewFile; if (FileName == NULL) return; TmpFile = (char *)MALLOC(strlen(FileName) + 5); sprintf(TmpFile, "%s\\*.*", FileName); firstFile = FindFirstFile(TmpFile, &findData); FREE(TmpFile); if (firstFile == INVALID_HANDLE_VALUE) return; if(strcmp(findData.cFileName, ".") && strcmp(findData.cFileName, "..")) { NewFile = (char *)MALLOC(strlen(FileName) + 1 + strlen(findData.cFileName) + 1); sprintf(NewFile, "%s\\%s",FileName, findData.cFileName); DeleteFile(NewFile); FREE(NewFile); } while (TRUE) { if(!(FindNextFile(firstFile, &findData))) { if (GetLastError() != ERROR_NO_MORE_FILES) { // ereport(LOG_WARN, XP_GetAdminStr(DBT_couldNotRemoveTemporaryDirectory_), FileName, GetLastError()); } else { FindClose(firstFile); if (delete_directory) if(!RemoveDirectory(FileName)) { // ereport(LOG_WARN, XP_GetAdminStr(DBT_couldNotRemoveTemporaryDirectory_1), FileName, GetLastError()); } return; } } else { if(strcmp(findData.cFileName, ".") && strcmp(findData.cFileName, "..")) { NewFile = (char *)MALLOC(strlen(FileName) + 5 + strlen(findData.cFileName) + 1); sprintf(NewFile,"%s\\%s", FileName, findData.cFileName); DeleteFile(NewFile); FREE(NewFile); } } } } #endif /* ------------------------------ util_strftime --------------------------- */ /* * Copyright (c) 1989 The Regents of the University of California. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)strftime.c 5.11 (Berkeley) 2/24/91"; #endif /* LIBC_SCCS and not lint */ #ifdef XP_UNIX #include #include #include #include #endif static char *afmt[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", }; static char *Afmt[] = { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", }; static char *bfmt[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", }; static char *Bfmt[] = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", }; #define TM_YEAR_BASE 1900 static void _util_strftime_conv(char *, int, int, char); #define _util_strftime_add(str) for (;(*pt = *str++); pt++); #define _util_strftime_copy(str, len) memcpy(pt, str, len); pt += len; #define _util_strftime_fmt util_strftime /* util_strftime() * This is an optimized version of strftime for speed. Avoids the thread * unsafeness of BSD strftime calls. */ int util_strftime(char *pt, const char *format, const struct tm *t) { char *start = pt; char *scrap; for (; *format; ++format) { if (*format == '%') switch(*++format) { case 'a': /* abbreviated weekday name */ *pt++ = afmt[t->tm_wday][0]; *pt++ = afmt[t->tm_wday][1]; *pt++ = afmt[t->tm_wday][2]; continue; case 'd': /* day of month */ _util_strftime_conv(pt, t->tm_mday, 2, '0'); pt += 2; continue; case 'S': _util_strftime_conv(pt, t->tm_sec, 2, '0'); pt += 2; continue; case 'M': _util_strftime_conv(pt, t->tm_min, 2, '0'); pt += 2; continue; case 'H': _util_strftime_conv(pt, t->tm_hour, 2, '0'); pt += 2; continue; case 'Y': if (t->tm_year < 100) { *pt++ = '1'; *pt++ = '9'; _util_strftime_conv(pt, t->tm_year, 2, '0'); } else { /* will fail after 2100; but who cares? */ *pt++ = '2'; *pt++ = '0'; _util_strftime_conv(pt, t->tm_year-100, 2, '0'); } pt += 2; continue; case 'b': /* abbreviated month name */ case 'h': *pt++ = bfmt[t->tm_mon][0]; *pt++ = bfmt[t->tm_mon][1]; *pt++ = bfmt[t->tm_mon][2]; continue; case 'T': case 'X': pt += _util_strftime_fmt(pt, "%H:%M:%S", t); continue; case '\0': --format; break; case 'A': if (t->tm_wday < 0 || t->tm_wday > 6) return(0); scrap = Afmt[t->tm_wday]; _util_strftime_add(scrap); continue; case 'B': if (t->tm_mon < 0 || t->tm_mon > 11) return(0); scrap = Bfmt[t->tm_mon]; _util_strftime_add(scrap); continue; case 'C': pt += _util_strftime_fmt(pt, "%a %b %e %H:%M:%S %Y", t); continue; case 'c': pt += _util_strftime_fmt(pt, "%m/%d/%y %H:%M:%S", t); continue; case 'D': pt += _util_strftime_fmt(pt, "%m/%d/%y", t); continue; case 'e': _util_strftime_conv(pt, t->tm_mday, 2, ' '); pt += 2; continue; case 'I': _util_strftime_conv(pt, t->tm_hour % 12 ? t->tm_hour % 12 : 12, 2, '0'); pt += 2; continue; case 'j': _util_strftime_conv(pt, t->tm_yday + 1, 3, '0'); pt += 3; continue; case 'k': _util_strftime_conv(pt, t->tm_hour, 2, ' '); pt += 2; continue; case 'l': _util_strftime_conv(pt, t->tm_hour % 12 ? t->tm_hour % 12 : 12, 2, ' '); pt += 2; continue; case 'm': _util_strftime_conv(pt, t->tm_mon + 1, 2, '0'); pt += 2; continue; case 'n': *pt = '\n'; pt++; continue; case 'p': if (t->tm_hour >= 12) { *pt = 'P'; pt++; } else { *pt = 'A'; pt++; } *pt = 'M'; pt++; continue; case 'R': pt += _util_strftime_fmt(pt, "%H:%M", t); continue; case 'r': pt += _util_strftime_fmt(pt, "%I:%M:%S %p", t); continue; case 't': *pt = '\t'; pt++; continue; case 'U': _util_strftime_conv(pt, (t->tm_yday + 7 - t->tm_wday) / 7, 2, '0'); pt += 2; continue; case 'W': _util_strftime_conv(pt, (t->tm_yday + 7 - (t->tm_wday ? (t->tm_wday - 1) : 6)) / 7, 2, '0'); pt += 2; continue; case 'w': _util_strftime_conv(pt, t->tm_wday, 1, '0'); pt += 1; continue; case 'x': pt += _util_strftime_fmt(pt, "%m/%d/%y", t); continue; case 'y': _util_strftime_conv(pt, (t->tm_year + TM_YEAR_BASE) % 100, 2, '0'); pt += 2; continue; case '%': /* * X311J/88-090 (4.12.3.5): if conversion char is * undefined, behavior is undefined. Print out the * character itself as printf(3) does. */ default: break; } *pt = *format; pt++; } start[pt-start] = '\0'; return pt - start; } static void _util_strftime_conv(char *pt, int n, int digits, char pad) { static char buf[10]; register char *p; if (n >= 100) { p = buf + sizeof(buf)-2; for (; n > 0 && p > buf; n /= 10, --digits) *p-- = n % 10 + '0'; while (p > buf && digits-- > 0) *p-- = pad; p++; _util_strftime_add(p); } else { int tens; int ones = n; tens = 0; if ( ones >= 10 ) { while ( ones >= 10 ) { tens++; ones = ones - 10; } *pt++ = '0'+tens; digits--; } else *pt++ = '0'; *pt++ = '0'+ones; digits--; while(digits--) *pt++ = pad; } return; } #ifdef XP_UNIX /* * Local Thread Safe version of waitpid. This prevents the process * from blocking in the system call. */ NSAPI_PUBLIC pid_t util_waitpid(pid_t pid, int *statptr, int options) { pid_t rv; for(rv = 0; !rv; PR_Sleep(500)) { rv = waitpid(pid, statptr, options | WNOHANG); if (rv == -1) { if (errno == EINTR) rv = 0; /* sleep and try again */ else // ereport(LOG_WARN, "waitpid failed for pid %d:%s", pid, system_errmsg()); ; } } return rv; } #endif /* * Various reentrant routines by mikep. See util.h and systems.h */ /* * These are only necessary if we turn on interrupts in NSPR */ #ifdef NEED_RELOCKS #include "crit.h" #define RE_LOCK(name) \ static CRITICAL name##_crit = 0; \ if (name##_crit == 0) name##_crit = crit_init(); \ crit_enter(name##_crit) #define RE_UNLOCK(name) crit_exit(name##_crit) #else #define RE_LOCK(name) /* nada */ #define RE_UNLOCK(name) /* nil */ #endif NSAPI_PUBLIC char * util_strtok(register char *s, register const char *delim, register char **lasts) { #ifdef HAVE_STRTOK_R return strtok_r(s, delim, lasts); #else /* * THIS IS THE THREAD SAFE VERSION OF strtok captured from * public NetBSD. Note that no locks are needed */ register char *spanp; register int c, sc; char *tok; if (s == NULL && (s = *lasts) == NULL) return (NULL); /* * Skip (span) leading delimiters (s += strspn(s, delim), * sort of). */ cont: c = *s++; for (spanp = (char *)delim; (sc = *spanp++) != 0;) { if (c == sc) goto cont; } if (c == 0) { /* no non-delimiter characters */ *lasts = NULL; return (NULL); } tok = s - 1; /* * Scan token (scan for delimiters: s += strcspn(s, delim), * sort of). * Note that delim must have one NUL; we stop if we see that, too. */ for (;;) { c = *s++; spanp = (char *)delim; do { if ((sc = *spanp++) == c) { if (c == 0) s = NULL; else s[-1] = 0; *lasts = s; return (tok); } } while (sc != 0); } /* NOTREACHED */ #endif /* no strtok_r */ } #ifndef XP_WIN32 NSAPI_PUBLIC struct passwd * util_getpwnam(const char *name, struct passwd *result, char *buffer, int buflen) { #ifdef HAVE_PW_R #ifdef AIX #ifdef AIX4_3 return ((int)getpwnam_r(name, result, buffer, buflen, &result) == 0 ? result : NULL); #else return ((int)getpwnam_r(name, result, buffer, buflen) == 0 ? result : NULL); #endif #else return getpwnam_r(name, result, buffer, buflen); #endif /* AIX */ #else char *lastp; struct passwd *r; RE_LOCK(pw); r = getpwnam(name); if (!r) return r; result->pw_gid = r->pw_gid; result->pw_uid = r->pw_uid; /* Hope this buffer is long enough */ if (buffer) util_snprintf(buffer, buflen, "%s:%s:%d:%d:%s:%s:%s", r->pw_name, r->pw_passwd, r->pw_uid, r->pw_gid, r->pw_gecos, r->pw_dir, r->pw_shell); RE_UNLOCK(pw); result->pw_name = util_strtok(buffer, ":", &lastp); result->pw_passwd = util_strtok(NULL, ":", &lastp); (void) util_strtok(NULL, ":", &lastp); (void) util_strtok(NULL, ":", &lastp); result->pw_gecos = util_strtok(NULL, ":", &lastp); result->pw_dir = util_strtok(NULL, ":", &lastp); result->pw_shell = util_strtok(NULL, ":", &lastp); return result; #endif } #endif NSAPI_PUBLIC struct tm * util_localtime(const time_t *clock, struct tm *res) { #ifdef HAVE_TIME_R return localtime_r(clock, res); #else struct tm *rv; time_t zero = 0x7fffffff; RE_LOCK(localtime); RE_UNLOCK(localtime); rv = localtime(clock); if (!rv) rv = localtime(&zero); if (rv) *res = *rv; else return NULL; return res; #endif } NSAPI_PUBLIC char * util_ctime(const time_t *clock, char *buf, int buflen) { /* * From cgi-src/restore.c refering to XP_WIN32: * MLM - gross, but it works, better now FLC */ #if !defined(HAVE_TIME_R) || defined(XP_WIN32) RE_LOCK(ctime); strncpy(buf, ctime(clock), buflen); buf[buflen - 1] = '\0'; RE_UNLOCK(ctime); return buf; #elif HAVE_TIME_R == 2 return ctime_r(clock, buf); #else /* HAVE_TIME_R == 3 */ return ctime_r(clock, buf, buflen); #endif } NSAPI_PUBLIC struct tm * util_gmtime(const time_t *clock, struct tm *res) { #ifdef HAVE_TIME_R return gmtime_r(clock, res); #else struct tm *rv; time_t zero = 0x7fffffff; RE_LOCK(gmtime); rv = gmtime(clock); RE_UNLOCK(gmtime); if (!rv) rv = gmtime(&zero); if (rv) *res = *rv; else return NULL; return res; #endif } NSAPI_PUBLIC char * util_asctime(const struct tm *tm, char *buf, int buflen) { #if HAVE_TIME_R == 2 return asctime_r(tm, buf); #elif HAVE_TIME_R == 3 return asctime_r(tm, buf, buflen); #else RE_LOCK(asctime); strncpy(buf, asctime(tm), buflen); buf[buflen - 1] = '\0'; RE_UNLOCK(asctime); return buf; #endif } NSAPI_PUBLIC char * util_strerror(int errnum, char *msg, int buflen) { #ifdef HAVE_STRERROR_R /* More IBM real-genius */ return ((int)strerror_r(errnum, msg, buflen) > 0) ? msg : NULL; #else /* RE_LOCK(strerror); I don't think this is worth the trouble */ (void)strncpy(msg, strerror(errnum), buflen); msg[buflen - 1] = '\0'; return msg; /* RE_UNLOCK(strerror); */ #endif } /* returns a malloc'd string */ static const char * GetCurrentCharset(void) { static char *locale = NULL; const char *charset; if ( NULL == locale ) { locale = setlocale(LC_CTYPE, ""); /* need to call this once */ } charset = nl_langinfo( CODESET ); if ( NULL == charset || '\0' == *charset ) { charset = UTIL_CHARSET_DEFAULT; } return strdup( charset ); } #ifdef _WIN32 static char * convertor( const char *src, int fromUtf8 ) { return win_char_converter( src, fromUtf8 ); } #else /* _WIN32 */ static char * convertor( const char *src, int fromUtf8 ) { const char *src_charset = NULL; iconv_t convdesc; char *outbuf, *curoutbuf; size_t inbytesleft, outbytesleft; src_charset = GetCurrentCharset(); if (0 == strcasecmp(src_charset, UTIL_CHARSET_UTF8)) { outbuf = strdup(src); if ( NULL == outbuf ) { perror( "convert_to_utf8 - strdup" ); } return outbuf; } /* Get a converter */ if (fromUtf8) { convdesc = iconv_open( src_charset, UTIL_CHARSET_UTF8 ); } else { convdesc = iconv_open( UTIL_CHARSET_UTF8, src_charset ); } if ( (iconv_t)-1 == convdesc ) { if ( errno == EINVAL ) { fprintf( stderr, "%s: conversion from %s to %s is not supported\n", "convertor", src_charset, UTIL_CHARSET_UTF8 ); } else { perror( src_charset ); } return NULL; } /* Allocate room for the UTF-8 equivalent (maximum expansion = 6 times) */ /* XXX is that correct? */ inbytesleft = strlen( src ); outbytesleft = 6 * inbytesleft + 1; if ( NULL == ( outbuf = (char *)malloc( outbytesleft ))) { perror( "convert_to_utf8 - malloc" ); iconv_close( convdesc ); return NULL; } curoutbuf = outbuf; /* * Three steps for a good conversion: * 1) Insert the initial shift sequence if any. * 2) Convert our characters. * 3) Insert the closing shift sequence, if any. */ if ( (size_t)-1 == iconv( convdesc, NULL, NULL, &curoutbuf, &outbytesleft ) /* initial shift seq. */ #ifdef LINUX || (size_t)-1 == iconv( convdesc, (char **)&src, &inbytesleft, &curoutbuf, &outbytesleft ) /* convert our chars. */ #else || (size_t)-1 == iconv( convdesc, &src, &inbytesleft, &curoutbuf, &outbytesleft ) /* convert our chars. */ #endif || (size_t)-1 == iconv( convdesc, NULL, NULL, &curoutbuf, &outbytesleft )) { /* closing shift seq. */ perror( "convert_to_utf8 - iconv" ); iconv_close( convdesc ); return NULL; } *curoutbuf = '\0'; /* zero-terminate the resulting string */ return outbuf; } #endif /* else _WIN32 */ #ifdef _WIN32 /* returns a malloc'd string */ static char * win_char_converter(const char *instr, int bFromUTF8) { char *outstr = NULL; int inlen, wclen, outlen; LPWSTR wcstr; if (instr == NULL) return NULL; if ((inlen = strlen(instr)) <= 0) return NULL; /* output never becomes longer than input, XXXmcs: really true? ** thus we don't have to ask for the length */ wcstr = (LPWSTR) malloc( sizeof( WCHAR ) * (inlen+1) ); if (!wcstr) return NULL; wclen = MultiByteToWideChar(bFromUTF8 ? CP_UTF8 : CP_ACP, 0, instr, inlen, wcstr, inlen); outlen = WideCharToMultiByte(bFromUTF8 ? CP_ACP : CP_UTF8, 0, wcstr, wclen, NULL, 0, NULL, NULL); if (outlen > 0) { outstr = (char *) malloc(outlen + 2); outlen = WideCharToMultiByte(bFromUTF8 ? CP_ACP : CP_UTF8, 0, wcstr, wclen, outstr, outlen, NULL, NULL); if (outlen > 0) *(outstr+outlen) = _T('\0'); else return NULL; } free( wcstr ); return outstr; } #endif /* _WIN32 */ #ifdef __cplusplus extern "C" { #endif NSAPI_PUBLIC char * util_local_to_utf8(const char *src) { char *utf8; if ( src == NULL ) { /* trivial case # 1 */ utf8 = NULL; } else if ( *src == '\0' ) { /* trivial case # 2 */ utf8 = strdup( "" ); } else { utf8 = convertor( src, 0 ); /* the real deal */ if ( utf8 == NULL ) { utf8 = strdup ( src ); } } return utf8; } #ifdef __cplusplus } #endif Index: Makefile =================================================================== RCS file: /cvs/dirsec/adminserver/lib/base/Makefile,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- Makefile 29 Sep 2005 22:12:04 -0000 1.7 +++ Makefile 24 Jul 2006 12:51:11 -0000 1.8 @@ -52,7 +52,7 @@ endif OBJS = $(addprefix $(OBJDEST)/, \ - util.o \ + nscputil.o \ file.o \ system.o \ nscperror.o \ From fedora-directory-commits at redhat.com Mon Jul 24 12:52:19 2006 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Mon, 24 Jul 2006 05:52:19 -0700 Subject: [Fedora-directory-commits] adminserver/lib/libadmin Makefile, 1.6, 1.7 Message-ID: <200607241252.k6OCqJYS008978@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/adminserver/lib/libadmin In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv8961 Modified Files: Makefile Log Message: removed admconf.c admserv.c pasword.c Index: Makefile =================================================================== RCS file: /cvs/dirsec/adminserver/lib/libadmin/Makefile,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- Makefile 29 Sep 2005 22:12:04 -0000 1.6 +++ Makefile 24 Jul 2006 12:52:17 -0000 1.7 @@ -36,10 +36,9 @@ LIBS=$(OBJDIR)/lib/libadmin.a endif -OBJS=$(addprefix $(OBJDEST)/, admconf.o error.o form_get.o \ - password.o template.o install.o \ +OBJS=$(addprefix $(OBJDEST)/, error.o form_get.o \ + template.o install.o \ referer.o util.o \ - admserv.o \ httpcon.o \ cluster.o \ $(OSOBJS)) From fedora-directory-commits at redhat.com Mon Jul 24 12:53:22 2006 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Mon, 24 Jul 2006 05:53:22 -0700 Subject: [Fedora-directory-commits] adminserver/admserv/html htmladmin.html, NONE, 1.1 monreplication.html, NONE, 1.1 viewdata.html, NONE, 1.1 viewlog.html, NONE, 1.1 Makefile, 1.6, 1.7 Message-ID: <200607241253.k6OCrMtX009010@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/adminserver/admserv/html In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv8989 Modified Files: Makefile Added Files: htmladmin.html monreplication.html viewdata.html viewlog.html Log Message: renamed the files from .h to .html - they are html files after all --- NEW FILE htmladmin.html ---
Fedora®
Administration Express

Help
--- NEW FILE monreplication.html ---

--- NEW FILE viewdata.html ---

Additional Information:

--- NEW FILE viewlog.html ---

Index: Makefile =================================================================== RCS file: /cvs/dirsec/adminserver/admserv/html/Makefile,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- Makefile 29 Sep 2005 22:11:59 -0000 1.6 +++ Makefile 24 Jul 2006 12:53:20 -0000 1.7 @@ -37,34 +37,22 @@ BINS=$(addprefix $(HTMLDEST)/,$(HTML)) -include $(BUILD_ROOT)/webint.mk - all: $(HTMLDEST) $(BINS) -# +$(LANG_LOOP) $(HTMLDEST): mkdir -p $(HTMLDEST) -$(HTMLDEST)/infonav.html: infonav.h - cp $< $@ - -$(HTMLDEST)/distacledit.html: distacledit.h - cp $< $@ - -$(HTMLDEST)/viewlog.html: viewlog.h +$(HTMLDEST)/viewlog.html: viewlog.html cp $< $@ -$(HTMLDEST)/viewdata.html: viewdata.h +$(HTMLDEST)/viewdata.html: viewdata.html cp $< $@ -$(HTMLDEST)/monreplication.html: monreplication.h +$(HTMLDEST)/monreplication.html: monreplication.html cp $< $@ -$(HTMLDEST)/htmladmin.html: htmladmin.h +$(HTMLDEST)/htmladmin.html: htmladmin.html cp $< $@ strip: depend: - -HTMLDEFS=-DPRODUCT_NAME=$(PRODUCT) -D$(ARCH) -DARCH=$(PRETTY_ARCH) - From fedora-directory-commits at redhat.com Mon Jul 24 13:04:41 2006 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Mon, 24 Jul 2006 06:04:41 -0700 Subject: [Fedora-directory-commits] adminserver/mcc Makefile, 1.9, NONE fixPI.pl, 1.3, NONE mcc.inf, 1.5, NONE Message-ID: <200607241304.k6OD4fK8011772@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/adminserver/mcc In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv11746 Removed Files: Makefile fixPI.pl mcc.inf Log Message: remove obsolete files --- Makefile DELETED --- --- fixPI.pl DELETED --- --- mcc.inf DELETED --- From fedora-directory-commits at redhat.com Mon Jul 24 13:04:41 2006 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Mon, 24 Jul 2006 06:04:41 -0700 Subject: [Fedora-directory-commits] adminserver/mcc/nt base.inf, 1.4, NONE fixPI.pl, 1.3, NONE makefile, 1.7, NONE Message-ID: <200607241304.k6OD4f1S011777@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/adminserver/mcc/nt In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv11746/nt Removed Files: base.inf fixPI.pl makefile Log Message: remove obsolete files --- base.inf DELETED --- --- fixPI.pl DELETED --- --- makefile DELETED --- From fedora-directory-commits at redhat.com Mon Jul 24 13:05:41 2006 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Mon, 24 Jul 2006 06:05:41 -0700 Subject: [Fedora-directory-commits] adminserver/mc-icons Makefile, 1.5, NONE admin-map-image.gif, 1.1.1.1, NONE back.gif, 1.1.1.1, NONE binary.gif, 1.1.1.1, NONE blank.gif, 1.1.1.1, NONE book-icon.gif, 1.1.1.1, NONE c.gif, 1.1.1.1, NONE down.gif, 1.1.1.1, NONE error.gif, 1.1.1.1, NONE full.gif, 1.1.1.1, NONE image.gif, 1.1.1.1, NONE info-icon.gif, 1.1.1.1, NONE install-map-image.gif, 1.1.1.1, NONE logo.gif, 1.1.1.1, NONE menu.gif, 1.1.1.1, NONE movie.gif, 1.1.1.1, NONE no.gif, 1.1.1.1, NONE restart.gif, 1.1.1.1, NONE secure-map-image.gif, 1.1.1.1, NONE soft.gif, 1.1.1.1, NONE sound.gif, 1.1.1.1, NONE text.gif, 1.1.1.1, NONE unknown.gif, 1.1.1.1, NONE welcome.gif, 1.1.1.1, NONE yes.gif, 1.1.1.1, NONE Message-ID: <200607241305.k6OD5fsR011826@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/adminserver/mc-icons In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv11811 Removed Files: Makefile admin-map-image.gif back.gif binary.gif blank.gif book-icon.gif c.gif down.gif error.gif full.gif image.gif info-icon.gif install-map-image.gif logo.gif menu.gif movie.gif no.gif restart.gif secure-map-image.gif soft.gif sound.gif text.gif unknown.gif welcome.gif yes.gif Log Message: remove obsolete files --- Makefile DELETED --- From fedora-directory-commits at redhat.com Mon Jul 24 13:09:25 2006 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Mon, 24 Jul 2006 06:09:25 -0700 Subject: [Fedora-directory-commits] adminserver/l10n/admserv/de ns-admin.txt, 1.2, NONE Message-ID: <200607241309.k6OD9P6v012030@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/adminserver/l10n/admserv/de In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12011/admserv/de Removed Files: ns-admin.txt Log Message: remove obsolete files --- ns-admin.txt DELETED --- From fedora-directory-commits at redhat.com Mon Jul 24 13:09:31 2006 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Mon, 24 Jul 2006 06:09:31 -0700 Subject: [Fedora-directory-commits] adminserver/l10n/admserv/en ns-admin.txt, 1.2, NONE Message-ID: <200607241309.k6OD9V15012079@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/adminserver/l10n/admserv/en In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12011/admserv/en Removed Files: ns-admin.txt Log Message: remove obsolete files --- ns-admin.txt DELETED --- From fedora-directory-commits at redhat.com Mon Jul 24 13:09:31 2006 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Mon, 24 Jul 2006 06:09:31 -0700 Subject: [Fedora-directory-commits] adminserver/l10n/admserv/fr ns-admin.txt, 1.2, NONE Message-ID: <200607241309.k6OD9VSg012095@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/adminserver/l10n/admserv/fr In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12011/admserv/fr Removed Files: ns-admin.txt Log Message: remove obsolete files --- ns-admin.txt DELETED --- From fedora-directory-commits at redhat.com Mon Jul 24 13:09:33 2006 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Mon, 24 Jul 2006 06:09:33 -0700 Subject: [Fedora-directory-commits] adminserver/l10n/httpd/de ns-httpd.txt, 1.1.1.1, NONE Message-ID: <200607241309.k6OD9XrW012118@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/adminserver/l10n/httpd/de In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12011/httpd/de Removed Files: ns-httpd.txt Log Message: remove obsolete files --- ns-httpd.txt DELETED --- From fedora-directory-commits at redhat.com Mon Jul 24 13:09:34 2006 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Mon, 24 Jul 2006 06:09:34 -0700 Subject: [Fedora-directory-commits] adminserver/l10n/httpd/fr ns-httpd.txt, 1.1.1.1, NONE Message-ID: <200607241309.k6OD9Y8L012126@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/adminserver/l10n/httpd/fr In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12011/httpd/fr Removed Files: ns-httpd.txt Log Message: remove obsolete files --- ns-httpd.txt DELETED --- From fedora-directory-commits at redhat.com Mon Jul 24 13:09:32 2006 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Mon, 24 Jul 2006 06:09:32 -0700 Subject: [Fedora-directory-commits] adminserver/l10n/admserv/ja ns-admin.txt, 1.2, NONE Message-ID: <200607241309.k6OD9WPB012111@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/adminserver/l10n/admserv/ja In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12011/admserv/ja Removed Files: ns-admin.txt Log Message: remove obsolete files --- ns-admin.txt DELETED --- From fedora-directory-commits at redhat.com Mon Jul 24 13:09:39 2006 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Mon, 24 Jul 2006 06:09:39 -0700 Subject: [Fedora-directory-commits] adminserver/l10n/httpd/ja ns-httpd.txt, 1.1.1.1, NONE Message-ID: <200607241309.k6OD9dAG012166@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/adminserver/l10n/httpd/ja In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12011/httpd/ja Removed Files: ns-httpd.txt Log Message: remove obsolete files --- ns-httpd.txt DELETED --- From fedora-directory-commits at redhat.com Mon Jul 24 13:09:33 2006 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Mon, 24 Jul 2006 06:09:33 -0700 Subject: [Fedora-directory-commits] adminserver/l10n/httpd/en ns-httpd.txt, 1.1.1.1, NONE Message-ID: <200607241309.k6OD9XYq012123@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/adminserver/l10n/httpd/en In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12011/httpd/en Removed Files: ns-httpd.txt Log Message: remove obsolete files --- ns-httpd.txt DELETED --- From fedora-directory-commits at redhat.com Mon Jul 24 13:12:36 2006 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Mon, 24 Jul 2006 06:12:36 -0700 Subject: [Fedora-directory-commits] adminserver/admserv/constart/nt Makefile, 1.5, NONE constart.aps, 1.1.1.1, NONE constart.clw, 1.2, NONE constart.cpp, 1.6, NONE constart.dsp, 1.3, NONE constart.dsw, 1.1.1.1, NONE constart.h, 1.4, NONE constart.ico, 1.1.1.1, NONE constart.mak, 1.4, NONE constart.mdp, 1.1.1.1, NONE constart.ncb, 1.1.1.1, NONE constart.opt, 1.1.1.1, NONE constart.rc, 1.3, NONE jre.inf, 1.1.1.1, NONE resource.h, 1.3, NONE stdafx.cpp, 1.3, NONE stdafx.h, 1.3, NONE Message-ID: <200607241312.k6ODCaqd012460@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/adminserver/admserv/constart/nt In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12439/nt Removed Files: Makefile constart.aps constart.clw constart.cpp constart.dsp constart.dsw constart.h constart.ico constart.mak constart.mdp constart.ncb constart.opt constart.rc jre.inf resource.h stdafx.cpp stdafx.h Log Message: remove obsolete files --- Makefile DELETED --- --- constart.aps DELETED --- --- constart.clw DELETED --- --- constart.cpp DELETED --- --- constart.dsp DELETED --- --- constart.dsw DELETED --- --- constart.h DELETED --- --- constart.ico DELETED --- --- constart.mak DELETED --- --- constart.mdp DELETED --- --- constart.ncb DELETED --- --- constart.opt DELETED --- --- constart.rc DELETED --- --- jre.inf DELETED --- --- resource.h DELETED --- --- stdafx.cpp DELETED --- --- stdafx.h DELETED --- From fedora-directory-commits at redhat.com Mon Jul 24 13:12:41 2006 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Mon, 24 Jul 2006 06:12:41 -0700 Subject: [Fedora-directory-commits] adminserver/admserv/constart/nt/res constart.ico, 1.1.1.1, NONE constart.rc2, 1.1.1.1, NONE Message-ID: <200607241312.k6ODCfva012481@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/adminserver/admserv/constart/nt/res In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12439/nt/res Removed Files: constart.ico constart.rc2 Log Message: remove obsolete files --- constart.ico DELETED --- --- constart.rc2 DELETED --- From fedora-directory-commits at redhat.com Mon Jul 24 13:15:21 2006 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Mon, 24 Jul 2006 06:15:21 -0700 Subject: [Fedora-directory-commits] adminserver/admserv/user-forms Makefile, 1.5, NONE Message-ID: <200607241315.k6ODFLah012611@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/adminserver/admserv/user-forms In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12574 Removed Files: Makefile Log Message: remove obsolete files --- Makefile DELETED --- From fedora-directory-commits at redhat.com Mon Jul 24 13:15:22 2006 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Mon, 24 Jul 2006 06:15:22 -0700 Subject: [Fedora-directory-commits] adminserver/admserv/user-forms/src Makefile, 1.5, NONE admlib.mk, 1.4, NONE dbtuserforms.h, 1.4, NONE dllglue.c, 1.3, NONE enduser.c, 1.5, NONE index.c, 1.4, NONE secglue.c, 1.3, NONE Message-ID: <200607241315.k6ODFMB4012619@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/adminserver/admserv/user-forms/src In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12574/src Removed Files: Makefile admlib.mk dbtuserforms.h dllglue.c enduser.c index.c secglue.c Log Message: remove obsolete files --- Makefile DELETED --- --- admlib.mk DELETED --- --- dbtuserforms.h DELETED --- --- dllglue.c DELETED --- --- enduser.c DELETED --- --- index.c DELETED --- --- secglue.c DELETED --- From fedora-directory-commits at redhat.com Mon Jul 24 13:15:21 2006 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Mon, 24 Jul 2006 06:15:21 -0700 Subject: [Fedora-directory-commits] adminserver/admserv/user-forms/html Makefile, 1.5, NONE index.h, 1.4, NONE index.lst, 1.2, NONE Message-ID: <200607241315.k6ODFLIr012616@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/adminserver/admserv/user-forms/html In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12574/html Removed Files: Makefile index.h index.lst Log Message: remove obsolete files --- Makefile DELETED --- --- index.h DELETED --- --- index.lst DELETED --- From fedora-directory-commits at redhat.com Mon Jul 24 13:18:17 2006 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Mon, 24 Jul 2006 06:18:17 -0700 Subject: [Fedora-directory-commits] adminserver/admserv/sdk40/console/customview SuperMailCustomView.java, 1.3, NONE build.bat, 1.2, NONE customview.ldif, 1.2, NONE Message-ID: <200607241318.k6ODIHOQ012892@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/adminserver/admserv/sdk40/console/customview In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12853/console/customview Removed Files: SuperMailCustomView.java build.bat customview.ldif Log Message: remove obsolete files --- SuperMailCustomView.java DELETED --- --- build.bat DELETED --- --- customview.ldif DELETED --- From fedora-directory-commits at redhat.com Mon Jul 24 13:18:18 2006 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Mon, 24 Jul 2006 06:18:18 -0700 Subject: [Fedora-directory-commits] adminserver/admserv/sdk40/doc test.txt, 1.1.1.1, NONE Message-ID: <200607241318.k6ODIIk7012902@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/adminserver/admserv/sdk40/doc In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12853/doc Removed Files: test.txt Log Message: remove obsolete files --- test.txt DELETED --- From fedora-directory-commits at redhat.com Mon Jul 24 13:18:13 2006 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Mon, 24 Jul 2006 06:18:13 -0700 Subject: [Fedora-directory-commits] adminserver/admserv/navstart/nt Makefile, 1.5, NONE navstart.c, 1.3, NONE navstart.ico, 1.1.1.1, NONE navstart.mak, 1.3, NONE navstart.rc, 1.3, NONE resource.h, 1.1.1.1, NONE Message-ID: <200607241318.k6ODIDw1012847@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/adminserver/admserv/navstart/nt In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12832/nt Removed Files: Makefile navstart.c navstart.ico navstart.mak navstart.rc resource.h Log Message: remove obsolete files --- Makefile DELETED --- --- navstart.c DELETED --- --- navstart.ico DELETED --- --- navstart.mak DELETED --- --- navstart.rc DELETED --- --- resource.h DELETED --- From fedora-directory-commits at redhat.com Mon Jul 24 13:18:17 2006 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Mon, 24 Jul 2006 06:18:17 -0700 Subject: [Fedora-directory-commits] adminserver/admserv/sdk40/console/topologyplugin Makefile, 1.5, NONE SuperMailTopologyPlugin.java, 1.3, NONE build.bat, 1.2, NONE topologyplugin.ldif, 1.2, NONE Message-ID: <200607241318.k6ODIHFQ012897@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/adminserver/admserv/sdk40/console/topologyplugin In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12853/console/topologyplugin Removed Files: Makefile SuperMailTopologyPlugin.java build.bat topologyplugin.ldif Log Message: remove obsolete files --- Makefile DELETED --- --- SuperMailTopologyPlugin.java DELETED --- --- build.bat DELETED --- --- topologyplugin.ldif DELETED --- From fedora-directory-commits at redhat.com Mon Jul 24 14:45:18 2006 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Mon, 24 Jul 2006 07:45:18 -0700 Subject: [Fedora-directory-commits] adminserver/admserv/console/smartupdate Makefile, 1.8, NONE adcon.gif, 1.1.1.1, NONE branding.jpg, 1.1.1.1, NONE cat.pl, 1.3, NONE cert7.db, 1.1.1.1, NONE d1.gif, 1.1.1.1, NONE download.gif, 1.1.1.1, NONE error.html, 1.3, NONE find.exe, 1.1.1.1, NONE install, 1.4, NONE install.html, 1.3, NONE key3.db, 1.1.1.1, NONE kingpin.gif, 1.1.1.1, NONE setbuildtime.pl, 1.3, NONE smup.gif, 1.1.1.1, NONE start.html, 1.6, NONE version.js, 1.2, NONE win32gnu.dll, 1.1.1.1, NONE Message-ID: <200607241445.k6OEjIbF016739@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/adminserver/admserv/console/smartupdate In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv16724 Removed Files: Makefile adcon.gif branding.jpg cat.pl cert7.db d1.gif download.gif error.html find.exe install install.html key3.db kingpin.gif setbuildtime.pl smup.gif start.html version.js win32gnu.dll Log Message: remove obsolete files --- Makefile DELETED --- --- cat.pl DELETED --- --- cert7.db DELETED --- --- error.html DELETED --- --- find.exe DELETED --- --- install DELETED --- --- install.html DELETED --- --- key3.db DELETED --- --- setbuildtime.pl DELETED --- --- start.html DELETED --- --- version.js DELETED --- --- win32gnu.dll DELETED --- From fedora-directory-commits at redhat.com Mon Jul 24 15:26:01 2006 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Mon, 24 Jul 2006 08:26:01 -0700 Subject: [Fedora-directory-commits] adminserver/admserv/viewurl/nt Makefile, 1.5, NONE resource.h, 1.1.1.1, NONE viewurl.c, 1.3, NONE viewurl.rc, 1.3, NONE Message-ID: <200607241526.k6OFQ1r6019692@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/adminserver/admserv/viewurl/nt In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv19677 Removed Files: Makefile resource.h viewurl.c viewurl.rc Log Message: remove obsolete files --- Makefile DELETED --- --- resource.h DELETED --- --- viewurl.c DELETED --- --- viewurl.rc DELETED --- From fedora-directory-commits at redhat.com Mon Jul 24 15:27:44 2006 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Mon, 24 Jul 2006 08:27:44 -0700 Subject: [Fedora-directory-commits] adminserver/admserv/schema/examples init.ldif, 1.4, NONE readme.txt, 1.1.1.1, NONE sie.ldif, 1.3, NONE Message-ID: <200607241527.k6OFRiib019741@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/adminserver/admserv/schema/examples In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv19726 Removed Files: init.ldif readme.txt sie.ldif Log Message: remove obsolete files --- init.ldif DELETED --- --- readme.txt DELETED --- --- sie.ldif DELETED --- From fedora-directory-commits at redhat.com Mon Jul 24 15:28:27 2006 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Mon, 24 Jul 2006 08:28:27 -0700 Subject: [Fedora-directory-commits] adminserver/admserv/schema/config Makefile, 1.5, NONE ns-admin-schema.conf, 1.3, NONE ns-common-schema.conf, 1.2, NONE ns-legacy-schema.conf, 1.2, NONE Message-ID: <200607241528.k6OFSRIl019774@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/adminserver/admserv/schema/config In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv19759 Removed Files: Makefile ns-admin-schema.conf ns-common-schema.conf ns-legacy-schema.conf Log Message: remove obsolete files --- Makefile DELETED --- --- ns-admin-schema.conf DELETED --- --- ns-common-schema.conf DELETED --- --- ns-legacy-schema.conf DELETED --- From fedora-directory-commits at redhat.com Mon Jul 24 15:30:08 2006 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Mon, 24 Jul 2006 08:30:08 -0700 Subject: [Fedora-directory-commits] adminserver/admserv/schema/ldif unixtasks.ldif, 1.6, NONE Message-ID: <200607241530.k6OFU8YL019811@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/adminserver/admserv/schema/ldif In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv19796 Removed Files: unixtasks.ldif Log Message: remove obsolete files --- unixtasks.ldif DELETED --- From fedora-directory-commits at redhat.com Mon Jul 24 15:30:15 2006 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Mon, 24 Jul 2006 08:30:15 -0700 Subject: [Fedora-directory-commits] adminserver/admserv/schema Makefile, 1.5, 1.6 Message-ID: <200607241530.k6OFUF6g019834@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/adminserver/admserv/schema In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv19817 Modified Files: Makefile Log Message: remove obsolete files Index: Makefile =================================================================== RCS file: /cvs/dirsec/adminserver/admserv/schema/Makefile,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- Makefile 29 Sep 2005 22:12:01 -0000 1.5 +++ Makefile 24 Jul 2006 15:30:12 -0000 1.6 @@ -26,7 +26,7 @@ include $(BUILD_ROOT)/nsconfig.mk -all: do-ldif do-config +all: do-ldif do-ldif: ifeq ($(ARCH), AIX) @@ -34,10 +34,3 @@ else cd ldif; $(MAKE) $(MFLAGS) endif - -do-config: -ifeq ($(ARCH), AIX) - cd config; $(MAKE) -else - cd config; $(MAKE) $(MFLAGS) -endif From fedora-directory-commits at redhat.com Tue Jul 25 23:37:14 2006 From: fedora-directory-commits at redhat.com (Robert Relyea (rrelyea)) Date: Tue, 25 Jul 2006 16:37:14 -0700 Subject: [Fedora-directory-commits] coolkey/src/coolkey slot.cpp,1.1,1.2 Message-ID: <200607252337.k6PNbE7I004961@cvs-int.fedora.redhat.com> Author: rrelyea Update of /cvs/dirsec/coolkey/src/coolkey In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv4940 Modified Files: slot.cpp Log Message: patch to support cac cards with only less than 3 certs. Index: slot.cpp =================================================================== RCS file: /cvs/dirsec/coolkey/src/coolkey/slot.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- slot.cpp 9 Jun 2006 18:39:11 -0000 1.1 +++ slot.cpp 25 Jul 2006 23:37:11 -0000 1.2 @@ -605,7 +605,7 @@ * ... even removing and reinserting the card does not change the * applet selection, * do so reset the card now so we can get the CUID - * this will cause other apps to loose login state! */ + * NOTE: this will cause other apps to loose login state! */ CKYCardConnection_Reset(conn); readCUID(); /* get the CUID before we loose the ability to */ isVersion1Key = 0; @@ -1655,6 +1655,8 @@ segmentHeader->dataHeaderSize = size; segmentHeader->dataOffset = segmentHeader->dataHeaderOffset + size; segmentHeader->dataSize = 0; + segmentHeader->cert2Offset = segmentHeader->dataOffset; + segmentHeader->cert2Size = 0; shmData = (CKYByte *) &segmentAddr[segmentHeader->dataHeaderOffset]; break; case 1: @@ -1975,7 +1977,24 @@ CKYBuffer_InitEmpty(&cert); CKYBuffer_InitEmpty(&rawCert); CKYBuffer_InitEmpty(&shmCert); - selectCACApplet(instance); + + // + // not all CAC cards have all the PKI instances + // catch the applet selection errors if they don't + // + try { + selectCACApplet(instance); + } catch(PKCS11Exception& e) { + // all CAC's must have instance '0', throw the error it + // they don't. + if (instance == 0) throw e; + // If the CAC doesn't have instance '2', and we were updating + // the shared memory, set it to valid now. + if ((instance == 2) && !shmem.isValid()) { + shmem.setValid(); + } + return; + } log->log("CAC Cert %d: select CAC applet: %d ms\n", instance, OSTimeNow() - time); @@ -2014,6 +2033,10 @@ needRead = 0; } } + if (!needRead && (shmCertSize == 0)) { + /* no cert of this type, just return */ + return; + } } CKYBuffer_FreeData(&shmCert); @@ -2029,7 +2052,14 @@ &nextSize, &apduRC); if (status != CKYSUCCESS) { - handleConnectionError(); + /* CAC only requires the Certificate in pki '0' */ + /* if pki '1' or '2' are empty, treat it as a non-fatal error*/ + if (instance == 2) { + /* we've attempted to read all the certs, shared memory + * is now valid */ + shmem.setValid(); + } + } } From fedora-directory-commits at redhat.com Thu Jul 27 17:04:13 2006 From: fedora-directory-commits at redhat.com (Robert Relyea (rrelyea)) Date: Thu, 27 Jul 2006 10:04:13 -0700 Subject: [Fedora-directory-commits] coolkey/src/windows - New directory Message-ID: <200607271704.k6RH4DIs030880@cvs-int.fedora.redhat.com> Author: rrelyea Update of /cvs/dirsec/coolkey/src/windows In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv30865/windows Log Message: Directory /cvs/dirsec/coolkey/src/windows added to the repository From fedora-directory-commits at redhat.com Thu Jul 27 17:04:34 2006 From: fedora-directory-commits at redhat.com (Robert Relyea (rrelyea)) Date: Thu, 27 Jul 2006 10:04:34 -0700 Subject: [Fedora-directory-commits] coolkey/src/windows/csp - New directory Message-ID: <200607271704.k6RH4YlC030901@cvs-int.fedora.redhat.com> Author: rrelyea Update of /cvs/dirsec/coolkey/src/windows/csp In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv30886/csp Log Message: Directory /cvs/dirsec/coolkey/src/windows/csp added to the repository From fedora-directory-commits at redhat.com Thu Jul 27 22:02:44 2006 From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins)) Date: Thu, 27 Jul 2006 15:02:44 -0700 Subject: [Fedora-directory-commits] adminserver/admserv/cgi-src40 back1.gif, 1.1.1.1, NONE banner.gif, 1.1.1.1, NONE content1.gif, 1.1.1.1, NONE exit1.gif, 1.1.1.1, NONE forward1.gif, 1.1.1.1, NONE index1.gif, 1.1.1.1, NONE library.gif, 1.1.1.1, NONE print1.gif, 1.1.1.1, NONE Message-ID: <200607272202.k6RM2iDW015778@cvs-int.fedora.redhat.com> Author: rmeggins Update of /cvs/dirsec/adminserver/admserv/cgi-src40 In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv15765 Removed Files: back1.gif banner.gif content1.gif exit1.gif forward1.gif index1.gif library.gif print1.gif Log Message: remove obsolete files From fedora-directory-commits at redhat.com Thu Jul 27 22:23:09 2006 From: fedora-directory-commits at redhat.com (Robert Relyea (rrelyea)) Date: Thu, 27 Jul 2006 15:23:09 -0700 Subject: [Fedora-directory-commits] coolkey/src/windows/csp BinStr.h, NONE, 1.1 Error.h, NONE, 1.1 Key.cpp, NONE, 1.1 Key.h, NONE, 1.1 RegCerts.cpp, NONE, 1.1 RegDll.cpp, NONE, 1.1 Session.cpp, NONE, 1.1 Session.h, NONE, 1.1 State.cpp, NONE, 1.1 State.h, NONE, 1.1 csp.cpp, NONE, 1.1 csp.h, NONE, 1.1 csp.rc, NONE, 1.1 cspx.cpp, NONE, 1.1 gui.cpp, NONE, 1.1 resource.h, NONE, 1.1 uuid.cpp, NONE, 1.1 Message-ID: <200607272223.k6RMN9EM015987@cvs-int.fedora.redhat.com> Author: rrelyea Update of /cvs/dirsec/coolkey/src/windows/csp In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv15953 Added Files: BinStr.h Error.h Key.cpp Key.h RegCerts.cpp RegDll.cpp Session.cpp Session.h State.cpp State.h csp.cpp csp.h csp.rc cspx.cpp gui.cpp resource.h uuid.cpp Log Message: Put the CSP up in open source --- NEW FILE BinStr.h --- /** BEGIN COPYRIGHT BLOCK * This Program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; version 2 of the License. * * This Program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place, Suite 330, Boston, MA 02111-1307 USA. * * Copyright (C) 2003-2004 Identity Alliance * All rights reserved. * END COPYRIGHT BLOCK **/ /***************************************************************** / / File : BinStr.h / Date : December 3, 2002 / Purpose: Crypto API CSP->PKCS#11 Module / License: Copyright (C) 2003-2004 Identity Alliance / ******************************************************************/ #ifndef __INCLUDE_BINSTR_H__ #define __INCLUDE_BINSTR_H__ #include namespace MCSP { // Special tag used to identify binary strings that have been converted to // ASCII hex. This allows us to recognize them and turn them back to raw // binary when needed. This is used with the container name mapping to // CKA_ID's. static const char* PREFIX = "BINCODED:"; static const size_t PREFIXLEN = strlen(PREFIX); class BinStr : public std::vector { public: BinStr() : std::vector() {} BinStr(size_type size) : std::vector(size) {} BinStr(const char* str) { *this = str; } BinStr(const std::string& str) { *this = str; } // Helper for the common case of returning a DWORD/CK_ULONG size unsigned long size() const { return static_cast(std::vector::size()); } // If the string has non-printable characters then it is converted to a hex // string of the binary data prefixed with PREFIX: (see definition above), // otherwise it is left alone. bool BinToHex() { iterator itr = begin(); for (; itr != end(); itr++) { if (!isgraph(*itr) && *itr != ' ') break; } if (itr == end()) return false; // Need to convert string to ASCII hex BinStr temp; temp = PREFIX; temp.resize(size() * 2 + temp.size()); size_type pos = PREFIXLEN; itr = begin(); for (; itr != end(); itr++, pos += 2) sprintf((char*)&temp[pos], "%.2x", *itr); swap(temp); return true; } // If the string has been encoded to hex with PREFIX: then this converts it // back to raw binary, otherwise it is left alone. bool HexToBin() { if (size() < PREFIXLEN) return false; if (memcmp(&(*this)[0], PREFIX, PREFIXLEN) != 0) return false; BinStr::size_type newSize = size() - PREFIXLEN; if (newSize % 2) return false; newSize /= 2; BinStr temp(newSize); size_type pos_in = PREFIXLEN, pos_out = 0; for (; pos_in < size(); pos_in += 2, pos_out++) temp[pos_out] = BinFromHexChars(&(*this)[pos_in]); swap(temp); return true; } // Helper for the common case of setting a BinStr to a char string value. // Note that this DOES include the NULL at the end. // FIXME: resizing is wierd, what if the BinStr is longer than the assigned value? void operator =(const char* str) { if (size() < strlen(str) + 1) resize(strlen(str) + 1); strcpy((char*)&(*this)[(size_type)0], str); } void operator =(const std::string& str) { resize(str.size()); memcpy((char*)&(*this)[(size_type)0], &str[0], size()); } void assign(const BYTE* data, size_t len) { resize(len); memcpy(&(*this)[0], data, len); } protected: static BYTE BinFromHexChars(const BYTE* hex) { char temp[3] = { hex[0], hex[1], 0 }; return static_cast(strtoul(temp, 0, 16)); } }; } // namespace MCSP #endif // __INCLUDE_BINSTR_H__ --- NEW FILE Error.h --- /** BEGIN COPYRIGHT BLOCK * This Program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; version 2 of the License. * * This Program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place, Suite 330, Boston, MA 02111-1307 USA. * * Copyright (C) 2003-2004 Identity Alliance * All rights reserved. * END COPYRIGHT BLOCK **/ /***************************************************************** / / File : Error.h / Date : December 3, 2002 / Purpose: Crypto API CSP->PKCS#11 Module / License: Copyright (C) 2003-2004 Identity Alliance / ******************************************************************/ #ifndef __INCLUDE_ERROR_H__ #define __INCLUDE_ERROR_H__ #include namespace MCSP { /////////////////////////////////////////////////////////////////////////////// // Error handling /////////////////////////////////////////////////////////////////////////////// class Error { public: DWORD code_; int line_; std::string file_; std::string func_; std::string msg_; public: Error(DWORD code, int line, const char* file, const char* func, const char* msg) : code_(code), line_(line), file_(file), func_(func), msg_(msg) {} void log() { LOG("Exception: 0x%X at %s:%d in %s() \"%s\"\n", code_, file_.c_str(), line_, func_.c_str(), msg_.c_str()); } }; // Utility template so we can catch errors of a specific type // Example: catch(ErrorT& e) // Will catch a NTE_NO_MEMORY error template class ErrorT : public Error { public: ErrorT(DWORD code, int line, const char* file, const char* func, const char* msg) : Error(code, line, file, func, msg) {} }; } // namespace MCSP // Utility macros #define Throw(x) throw ErrorT(x,__LINE__,__FILE__,__FUNCTION__,"") #define ThrowMsg(x,y) throw ErrorT(x,__LINE__,__FILE__,__FUNCTION__,y) #endif // __INCLUDE_ERROR_H__ --- NEW FILE Key.cpp --- /** BEGIN COPYRIGHT BLOCK * This Program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; version 2 of the License. * * This Program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place, Suite 330, Boston, MA 02111-1307 USA. * * Copyright (C) 2003-2004 Identity Alliance * All rights reserved. * END COPYRIGHT BLOCK **/ /***************************************************************** / / File : Key.cpp / Date : December 3, 2002 / Purpose: Crypto API CSP->PKCS#11 Module / License: Copyright (C) 2003-2004 Identity Alliance / ******************************************************************/ #include "csp.h" #include "Key.h" namespace MCSP { Key::Key() : algId_(0), sessionKey_(true), hPublicKey_(-1), hPrivateKey_(-1), hFakeSessionKey_(0) { lock_ = ::CreateMutex(NULL, FALSE, NULL); } Key::Key(bool sessionKey) : algId_(0), sessionKey_(sessionKey), hPublicKey_(-1), hPrivateKey_(-1), hFakeSessionKey_(0) { lock_ = ::CreateMutex(NULL, FALSE, NULL); } Key::~Key() { ::CloseHandle(lock_); } } // namespace MCSP --- NEW FILE Key.h --- /** BEGIN COPYRIGHT BLOCK * This Program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; version 2 of the License. * * This Program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place, Suite 330, Boston, MA 02111-1307 USA. * * Copyright (C) 2003-2004 Identity Alliance * All rights reserved. * END COPYRIGHT BLOCK **/ /***************************************************************** / / File : Key.h / Date : December 3, 2002 / Purpose: Crypto API CSP->PKCS#11 Module / License: Copyright (C) 2003-2004 Identity Alliance / ******************************************************************/ #ifndef __INCLUDE_CSPKEY_H__ #define __INCLUDE_CSPKEY_H__ #include "csp.h" namespace MCSP { class Key { private: HANDLE lock_; public: // FIXME: make these private and add accessors... ALG_ID algId_; bool sessionKey_; CK_OBJECT_HANDLE hPublicKey_; CK_OBJECT_HANDLE hPrivateKey_; HCRYPTKEY hFakeSessionKey_; Key(); Key(bool sessionKey); ~Key(); void lock() { ::WaitForSingleObject(lock_, INFINITE); } void unlock() { ::ReleaseMutex(lock_); } // Little helper that performs automatic thread locking (see csp.cpp for usage) class Ptr { private: Key *k_; public: Ptr(Key* k) { k_ = k; k_->lock(); } ~Ptr() { k_->unlock(); } Key* operator ->() { return k_; } operator Key*() { return k_; } }; }; } // namespace MCSP #endif // __INCLUDE_CSPKEY_H__ --- NEW FILE RegCerts.cpp --- /** BEGIN COPYRIGHT BLOCK * This Program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; version 2 of the License. * * This Program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place, Suite 330, Boston, MA 02111-1307 USA. * * Copyright (C) 2003-2004 Identity Alliance * All rights reserved. * END COPYRIGHT BLOCK **/ /***************************************************************** / / File : RegCerts.cpp / Date : July 5, 2003 / Purpose: Crypto API CSP->PKCS#11 Module / License: Copyright (C) 2003-2004 Identity Alliance / ******************************************************************/ #include #include "csp.h" int main(int argc, char* argv[]) { HCRYPTPROV hProv; if (argc < 2) { printf("usage: %s [CSP NAME]\n", argv[0]); exit(1); } if (!CryptAcquireContext(&hProv, NULL, argv[1], PROV_RSA_FULL, 0)) { printf("CryptAcquireContext failed (0x%X)\n", GetLastError()); exit(1); } printf("Got context\n"); BYTE name[4096]; DWORD nameSize = sizeof(name); DWORD flags = CRYPT_FIRST; while (CryptGetProvParam(hProv, PP_ENUMCONTAINERS, name, &nameSize, flags)) { printf("While\n"); flags = 0; nameSize = sizeof(name); if (!CryptSetProvParam(hProv, PP_REGISTER_CERTIFICATE, name, 0)) printf("Error registering container (0x%X): \"%s\"\n", GetLastError(), name); printf("Registered container: \"%s\"\n", name); } printf("Done\n"); CryptReleaseContext(hProv, 0); return 0; } --- NEW FILE RegDll.cpp --- /** BEGIN COPYRIGHT BLOCK * This Program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; version 2 of the License. * * This Program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place, Suite 330, Boston, MA 02111-1307 USA. * * Copyright (C) 2006 Red Hat, Inc. * All rights reserved. * END COPYRIGHT BLOCK **/ /***************************************************************** / / File : RegDll.cpp / Date : July 20, 2006 / Purpose: Register our Capi provider / ******************************************************************/ #include "csp.h" #include "windows.h" #include "winreg.h" #include "fcntl.h" #include "io.h" extern HINSTANCE g_hModule; #define WINDOWS_CSP_PROVIDER \ "SOFTWARE\\Microsoft\\Cryptography\\Defaults\\Provider" // Windows key values #define TYPE_KEY "Type" #define IMAGE_KEY "ImagePath" #define SIG_KEY "Signature" // CSP specific key values #define LOG_KEY "Logging" #define KEYGEN_KEY "KeyGenHack" #define PIN_KEY "PIN" #define MODULE_KEY "PKCS11Module" #define DEFAULT_PKCS11_MODULE "coolkey.dll" #define DEFAULT_PIN "1234" // // set the key value if it doesn't exist // static LONG regSetValueIf(HKEY hKey, LPCTSTR lpSubKey, DWORD dwType, const BYTE *lpData, DWORD cbData) { DWORD size; LONG wrc = RegQueryValueEx(hKey,lpSubKey, 0, NULL, NULL, &size); if (wrc == ERROR_SUCCESS) { return wrc; } return RegSetValueEx(hKey, lpSubKey, 0, dwType, lpData, cbData); } static LONG getThisLibraryName(char **returnedLibName, DWORD *returnedLibLen) { char *cspLibraryName; DWORD cspLibraryLen; char myModuleName[MAX_PATH]; *returnedLibName = NULL; *returnedLibLen = 0; cspLibraryLen = GetModuleFileName(g_hModule, myModuleName, sizeof(myModuleName)); if (cspLibraryLen == 0) { return GetLastError(); } cspLibraryName = (char *)malloc(cspLibraryLen); if (cspLibraryName == NULL) { return ERROR_NOT_ENOUGH_MEMORY; } memcpy(cspLibraryName, myModuleName, cspLibraryLen); *returnedLibName = cspLibraryName; *returnedLibLen = cspLibraryLen; return ERROR_SUCCESS; } #define SIG_SUFFIX ".sig" static char * getSigFileName(const char *libName) { int libLen = strlen(libName); char *sigFile = (char *)malloc(libLen+sizeof(SIG_SUFFIX)); char *ext; if (sigFile == NULL) { return NULL; } ext = strrchr(libName, '.'); if (ext) { libLen = ext - libName; } memcpy(sigFile,libName,libLen); memcpy(&sigFile[libLen],SIG_SUFFIX,sizeof(SIG_SUFFIX)); return sigFile; } static DWORD getFileSize(int fd) { unsigned long offset; unsigned long current; current = lseek(fd, 0, SEEK_CUR); offset = lseek(fd, 0, SEEK_END); lseek(fd, current, SEEK_SET); return offset; } static LONG getSignature(const char *cspLibrary, unsigned char **returnedSig, DWORD *returnedSigLen) { char *sigFile = getSigFileName(cspLibrary); int fd; unsigned char *signature = NULL; DWORD signatureLen; int error; LONG wrc = ERROR_SUCCESS; *returnedSig = NULL; *returnedSigLen = 0; if (sigFile == NULL) { return ERROR_NOT_ENOUGH_MEMORY; } fd = open (sigFile, O_RDONLY); free(sigFile); if (fd < 0) { return GetLastError(); } signatureLen = getFileSize(fd); signature = (unsigned char *)malloc(signatureLen); if (signature == NULL) { wrc = ERROR_NOT_ENOUGH_MEMORY; goto loser; } error = read(fd, signature, signatureLen); if (error != signatureLen) { wrc = (error < 0) ? GetLastError() : ERROR_FILE_NOT_FOUND; goto loser; } *returnedSig = signature; *returnedSigLen = signatureLen; loser: close(fd); if (signature && (wrc != ERROR_SUCCESS) ) { free(signature); } return wrc; } STDAPI DllUnregisterServer(void) { HKEY provKey; DWORD disp; LONG wrc; wrc = RegCreateKeyEx(HKEY_LOCAL_MACHINE, WINDOWS_CSP_PROVIDER, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, 0, &provKey, &disp); if (wrc != ERROR_SUCCESS) { return HRESULT_FROM_WIN32(wrc); } RegDeleteKey(provKey, PROVIDER_NAME); RegCloseKey(provKey); return S_OK; } STDAPI DllRegisterServer(void) { HKEY provKey = NULL; HKEY cspKey = NULL; char *cspLibrary = NULL; unsigned char *signature = NULL; DWORD cspLibraryLen, signatureLen; DWORD dvalue; DWORD disp; LONG wrc; wrc = RegCreateKeyEx(HKEY_LOCAL_MACHINE, WINDOWS_CSP_PROVIDER, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, 0, &provKey, &disp); if (wrc != ERROR_SUCCESS) { goto loser; } wrc = RegCreateKeyEx(provKey, PROVIDER_NAME, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, 0, &cspKey, &disp); if (wrc != ERROR_SUCCESS) { goto loser; } dvalue = PROVIDER_TYPE; wrc = RegSetValueEx(cspKey, TYPE_KEY, 0, REG_DWORD, (BYTE *)&dvalue, sizeof(dvalue)); if (wrc != ERROR_SUCCESS) { goto loser; } dvalue = 0; wrc = regSetValueIf(cspKey, LOG_KEY, REG_DWORD, (BYTE *)&dvalue, sizeof(dvalue)); if (wrc != ERROR_SUCCESS) { goto loser; } dvalue = 1; wrc = regSetValueIf(cspKey, KEYGEN_KEY, REG_DWORD, (BYTE *)&dvalue, sizeof(dvalue)); if (wrc != ERROR_SUCCESS) { goto loser; } wrc = regSetValueIf(cspKey, PIN_KEY, REG_DWORD, (BYTE *)DEFAULT_PIN, sizeof(DEFAULT_PIN)); if (wrc != ERROR_SUCCESS) { goto loser; } wrc = regSetValueIf(cspKey, MODULE_KEY, REG_SZ, (BYTE *)DEFAULT_PKCS11_MODULE, sizeof(DEFAULT_PKCS11_MODULE)); if (wrc != ERROR_SUCCESS) { goto loser; } wrc = getThisLibraryName(&cspLibrary, &cspLibraryLen); if (wrc != ERROR_SUCCESS) { goto loser; } wrc = RegSetValueEx(cspKey, IMAGE_KEY, 0, REG_SZ, (BYTE *)cspLibrary, cspLibraryLen); if (wrc != ERROR_SUCCESS) { goto loser; } wrc = getSignature(cspLibrary, &signature, &signatureLen); if (wrc != ERROR_SUCCESS) { goto loser; } wrc = RegSetValueEx(cspKey, SIG_KEY, 0, REG_BINARY, signature, signatureLen); if (wrc != ERROR_SUCCESS) { goto loser; } loser: if (signature) { free(signature); } if (cspLibrary) { free(cspLibrary); } if (cspKey) { RegCloseKey(cspKey); if (wrc != ERROR_SUCCESS) { RegDeleteKey(provKey, PROVIDER_NAME); } } if (provKey) { RegCloseKey(provKey); } return HRESULT_FROM_WIN32(wrc); } --- NEW FILE Session.cpp --- /** BEGIN COPYRIGHT BLOCK * This Program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; version 2 of the License. * * This Program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place, Suite 330, Boston, MA 02111-1307 USA. * * Copyright (C) 2003-2004 Identity Alliance * All rights reserved. * END COPYRIGHT BLOCK **/ /***************************************************************** / / File : Session.cpp / Date : December 3, 2002 / Purpose: Crypto API CSP->PKCS#11 Module / License: Copyright (C) 2003-2004 Identity Alliance / ******************************************************************/ #include "csp.h" #include "Session.h" namespace MCSP { Session::Session(bool init/*= true*/) : doInit_(init), p11_(0), silent_(false), verifyContext_(false), newKeyset_(false), machineKeyset_(false) { if (doInit_) { lock_ = ::CreateMutex(NULL, FALSE, NULL); // We generate a unique container for all of our attachments to the default // MS provider. It gets deleted when this session is closed. BinStr uuid0; GenUUID(&uuid0); size_t provNameLen = strlen(PROVIDER_NAME); cryptProvUUID_.resize(provNameLen); memcpy(&cryptProvUUID_[0], PROVIDER_NAME, provNameLen); cryptProvUUID_.push_back('_'); cryptProvUUID_.push_back('_'); cryptProvUUID_.resize(cryptProvUUID_.size() + uuid0.size()); memcpy(&cryptProvUUID_[provNameLen+2], &uuid0[0], uuid0.size()); cryptProvUUID_.push_back(0); if (!CryptAcquireContext(&cryptProv_, NULL, MS_ENHANCED_PROV, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) Throw(NTE_PROVIDER_DLL_FAIL); if (g_state.p11->C_OpenSession(g_state.slot(), CKF_SERIAL_SESSION | CKF_RW_SESSION, 0, 0, &p11_) != CKR_OK) { // Try one more time in case the card was removed then put back if (g_state.p11->C_OpenSession(g_state.slot(), CKF_SERIAL_SESSION | CKF_RW_SESSION, 0, 0, &p11_) != CKR_OK) ThrowMsg(NTE_FAIL, "PKCS#11 session could not be opened"); } LOG("PKCS#11 session: 0x%X\n", p11_); } } Session::~Session() { if (doInit_) { LOG("Closing crypt session: 0x%X\n", cryptProv_); LOG("Closing P11 session: 0x%X\n", p11_); CryptReleaseContext(cryptProv_, 0); g_state.p11->C_CloseSession(p11_); // FIXME: check error? ::CloseHandle(lock_); } } void Session::parseFQCN(const char* fqcn0, BinStr* container_name, BinStr* reader_name) { container_name->clear(); reader_name->clear(); if (fqcn0 == 0 || fqcn0[0] == 0) { container_name->clear(); container_name->push_back(0); return; } BinStr fqcn = fqcn0; if (fqcn[0] == '\\' && fqcn[1] == '\\' && fqcn[2] == '.' && fqcn[3] == '\\') { char* c = strchr((char*)&fqcn[4], '\\'); if (c != 0) { *c = 0; c++; (*container_name) = c; } (*reader_name) = (char*)&fqcn[4]; } else (*container_name) = fqcn; LOG("ParseFQCN: container_name: \"%s\"\n", StringifyBin(*container_name, false).c_str()); LOG("ParseFQCN: reader_name: \"%s\"\n", StringifyBin(*reader_name, false).c_str()); } } // namespace MCSP --- NEW FILE Session.h --- /** BEGIN COPYRIGHT BLOCK * This Program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; version 2 of the License. * * This Program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place, Suite 330, Boston, MA 02111-1307 USA. * * Copyright (C) 2003-2004 Identity Alliance * All rights reserved. * END COPYRIGHT BLOCK **/ /***************************************************************** / / File : Session.h / Date : December 3, 2002 / Purpose: Crypto API CSP->PKCS#11 Module / License: Copyright (C) 2003-2004 Identity Alliance / ******************************************************************/ #ifndef __INCLUDE_SESSION_H__ #define __INCLUDE_SESSION_H__ #include "BinStr.h" #include namespace MCSP { class Session { private: HANDLE lock_; public: // FIXME: make these private and add accessors... bool doInit_; CK_SESSION_HANDLE p11_; HCRYPTPROV cryptProv_; bool silent_; bool verifyContext_; bool newKeyset_; bool machineKeyset_; BinStr readerName_; // NULL terminated; CSP friendly BinStr containerName_; // NULL terminated; CSP friendly BinStr CKAID_; // Real container name; could be binary; not NULL terminated BinStr cryptProvUUID_; std::set containers_; std::set::iterator containerItr_; Session(bool init = true); ~Session(); void lock() { ::WaitForSingleObject(lock_, INFINITE); } void unlock() { ::ReleaseMutex(lock_); } static void parseFQCN(const char* fqcn, BinStr* container_name, BinStr* reader_name); // Little helper that performs automatic thread locking (see csp.cpp for usage) class Ptr { private: Session *s_; public: Ptr(Session* s) { s_ = s; s_->lock(); } ~Ptr() { s_->unlock(); } Session* operator ->() { return s_; } operator Session*() { return s_; } }; }; } // namespace MCSP #endif // __INCLUDE_SESSION_H__ --- NEW FILE State.cpp --- /** BEGIN COPYRIGHT BLOCK * This Program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; version 2 of the License. * * This Program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place, Suite 330, Boston, MA 02111-1307 USA. * * Copyright (C) 2003-2004 Identity Alliance * All rights reserved. * END COPYRIGHT BLOCK **/ /***************************************************************** / / File : State.cpp / Date : December 3, 2002 / Purpose: Crypto API CSP->PKCS#11 Module / License: Copyright (C) 2003-2004 Identity Alliance / ******************************************************************/ #include "csp.h" #include "State.h" #include using namespace std; namespace MCSP { State::State() : init_(false), logging_(false), logFilename_("C:\\CSPDEBUG.log"), slot_(0), keyGenHack_(false), pkcs11dllname_("PKCS11.dll") { lock_ = ::CreateMutex(NULL, FALSE, NULL); HKEY hKey = NULL; if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\Microsoft\\Cryptography\\Defaults\\Provider\\"PROVIDER_NAME), 0, KEY_READ, &hKey) == ERROR_SUCCESS) { DWORD value = 0; DWORD size = sizeof(value); if (RegQueryValueEx(hKey, TEXT("Logging"), 0, 0, (LPBYTE)&value, &size) == ERROR_SUCCESS) { if (value) logging(true); } size = 0; if (RegQueryValueEx(hKey, TEXT("LogFilename"), 0, 0, 0, &size) == ERROR_SUCCESS) { LOG("LogFilename size is: %u\n", size); std::string value; value.resize(size); if (RegQueryValueEx(hKey, TEXT("LogFilename"), 0, 0, (LPBYTE)&value[0], &size) == ERROR_SUCCESS) { // Remove trailing null value.resize(value.size() - 1); logFilename_ = value; } LOG("LogFilename value is: %s\n", &value[0]); } size = sizeof(value); if (RegQueryValueEx(hKey, TEXT("KeyGenHack"), 0, 0, (LPBYTE)&value, &size) == ERROR_SUCCESS) { if (value) keyGenHack(true); } if (RegQueryValueEx(hKey, TEXT("PKCS11Module"), 0, 0, 0, &size) == ERROR_SUCCESS) { LOG("PKCS11Module size is: %u\n", size); std::string value; value.resize(size); if (RegQueryValueEx(hKey, TEXT("PKCS11Module"), 0, 0, (LPBYTE)&value[0], &size) == ERROR_SUCCESS) { // Remove trailing null value.resize(value.size() - 1); pkcs11dllname_ = value; } LOG("PKCS11Module value is: %s\n", &value[0]); } RegCloseKey(hKey); } } State::~State() { shutdown(); ::CloseHandle(lock_); } bool State::sessionExists(Session* session) { bool rv = false; lock(); set::iterator itr = sessions_.find(session); if (itr != sessions_.end()) rv = true; unlock(); return rv; } void State::removeSession(Session* session) { lock(); sessions_.erase(session); delete session; if (sessions_.empty()) shutdown(); unlock(); } Session* State::checkValidSession(HCRYPTPROV hProv) { //LOG("Checking 0x%X as a valid session handle\n", hProv); if (!sessionExists(reinterpret_cast(hProv))) Throw(NTE_BAD_UID); return reinterpret_cast(hProv); } bool State::keyExists(Key* key) { bool rv = false; lock(); set::iterator itr = keys_.find(key); if (itr != keys_.end()) rv = true; unlock(); return rv; } Key* State::checkValidKey(HCRYPTKEY hKey) { //LOG("Checking 0x%X as a valid key handle\n", hKey); if (!keyExists(reinterpret_cast(hKey))) Throw(NTE_BAD_UID); return reinterpret_cast(hKey); } bool State::shutdown() { if (init()) { lock(); LOG("Shutting down CSP\n"); { set::iterator itr = sessions_.begin(); for (; itr != sessions_.end(); itr++) delete *itr; sessions_.clear(); } { set::iterator itr = keys_.begin(); for (; itr != keys_.end(); itr++) { LOG("Destroying key: 0x%X\n", *itr); delete *itr; } keys_.clear(); } g_state.p11->C_Finalize(0); init(false); unlock(); } return true; } bool State::initP11(const BinStr& reader_name0, DWORD dwFlags) { bool rv = true; CK_RV ck_rv; CK_SLOT_ID slot = 0; BinStr reader_name = reader_name0; // We may need to modify the value bool silent = false; lock(); if ((dwFlags & CRYPT_SILENT) || (dwFlags & CRYPT_VERIFYCONTEXT)) silent = true; try { HMODULE p11lib = LoadLibrary(pkcs11dllname_.c_str()); if (p11lib == NULL) { LOG("Failed to load PKCS11 library \"%s\"\n", pkcs11dllname_.c_str()); SetLastError(NTE_FAIL); throw(false); } CK_RV (*getfunc)(CK_FUNCTION_LIST_PTR_PTR ppFunctionList); getfunc = (CK_RV (*)(CK_FUNCTION_LIST_PTR_PTR ppFunctionList))GetProcAddress(p11lib, "C_GetFunctionList"); if (getfunc == NULL) { LOG("Failed to find C_GetFunctionList\n"); SetLastError(NTE_FAIL); throw(false); } CK_RV rv = getfunc(&p11); if (rv != CKR_OK) { LOG("Failed to get PKCS11 function list\n"); SetLastError(NTE_FAIL); throw(false); } ck_rv = p11->C_Initialize(0); LOG("C_Initialize: 0x%X\n", ck_rv); if (ck_rv != CKR_OK && ck_rv != CKR_CRYPTOKI_ALREADY_INITIALIZED) { LOG("C_Initialize() failed: 0x%X (%u)\n", ck_rv, ck_rv); SetLastError(NTE_FAIL); throw(false); } CK_ULONG ulSlotCount; if (p11->C_GetSlotList(FALSE, 0, &ulSlotCount) != CKR_OK) { LOG("C_GetSlotList() failed\n"); SetLastError(NTE_FAIL); throw(false); } LOG("There are %d slots on this machine\n", ulSlotCount); if (ulSlotCount < 1) { LOG("No slots detected\n"); SetLastError(NTE_FAIL); throw(false); } vector slotList(ulSlotCount); if (p11->C_GetSlotList(FALSE, &slotList[0], &ulSlotCount) != CKR_OK) { LOG("C_GetSlotList() failed (second call)\n"); SetLastError(NTE_FAIL); throw(false); } CK_SLOT_INFO slotInfo; BinStr current_reader; vector::iterator itr; bool found_slot = false; // FIXME: Look for the specified reader or if not specified then // the first reader with a card present. Should probably // search for first valid token and use MS smartcard select // dialog. while (!found_slot) { LOG("Looking for a valid token\n"); CK_ULONG token_count = 0; itr = slotList.begin(); for (; itr != slotList.end(); itr++) { p11->C_GetSlotInfo(*itr, &slotInfo); CK_TOKEN_INFO tokenInfo; CK_RV ck_rv = p11->C_GetTokenInfo(*itr, &tokenInfo); // Chop off trailing spaces in P11 slot name current_reader.assign(slotInfo.slotDescription, sizeof(slotInfo.slotDescription)); while (current_reader[current_reader.size()-1] == 0x20) current_reader.resize(current_reader.size() - 1); current_reader.push_back(0); LOG("Slot %d: %s (looking for reader: %s)\n", *itr, ¤t_reader[0], reader_name.empty() ? "" : (char*)&reader_name[0]); if (!(slotInfo.flags & CKF_TOKEN_PRESENT)) { LOG("^^^^^ (No card present)\n"); if (reader_name == current_reader) break; } else { string infoString((char*)tokenInfo.label, sizeof(tokenInfo.label)); LOG("^^^^^ (%s)\n", infoString.c_str()); token_count++; if (reader_name.empty()) { // If multiple tokens, ask user if (token_count > 1 && !silent) break; found_slot = true; slot = *itr; } else if (reader_name == current_reader) { found_slot = true; slot = *itr; break; } } } if (token_count > 1 && !silent) { SCARDCONTEXT hSC; OPENCARDNAME_EX dlgStruct; char szReader[256]; char szCard[256]; if (SCardEstablishContext(SCARD_SCOPE_USER, NULL, NULL, &hSC) != SCARD_S_SUCCESS) { LOG("Failed SCardEstablishContext\n"); SetLastError(NTE_FAIL); throw(false); } memset(&dlgStruct, 0, sizeof(dlgStruct)); dlgStruct.dwStructSize = sizeof(dlgStruct); dlgStruct.hSCardContext = hSC; dlgStruct.dwFlags = SC_DLG_FORCE_UI; dlgStruct.lpstrRdr = szReader; dlgStruct.nMaxRdr = 256; dlgStruct.lpstrCard = szCard; dlgStruct.nMaxCard = 256; //dlgStruct.lpstrTitle = "Select Card:"; // FIXME: Will this work during login? if (SCardUIDlgSelectCard(&dlgStruct) != SCARD_S_SUCCESS) { SCardReleaseContext(hSC); LOG("Failed SCardUIDlgSelectCard\n"); SetLastError(NTE_FAIL); throw(false); } else { SCardReleaseContext(hSC); LOG("User selected reader: %s card: %s\n", szReader, szCard); reader_name = (char*)szReader; slot = 0; continue; // This will restart the search loop to find the selected reader } } if (!found_slot) { if (silent) { LOG("ERROR: Can't find a card in any reader and silent mode is set"); SetLastError(NTE_FAIL); throw(false); } // FIXME: will this work during login? int result = MessageBox(NULL, "Please insert a supported smartcard", "Insert Card", MB_ICONEXCLAMATION | MB_RETRYCANCEL); if (result == IDCANCEL) { SetLastError(NTE_FAIL); throw(false); } } } LOG("Using slot %d\n", slot); g_state.slot(slot); } catch (bool rv0) { rv = rv0; } unlock(); return rv; } } // namespace MCSP --- NEW FILE State.h --- /** BEGIN COPYRIGHT BLOCK * This Program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; version 2 of the License. * * This Program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place, Suite 330, Boston, MA 02111-1307 USA. * * Copyright (C) 2003-2004 Identity Alliance * All rights reserved. * END COPYRIGHT BLOCK **/ /***************************************************************** / / File : State.h / Date : December 3, 2002 / Purpose: Crypto API CSP->PKCS#11 Module / License: Copyright (C) 2003-2004 Identity Alliance / ******************************************************************/ #ifndef __INCLUDE_STATE_H__ #define __INCLUDE_STATE_H__ #include "csp.h" namespace MCSP { // Global state; only one instance of this class State { private: HANDLE lock_; bool init_; bool logging_; std::string logFilename_; CK_SLOT_ID slot_; bool keyGenHack_; std::set sessions_; std::set keys_; std::string pkcs11dllname_; public: CK_FUNCTION_LIST_PTR p11; public: State(); ~State(); bool init() const { return init_; } void init(bool init) { init_ = init; } bool logging() const { return logging_; } void logging(bool logging) { logging_ = logging; } std::string logFilename() const { return logFilename_; } void logFilename(std::string logFilename) { logFilename_ = logFilename; } CK_SLOT_ID slot() const { return slot_; } void slot(CK_SLOT_ID slot) { slot_ = slot; } bool keyGenHack() const { return keyGenHack_; } void keyGenHack(bool keyGenHack) { keyGenHack_ = keyGenHack; } void addSession(Session* session) { lock(); sessions_.insert(session); unlock(); } void removeSession(Session* session); bool sessionExists(Session* session); Session* checkValidSession(HCRYPTPROV hProv); void addKey(Key* key) { lock(); keys_.insert(key); unlock(); } void removeKey(Key* key) { lock(); keys_.erase(key); unlock(); } bool keyExists(Key* key); Key* checkValidKey(HCRYPTKEY hKey); bool shutdown(); void lock() { ::WaitForSingleObject(lock_, INFINITE); } void unlock() { ::ReleaseMutex(lock_); } bool initP11(const BinStr& reader_name, DWORD dwFlags); }; } // namespace MCSP #endif // __INCLUDE_STATE_H__ ***** Error reading new file: [Errno 2] No such file or directory: 'csp.cpp' --- NEW FILE csp.h --- /** BEGIN COPYRIGHT BLOCK * This Program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; version 2 of the License. * * This Program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place, Suite 330, Boston, MA 02111-1307 USA. * * Copyright (C) 2003-2004 Identity Alliance * All rights reserved. * END COPYRIGHT BLOCK **/ /***************************************************************** / / File : csp.h / Date : December 3, 2002 / Purpose: Crypto API CSP->PKCS#11 Module / License: Copyright (C) 2003-2004 Identity Alliance / ******************************************************************/ #ifndef __INCLUDE_CSP_H__ #define __INCLUDE_CSP_H__ #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #undef UNICODE #ifndef CSP_PASSTHROUGH #define PROVIDER_NAME "Identity Alliance CSP" #else #define PROVIDER_NAME "Identity Alliance CSP - Passthrough" #endif #define PROVIDER_TYPE PROV_RSA_FULL #define PROVIDER_MAJOR_VERSION 1 #define PROVIDER_MINOR_VERSION 0 #define PP_REGISTER_CERTIFICATE 1000 // Logging macros #define LOG flogf #define BEGIN_API_CALL LOG("+%s() - called\n", __FUNCTION__) #define END_API_CALL LOG(" -%s() - finished: %s (0x%X)\n", __FUNCTION__, rv ? "TRUE" : "FALSE", GetLastError()); #include #include #include #include #include "cspdk.h" #include "cryptoki_win32.h" #include "BinStr.h" #include "Key.h" #include "Session.h" #include "State.h" extern "C" HINSTANCE g_hModule; namespace MCSP { /////////////////////////////////////////////////////////////////////////////// // The global state /////////////////////////////////////////////////////////////////////////////// extern State g_state; /////////////////////////////////////////////////////////////////////////////// // Function prototypes (in alphabetical order) /////////////////////////////////////////////////////////////////////////////// CK_ULONG ASN1Len(const CK_BYTE* buf, bool withHeader = true); void DisplayError(const Session* context, const std::string& str); void DisplayWin32Error(const Session* context); bool DisplayPINDialog(BinStr* pin); bool FindDefaultCert(Session* context, CK_OBJECT_HANDLE* phCert, BinStr* container); bool FindLastContainer(Session* context, CK_OBJECT_HANDLE* phObj, BinStr* container); bool FindObject(Session* context, CK_OBJECT_HANDLE* phObj, CK_OBJECT_CLASS objClass); void flogf(const char* msg, ...); bool GenUUID(BinStr* uuid); bool GetExtKeyUsageFromCert(std::vector* ext, const BinStr& cert); bool GetModulusFromCert(Session* context, BinStr* modulus, BinStr* exponent, const BinStr& cert); void HexIfBin(BinStr* str); bool InitP11(); void Reverse(BinStr* buf); void Reverse(LPBYTE buf, size_t len); std::string StringifyAquireFlags(DWORD param); std::string StringifyBin(const BinStr& data, bool hexMode = true); std::string StringifyBin(const LPBYTE data, size_t len, bool hexMode = true); std::string StringifyCALG(ALG_ID id); std::string StringifyProvParam(DWORD param); std::string GetCurrentExecutable(); std::string GetCurrentDLL(); // GetProvParam helpers void GetProvParam_PP_ENUMALGS(Session* context, DWORD dwFlags, OUT LPBYTE pbData, IN OUT LPDWORD pcbDataLen); void GetProvParam_PP_ENUMALGS_EX(Session* context, DWORD dwFlags, OUT LPBYTE pbData, IN OUT LPDWORD pcbDataLen); void GetProvParam_PP_ENUMCONTAINERS(Session* context, DWORD dwFlags, OUT LPBYTE pbData, IN OUT LPDWORD pcbDataLen); void PutDataIntoBuffer(LPBYTE dest, LPDWORD destLen, const LPBYTE source, DWORD sourceLen); } // namespace MCSP #include "Error.h" // END STANDARD CODE ////////////////////////////////////////////////////////// // END STANDARD CODE ////////////////////////////////////////////////////////// // END STANDARD CODE ////////////////////////////////////////////////////////// // END STANDARD CODE ////////////////////////////////////////////////////////// // END STANDARD CODE ////////////////////////////////////////////////////////// // Microsoft helper functions namespace CryptoHelper { BOOL CreatePrivateExponentOneKey(HCRYPTPROV hProv, DWORD dwKeySpec, HCRYPTKEY *hPrivateKey); BOOL ExportPlainSessionBlob(HCRYPTKEY hPublicKey, HCRYPTKEY hSessionKey, LPBYTE *pbKeyMaterial, DWORD *dwKeyMaterial); BOOL ImportPlainSessionBlob(HCRYPTPROV hProv, HCRYPTKEY hPrivateKey, ALG_ID dwAlgId, LPBYTE pbKeyMaterial, DWORD dwKeyMaterial, HCRYPTKEY *hSessionKey); } // namespace CryptoHelper #endif // __INCLUDE_CSP_H__ --- NEW FILE csp.rc --- // Microsoft Visual C++ generated resource script. // #include "resource.h" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 2 resource. // #include "afxres.h" ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // English (U.S.) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) #ifdef _WIN32 LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US #pragma code_page(1252) #endif //_WIN32 #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // TEXTINCLUDE // 1 TEXTINCLUDE BEGIN "resource.h\0" END 2 TEXTINCLUDE BEGIN "#include ""afxres.h""\r\n" "\0" END 3 TEXTINCLUDE BEGIN "\r\n" "\0" END #endif // APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // Data // CRYPT_SIG_RESOURCE_NUMBER RCDATA BEGIN 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 END ///////////////////////////////////////////////////////////////////////////// // // Dialog // IDD_PIN_DIALOG DIALOGEX 0, 0, 137, 42 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Please enter your PIN" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN DEFPUSHBUTTON "OK",IDOK,49,23,40,14 PUSHBUTTON "Cancel",IDCANCEL,93,23,39,14 EDITTEXT IDC_PIN_EDIT,49,5,83,13,ES_PASSWORD | ES_AUTOHSCROLL CONTROL 104,IDC_STATIC,"Static",SS_BITMAP,5,5,37,34 END ///////////////////////////////////////////////////////////////////////////// // // Version // VS_VERSION_INFO VERSIONINFO FILEVERSION 1,1,0,10 PRODUCTVERSION 1,1,0,10 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L #else FILEFLAGS 0x0L #endif FILEOS 0x4L FILETYPE 0x2L FILESUBTYPE 0x0L BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "040904b0" BEGIN VALUE "CompanyName", "Identity Alliance" VALUE "FileDescription", "Identity Alliance Cryptographic Service Provider" VALUE "FileVersion", "1, 1, 0, 10" VALUE "InternalName", "IDACSP" VALUE "LegalCopyright", "Copyright ? 2003-2005 Identity Alliance" VALUE "ProductVersion", "1, 1, 0, 10" END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x409, 1200 END END ///////////////////////////////////////////////////////////////////////////// // // DESIGNINFO // #ifdef APSTUDIO_INVOKED GUIDELINES DESIGNINFO BEGIN IDD_PIN_DIALOG, DIALOG BEGIN LEFTMARGIN, 5 RIGHTMARGIN, 132 TOPMARGIN, 4 BOTTOMMARGIN, 39 END END #endif // APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // Bitmap // IDB_PIN_LOGO BITMAP "IALogo2.bmp" #endif // English (U.S.) resources ///////////////////////////////////////////////////////////////////////////// #ifndef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 3 resource. // ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED --- NEW FILE cspx.cpp --- /** BEGIN COPYRIGHT BLOCK * This Program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; version 2 of the License. * * This Program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place, Suite 330, Boston, MA 02111-1307 USA. * * Copyright (C) 2003-2004 Identity Alliance * All rights reserved. * END COPYRIGHT BLOCK **/ /***************************************************************** / / File : cspx.cpp / Date : December 3, 2002 / Purpose: Crypto API CSP->PKCS#11 Module / License: Copyright (C) 2003-2004 Identity Alliance / ******************************************************************/ #include "csp.h" #include #include #include using namespace std; namespace MCSP { /////////////////////////////////////////////////////////////////////////////// // This cleans up messages that will be logged. Linefeeds are converted to // CR/LF and a timestamp is added. // // Parameters: // msg0 - Message to clean // // Returns: // string result /////////////////////////////////////////////////////////////////////////////// string clean_flogf(const char* msg) { ostringstream out; time_t t; time(&t); struct tm* time_s = localtime(&t); char timestr[32]; sprintf(timestr, "%.2d/%.2d %.2d:%.2d:%.2d ", time_s->tm_mon+1, time_s->tm_mday, time_s->tm_hour, time_s->tm_min, time_s->tm_sec); out << timestr; char last = 0; for (size_t i = 0; msg[i] != 0x00; i++) { if (last == '\n') out << " "; if (msg[i] == '\n' && last != '\r') out << '\r'; out << msg[i]; last = msg[i]; } if (last != '\n') out << '\r' << '\n'; return out.str(); } /////////////////////////////////////////////////////////////////////////////// // Logs stuff // // Parameters: // msg - Message to log // ... - Variable parameters (like printf) // // Returns: // none /////////////////////////////////////////////////////////////////////////////// void flogf(const char* msg0, ...) { if (!g_state.logging()) return; // Preserve error state DWORD lastErr = GetLastError(); FILE* fp = fopen("C:\\CSPDEBUG.log", "ab"); if (!fp) { fp = stderr; fprintf(fp, "ERROR: no log file"); } string msg1 = clean_flogf(msg0); const char* msg = msg1.c_str(); va_list args; va_start(args, msg0); vfprintf(fp, msg, args); va_end(args); if (fp == stderr) fflush(fp); else fclose(fp); SetLastError(lastErr); } /////////////////////////////////////////////////////////////////////////////// // Converts a BinStr binary string to hex or printable characters // // Parameters: // data - Binary string to convert // hexMode - (optional) If hexMode is on then the return string will be hex // characters. Otherwise it returns a string of printable // characters (unprintable characters are converted to '.'). // // Returns: // string of hex data or printable characters /////////////////////////////////////////////////////////////////////////////// string StringifyBin(const BinStr& data, bool hexMode) { return StringifyBin((LPBYTE)&data[0], data.size(), hexMode); } /////////////////////////////////////////////////////////////////////////////// // Converts a BYTE binary string to hex or printable characters // // Parameters: // data - Binary string to convert // len - Length of string // hexMode - (optional) If hexMode is on then the return string will be hex // characters. Otherwise it returns a string of printable // characters (unprintable characters are converted to '.'). // // Returns: // string of hex data or printable characters /////////////////////////////////////////////////////////////////////////////// string StringifyBin(const LPBYTE data, size_t len, bool hexMode) { ostringstream out; if (hexMode) { // ostringstream can do hex, but the .width flag doesn't // work in Microsoft's implementation (!) char hex[32]; for (size_t i = 0; i < len; i++) { sprintf(hex, "%.2X", data[i]); out << hex; } } else { for (size_t i = 0; i < len; i++) { if (isgraph(data[i]) || data[i] == ' ') out << data[i]; else out << '.'; } } return out.str(); } /////////////////////////////////////////////////////////////////////////////// // Convert a CryptProvParam to text // // Parameters: // param - Parameter value // // Returns: // string /////////////////////////////////////////////////////////////////////////////// string StringifyProvParam(DWORD param) { switch(param) { case PP_CONTAINER: return "PP_CONTAINER"; break; case PP_ENUMALGS: return "PP_ENUMALGS"; break; case PP_ENUMALGS_EX: return "PP_ENUMALGS_EX"; break; case PP_ENUMCONTAINERS: return "PP_ENUMCONTAINERS"; break; case PP_IMPTYPE: return "PP_IMPTYPE"; break; case PP_NAME: return "PP_NAME"; break; case PP_VERSION: return "PP_VERSION"; break; case PP_SIG_KEYSIZE_INC: return "PP_SIG_KEYSIZE_INC"; break; case PP_KEYX_KEYSIZE_INC: return "PP_KEYX_KEYSIZE_INC"; break; case PP_KEYSET_SEC_DESCR: return "PP_KEYSET_SEC_DESCR"; break; case PP_UNIQUE_CONTAINER: return "PP_UNIQUE_CONTAINER"; break; case PP_PROVTYPE: return "PP_PROVTYPE"; break; default: return "PP_UNKNOWN"; break; } } /////////////////////////////////////////////////////////////////////////////// // Converts AcquireContext flags to text // // Parameters: // param - Parameter value // // Returns: // string /////////////////////////////////////////////////////////////////////////////// string StringifyAquireFlags(DWORD param) { string rv; if (param & CRYPT_VERIFYCONTEXT) rv += "CRYPT_VERIFYCONTEXT | "; if (param & CRYPT_NEWKEYSET) rv += "CRYPT_NEWKEYSET | "; if (param & CRYPT_MACHINE_KEYSET) rv += "CRYPT_MACHINE_KEYSET | "; if (param & CRYPT_DELETEKEYSET) rv += "CRYPT_DELETEKEYSET | "; if (param & CRYPT_SILENT) rv += "CRYPT_SILENT | "; return rv; } /////////////////////////////////////////////////////////////////////////////// // Converts CALG_XXXX algorithm to text // // Parameters: // id - Algorithm ID // // Returns: // string /////////////////////////////////////////////////////////////////////////////// string StringifyCALG(ALG_ID id) { switch(id) { case CALG_MD2: return "CALG_MD2"; case CALG_MD4: return "CALG_MD4"; case CALG_MD5: return "CALG_MD5"; case CALG_SHA1: return "CALG_SHA1"; case CALG_MAC: return "CALG_MAC"; case CALG_RSA_SIGN: return "CALG_RSA_SIGN"; case CALG_DSS_SIGN: return "CALG_DSS_SIGN"; case CALG_NO_SIGN: return "CALG_NO_SIGN"; case CALG_RSA_KEYX: return "CALG_RSA_KEYX"; case CALG_DES: return "CALG_DES"; case CALG_3DES_112: return "CALG_3DES_112"; case CALG_3DES: return "CALG_3DES"; case CALG_DESX: return "CALG_DESX"; case CALG_RC2: return "CALG_RC2"; case CALG_RC4: return "CALG_RC4"; case CALG_SEAL: return "CALG_SEAL"; case CALG_DH_SF: return "CALG_DH_SF"; case CALG_DH_EPHEM: return "CALG_DH_EPHEM"; case CALG_AGREEDKEY_ANY: return "CALG_AGREEDKEY_ANY"; case CALG_KEA_KEYX: return "CALG_KEA_KEYX"; case CALG_HUGHES_MD5: return "CALG_HUGHES_MD5"; case CALG_SKIPJACK: return "CALG_SKIPJACK"; case CALG_TEK: return "CALG_TEK"; case CALG_CYLINK_MEK: return "CALG_CYLINK_MEK"; case CALG_SSL3_SHAMD5: return "CALG_SSL3_SHAMD5"; case CALG_SSL3_MASTER: return "CALG_SSL3_MASTER"; case CALG_SCHANNEL_MASTER_HASH: return "CALG_SCHANNEL_MASTER_HASH"; case CALG_SCHANNEL_MAC_KEY: return "CALG_SCHANNEL_MAC_KEY"; case CALG_SCHANNEL_ENC_KEY: return "CALG_SCHANNEL_ENC_KEY"; case CALG_PCT1_MASTER: return "CALG_PCT1_MASTER"; case CALG_SSL2_MASTER: return "CALG_SSL2_MASTER"; case CALG_TLS1_MASTER: return "CALG_TLS1_MASTER"; case CALG_RC5: return "CALG_RC5"; case CALG_HMAC: return "CALG_HMAC"; case CALG_TLS1PRF: return "CALG_TLS1PRF"; case CALG_HASH_REPLACE_OWF: return "CALG_HASH_REPLACE_OWF"; case CALG_AES_128: return "CALG_AES_128"; case CALG_AES_192: return "CALG_AES_192"; case CALG_AES_256: return "CALG_AES_256"; case CALG_AES: return "CALG_AES"; case AT_KEYEXCHANGE: return "AT_KEYEXCHANGE"; case AT_SIGNATURE: return "AT_SIGNATURE"; default: { char buf[256]; sprintf(buf, "UNKNOWN (0x%X)", id); return buf; } } } /////////////////////////////////////////////////////////////////////////////// // Used with GetProvParam and PP_ENUMALGS // // Parameters: // context - CSP context // dwFlags - Flags from GetProvParam call // pbData - Same as GetProvParam call // pcbDataLen - Same as GetProvParam call // // Returns: // none /////////////////////////////////////////////////////////////////////////////// void GetProvParam_PP_ENUMALGS(Session* context, DWORD dwFlags, OUT LPBYTE pbData, IN OUT LPDWORD pcbDataLen) { static int algCursor = 0; PROV_ENUMALGS output; static struct { char* name; ALG_ID id; DWORD bitLen; } algs[] = { { "MD5", CALG_MD5, 128 }, { "SHA1", CALG_SHA1, 160 }, { "DES", CALG_DES, 56 }, { "3DES", CALG_3DES, 168 }, { "RC2", CALG_RC2, 128 }, { NULL } }; LOG("GetProvParam_PP_ENUMALGS called\n"); if (dwFlags & CRYPT_FIRST) algCursor = 0; if (algs[algCursor].name == NULL) Throw(ERROR_NO_MORE_ITEMS); else { output.aiAlgid = algs[algCursor].id; output.dwBitLen = algs[algCursor].bitLen; output.dwNameLen = (DWORD)strlen(algs[algCursor].name) + 1; strcpy(output.szName, algs[algCursor].name); PutDataIntoBuffer(pbData, pcbDataLen, reinterpret_cast(&output), sizeof(output)); } LOG("aiAlgid:0x%X dwBitLen:%u dwNameLen:%u szName:\"%s\"\n", output.aiAlgid, output.dwBitLen, output.dwNameLen, output.szName); algCursor++; } void GetProvParam_PP_ENUMALGS_EX(Session* context, DWORD dwFlags, OUT LPBYTE pbData, IN OUT LPDWORD pcbDataLen) { static int algCursor = 0; PROV_ENUMALGS_EX output; static struct { char* name; ALG_ID id; DWORD defLen; DWORD minLen; DWORD maxLen; } // def min max algs[] = { { "MD5", CALG_MD5, 128, 128, 128 }, { "SHA1", CALG_SHA1, 160, 160, 160 }, { "RSA_SIGN", CALG_RSA_SIGN, 1024, 512, 1024 }, { "RSA_KEYX", CALG_RSA_KEYX, 1024, 512, 1024 }, { "DES", CALG_DES, 56, 56, 56 }, { "3DES", CALG_3DES, 168, 168, 168 }, { "RC2", CALG_RC2, 128, 40, 128 }, { NULL } }; LOG("GetProvParam_PP_ENUMALGS_EX called\n"); if (dwFlags & CRYPT_FIRST) algCursor = 0; if (algs[algCursor].name == NULL) Throw(ERROR_NO_MORE_ITEMS); else { output.aiAlgid = algs[algCursor].id; output.dwDefaultLen = algs[algCursor].defLen; output.dwMinLen = algs[algCursor].minLen; output.dwMaxLen = algs[algCursor].maxLen; output.dwProtocols = 1; output.dwNameLen = (DWORD)strlen(algs[algCursor].name) + 1; strcpy(output.szName, algs[algCursor].name); output.dwLongNameLen = (DWORD)strlen(algs[algCursor].name) + 1; strcpy(output.szLongName, algs[algCursor].name); PutDataIntoBuffer(pbData, pcbDataLen, reinterpret_cast(&output), sizeof(output)); } LOG("aiAlgid:0x%X dwDefaultLen:%u dwMinLen:%u dwMaxLen:%u dwProtocols:%u dwNameLen:%u szName:\"%s\"\n", output.aiAlgid, output.dwDefaultLen, output.dwMinLen, output.dwMaxLen, output.dwProtocols, output.dwNameLen, output.szName); algCursor++; } /////////////////////////////////////////////////////////////////////////////// // Used with GetProvParam and PP_ENUMCONTAINERS // // Parameters: // context - CSP context // dwFlags - Flags from GetProvParam call // pbData - Same as GetProvParam call // pcbDataLen - Same as GetProvParam call // // Returns: // none /////////////////////////////////////////////////////////////////////////////// void GetProvParam_PP_ENUMCONTAINERS(Session* context, DWORD dwFlags, OUT LPBYTE pbData, IN OUT LPDWORD pcbDataLen) { LOG("GetProvParam_PP_ENUMCONTAINERS called\n"); if (dwFlags & CRYPT_FIRST) { LOG("ENUMCONTAINERS resetting container enumeration\n"); context->containers_.clear(); context->containerItr_ = context->containers_.begin(); // Init search (all objects) if (g_state.p11->C_FindObjectsInit(context->p11_, 0, 0) != CKR_OK) ThrowMsg(ERROR_NO_MORE_ITEMS, "C_FindObjectsInit failed"); CK_ULONG count = 1; CK_OBJECT_HANDLE hObj; while(true) { if (CKR_OK != g_state.p11->C_FindObjects(context->p11_, &hObj, 1, &count) || count == 0) { // No more objects (or any other error) g_state.p11->C_FindObjectsFinal(context->p11_); break; } else { CK_ATTRIBUTE pTemplate = { CKA_ID, 0, 0 }; // Get the length if (g_state.p11->C_GetAttributeValue(context->p11_, hObj, &pTemplate, 1) != CKR_OK) continue; // Get the data BinStr id; id.resize(pTemplate.ulValueLen); pTemplate.pValue = &id[0]; if (g_state.p11->C_GetAttributeValue(context->p11_, hObj, &pTemplate, 1) != CKR_OK) continue; id.BinToHex(); id.push_back(0); context->containers_.insert(id); } } // Set it again in case of poor STL implementaion context->containerItr_ = context->containers_.begin(); } if (context->containerItr_ == context->containers_.end()) Throw(ERROR_NO_MORE_ITEMS); PutDataIntoBuffer(pbData, pcbDataLen, &(*context->containerItr_)[0], context->containerItr_->size()); if (pbData) context->containerItr_++; } /////////////////////////////////////////////////////////////////////////////// // Checks input and output settings and returns data and/or length // // Parameters: // dest - Destination buffer // destLen - Destination buffer size // source - Source buffer // sourceLen - Source buffer size // // Returns: // none - Throws exception on bad data /////////////////////////////////////////////////////////////////////////////// void PutDataIntoBuffer(LPBYTE dest, LPDWORD destLen, const LPBYTE source, DWORD sourceLen) { if (destLen == NULL) Throw(ERROR_MORE_DATA); else if (dest == NULL) *destLen = sourceLen; else if (*destLen < sourceLen) Throw(ERROR_MORE_DATA); else { memcpy(dest, source, sourceLen); *destLen = sourceLen; } } /////////////////////////////////////////////////////////////////////////////// // Reverses a BinStr // // Parameters: // buf - String to reverse // // Returns: // none /////////////////////////////////////////////////////////////////////////////// void Reverse(BinStr* buf) { Reverse(&(*buf)[0], buf->size()); } /////////////////////////////////////////////////////////////////////////////// // Reverses a BYTE string // // Parameters: // buf - String to reverse // len - Length of string // // Returns: // none /////////////////////////////////////////////////////////////////////////////// void Reverse(LPBYTE buf, size_t len) { size_t pos, maxPos = len / 2 - 1; for (pos = 0; pos <= maxPos; pos++) { char temp; temp = buf[pos]; buf[pos] = buf[len - 1 - pos]; buf[len - 1 - pos] = temp; } } /////////////////////////////////////////////////////////////////////////////// // If there are any logon certs this returns the last one. // If there are no logon certs then this just returns the last cert on the // card. // // Parameters: // context - CSP context // phCert - CK_OBJECT_HANDLE of found cert // container - Container name that cert exists in // // Returns: // FALSE on failure /////////////////////////////////////////////////////////////////////////////// bool FindDefaultCert(Session* context, CK_OBJECT_HANDLE* phCert, BinStr* container) { bool rv = true; *phCert = 0; CK_OBJECT_CLASS objClass = CKO_CERTIFICATE; CK_ATTRIBUTE attrib = { CKA_CLASS, &objClass, sizeof(objClass) }; // start object search for all certificates if (g_state.p11->C_FindObjectsInit(context->p11_, &attrib, 1) != CKR_OK) { LOG("C_FindObjectsInit failed\n"); return false; } try { bool haveLogonCert = false; // Set up the structure so we can get the cert's CKA_ID and CKA_VALUE CK_ATTRIBUTE attrib[] = { { CKA_ID, 0, 0 }, { CKA_VALUE, 0, 0 } }; // Loop through all certs CK_ULONG ulNumFound = 1; while (ulNumFound > 0) { CK_OBJECT_HANDLE hCert; if (g_state.p11->C_FindObjects(context->p11_, &hCert, 1, &ulNumFound) != CKR_OK) ThrowMsg(0, "C_FindObjects failed\n"); if (ulNumFound == 0) break; // First we want the CKA_ID and CKA_VALUE lengths attrib[0].pValue = 0; attrib[1].pValue = 0; if (g_state.p11->C_GetAttributeValue(context->p11_, hCert, attrib, sizeof(attrib)/sizeof(CK_ATTRIBUTE)) != CKR_OK) continue; BinStr ckaid(attrib[0].ulValueLen); attrib[0].pValue = &ckaid[0]; BinStr cert(attrib[1].ulValueLen); attrib[1].pValue = &cert[0]; // Get the CKA_ID and CKA_VALUE if (g_state.p11->C_GetAttributeValue(context->p11_, hCert, attrib, sizeof(attrib)/sizeof(CK_ATTRIBUTE)) != CKR_OK) continue; vector ext; GetExtKeyUsageFromCert(&ext, cert); DWORD i; for (i = 0; i < ext.size(); i++) { // Logon or enrollment agent if (ext[i] == "1.3.6.1.4.1.311.20.2.2" || ext[i] == "1.3.6.1.4.1.311.20.2.1") { haveLogonCert = true; container->swap(ckaid); *phCert = hCert; break; } } if (i >= ext.size() && !haveLogonCert) { container->swap(ckaid); *phCert = hCert; } } } catch (Error&) { *phCert = 0; } g_state.p11->C_FindObjectsFinal(context->p11_); if (*phCert) return true; else return false; } /////////////////////////////////////////////////////////////////////////////// // Finds last container name on card // // Parameters: // context - CSP context // phCert - CK_OBJECT_HANDLE of last obj // container - Container name of last container // // Returns: // FALSE on failure /////////////////////////////////////////////////////////////////////////////// bool FindLastContainer(Session* context, CK_OBJECT_HANDLE* phObj, BinStr* container) { bool rv = true; *phObj = 0; // start object search for all objects if (g_state.p11->C_FindObjectsInit(context->p11_, 0, 0) != CKR_OK) { LOG("C_FindObjectsInit failed\n"); return false; } try { CK_ATTRIBUTE attrib = { CKA_ID, 0, 0 }; CK_ULONG ulNumFound = 1; while (ulNumFound > 0) { CK_OBJECT_HANDLE hObj; if (g_state.p11->C_FindObjects(context->p11_, &hObj, 1, &ulNumFound) != CKR_OK) ThrowMsg(0, "C_FindObjects failed\n"); if (ulNumFound == 0) break; attrib.pValue = 0; if (g_state.p11->C_GetAttributeValue(context->p11_, hObj, &attrib, 1) != CKR_OK) continue; BinStr ckaid(attrib.ulValueLen); attrib.pValue = &ckaid[0]; if (g_state.p11->C_GetAttributeValue(context->p11_, hObj, &attrib, 1) != CKR_OK) continue; container->swap(ckaid); *phObj = hObj; } } catch (Error&) { *phObj = 0; } g_state.p11->C_FindObjectsFinal(context->p11_); if (*phObj) return true; else return false; } /////////////////////////////////////////////////////////////////////////////// // Finds a single object (first matching CKA_CLASS) in the current container // // Parameters: // context - CSP context // phCert - CK_OBJECT_HANDLE of found object // objClass - CKA_CLASS of object to find // // Returns: // FALSE on failure /////////////////////////////////////////////////////////////////////////////// bool FindObject(Session* context, CK_OBJECT_HANDLE* phObj, CK_OBJECT_CLASS objClass) { bool rv; CK_ATTRIBUTE search[] = { { CKA_ID, &context->CKAID_[0], context->CKAID_.size() }, { CKA_CLASS, &objClass, sizeof(objClass) } }; LOG("FindObject() CLA_CLASS:0x%X CKA_ID:%s \"%s\"\n", objClass, StringifyBin(context->CKAID_).c_str(), StringifyBin(context->CKAID_, false).c_str()); // start object search if (g_state.p11->C_FindObjectsInit(context->p11_, search, sizeof(search)/sizeof(CK_ATTRIBUTE)) != CKR_OK) { LOG("C_FindObjectsInit failed\n"); rv = false; } else { // do the search CK_ULONG ulNumFound = 0; CK_OBJECT_HANDLE hObj; if (g_state.p11->C_FindObjects(context->p11_, &hObj, 1, &ulNumFound) != CKR_OK) { LOG("C_FindObjects failed\n"); rv = false; } else if (ulNumFound < 1) rv = false; else { if (phObj) *phObj = hObj; rv = true; } g_state.p11->C_FindObjectsFinal(context->p11_); } LOG("FindObject returned: %s\n", rv ? "TRUE" : "FALSE"); return rv; } /////////////////////////////////////////////////////////////////////////////// // Returns length of a ASN.1 SEQUENCE-OF. Note that this function is extremely // dangerous. If non-ASN.1 encoded data is passed in then bad things could // happen. // // Parameters: // buf - BYTE buffer // withHeader - (default: true) Returns length with ASN.1 header length // included // // Returns: // length /////////////////////////////////////////////////////////////////////////////// CK_ULONG ASN1Len(const CK_BYTE* buf, bool withHeader) { // Make a very simplistic check for valid data since this // function is inherently dangerous if (buf[0] != 0x30) return 0; CK_ULONG used_length = 1; // Skip the tag CK_ULONG data_length = buf[used_length++];; if (data_length & 0x80) { CK_ULONG len_count = data_length & 0x7f; data_length = 0; while (len_count-- > 0) data_length = (data_length << 8) | buf[used_length++]; } if (withHeader) return data_length + used_length; else return data_length; } /////////////////////////////////////////////////////////////////////////////// // Returns the modulus and exponent in big-endian format // // Parameters: // context - CSP context // modulus - Output of modulus // exponent - Output of exponent // cert - Certificate to extract from (raw binary) // // Returns: // FALSE on failure /////////////////////////////////////////////////////////////////////////////// bool GetModulusFromCert(Session* context, BinStr* modulus, BinStr* exponent, const BinStr& cert) { bool rv = true; CRYPT_SEQUENCE_OF_ANY* modseq = 0; CRYPT_INTEGER_BLOB* mod = 0; PCCERT_CONTEXT certContext = 0; try { certContext = CertCreateCertificateContext(X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, &cert[0], cert.size()); if (certContext == 0) ThrowMsg(0, "CertCreateCertificateContext failed"); HCRYPTKEY hKey; if (!CryptImportPublicKeyInfo(context->cryptProv_, X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, &certContext->pCertInfo->SubjectPublicKeyInfo, &hKey)) Throw(0); DWORD dwDataLen; if (!CryptExportKey(hKey, 0, PUBLICKEYBLOB, 0, 0, &dwDataLen)) Throw(0); BinStr blob(dwDataLen); if (!CryptExportKey(hKey, 0, PUBLICKEYBLOB, 0, &blob[0], &dwDataLen)) Throw(0); BLOBHEADER* header = (BLOBHEADER*)&blob[0]; RSAPUBKEY* rsakey = (RSAPUBKEY*)&blob[sizeof(BLOBHEADER)]; modulus->resize(rsakey->bitlen/8); exponent->resize(sizeof(rsakey->pubexp)); memcpy(&(*modulus)[0], &blob[sizeof(BLOBHEADER)+sizeof(RSAPUBKEY)], rsakey->bitlen/8); memcpy(&(*exponent)[0], &rsakey->pubexp, sizeof(rsakey->pubexp)); while (exponent->back() == 0x00) exponent->pop_back(); Reverse(modulus); Reverse(exponent); } catch (Error&) { rv = false; } if (certContext) CertFreeCertificateContext(certContext); if (modseq) LocalFree(modseq); if (mod) LocalFree(mod); return rv; } /////////////////////////////////////////////////////////////////////////////// // Fills an array with the extended key usage OID's // // Parameters: // ext - Array of returned strings // cert - Certificate data (raw binary) // // Returns: // FALSE on failure /////////////////////////////////////////////////////////////////////////////// bool GetExtKeyUsageFromCert(vector* ext, const BinStr& cert) { bool rv = true; CRYPT_SEQUENCE_OF_ANY* extusage = 0; PCCERT_CONTEXT certContext = 0; try { certContext = CertCreateCertificateContext(X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, &cert[0], cert.size()); if (certContext == 0) ThrowMsg(0, "CertCreateCertificateContext failed"); CERT_ENHKEY_USAGE* usage; DWORD usageSize; if (!CertGetEnhancedKeyUsage(certContext, 0, 0, &usageSize)) Throw(0); usage = (CERT_ENHKEY_USAGE*)new char[usageSize]; if (!CertGetEnhancedKeyUsage(certContext, 0, usage, &usageSize)) Throw(0); ext->resize(usage->cUsageIdentifier); for (DWORD i = 0; i < usage->cUsageIdentifier; i++) (*ext)[i] = usage->rgpszUsageIdentifier[i]; } catch (Error&) { rv = false; } if (certContext) CertFreeCertificateContext(certContext); if (extusage) LocalFree(extusage); return rv; } string GetCurrentExecutable() { TCHAR szModulePath[MAX_PATH]; if (GetModuleFileName(0, szModulePath, sizeof(szModulePath) / sizeof(TCHAR)) == 0) return ""; else return string(szModulePath); } string GetCurrentDLL() { TCHAR szModulePath[MAX_PATH]; if (GetModuleFileName(g_hModule, szModulePath, sizeof(szModulePath) / sizeof(TCHAR)) == 0) return ""; else return string(szModulePath); } } // namespace MCSP // Microsoft helpers for handling session keys namespace CryptoHelper { BOOL CreatePrivateExponentOneKey(HCRYPTPROV hProv, DWORD dwKeySpec, HCRYPTKEY *hPrivateKey) { BOOL fReturn = FALSE; BOOL fResult; DWORD n; LPBYTE keyblob = NULL; DWORD dwkeyblob; DWORD dwBitLen; BYTE *ptr; __try { *hPrivateKey = 0; if ((dwKeySpec != AT_KEYEXCHANGE) && (dwKeySpec != AT_SIGNATURE)) __leave; // Generate the private key fResult = CryptGenKey(hProv, dwKeySpec, CRYPT_EXPORTABLE, hPrivateKey); if (!fResult) __leave; // Export the private key, we'll convert it to a private // exponent of one key fResult = CryptExportKey(*hPrivateKey, 0, PRIVATEKEYBLOB, 0, NULL, &dwkeyblob); if (!fResult) __leave; keyblob = (LPBYTE)LocalAlloc(LPTR, dwkeyblob); if (!keyblob) __leave; fResult = CryptExportKey(*hPrivateKey, 0, PRIVATEKEYBLOB, 0, keyblob, &dwkeyblob); if (!fResult) __leave; CryptDestroyKey(*hPrivateKey); *hPrivateKey = 0; // Get the bit length of the key memcpy(&dwBitLen, &keyblob[12], 4); // Modify the Exponent in Key BLOB format // Key BLOB format is documented in SDK // Convert pubexp in rsapubkey to 1 ptr = &keyblob[16]; for (n = 0; n < 4; n++) { if (n == 0) ptr[n] = 1; else ptr[n] = 0; } // Skip pubexp ptr += 4; // Skip modulus, prime1, prime2 ptr += (dwBitLen/8); ptr += (dwBitLen/16); ptr += (dwBitLen/16); // Convert exponent1 to 1 for (n = 0; n < (dwBitLen/16); n++) { if (n == 0) ptr[n] = 1; else ptr[n] = 0; } // Skip exponent1 ptr += (dwBitLen/16); // Convert exponent2 to 1 for (n = 0; n < (dwBitLen/16); n++) { if (n == 0) ptr[n] = 1; else ptr[n] = 0; } // Skip exponent2, coefficient ptr += (dwBitLen/16); ptr += (dwBitLen/16); // Convert privateExponent to 1 for (n = 0; n < (dwBitLen/8); n++) { if (n == 0) ptr[n] = 1; else ptr[n] = 0; } // Import the exponent-of-one private key. if (!CryptImportKey(hProv, keyblob, dwkeyblob, 0, 0, hPrivateKey)) { __leave; } fReturn = TRUE; } __finally { if (keyblob) LocalFree(keyblob); if (!fReturn) { if (*hPrivateKey) CryptDestroyKey(*hPrivateKey); } } return fReturn; } BOOL ExportPlainSessionBlob(HCRYPTKEY hPublicKey, HCRYPTKEY hSessionKey, LPBYTE *pbKeyMaterial , DWORD *dwKeyMaterial ) { BOOL fReturn = FALSE; BOOL fResult; DWORD dwSize, n; LPBYTE pbSessionBlob = NULL; DWORD dwSessionBlob; LPBYTE pbPtr; __try { *pbKeyMaterial = NULL; *dwKeyMaterial = 0; fResult = CryptExportKey(hSessionKey, hPublicKey, SIMPLEBLOB, 0, NULL, &dwSessionBlob ); if (!fResult) __leave; pbSessionBlob = (LPBYTE)LocalAlloc(LPTR, dwSessionBlob ); if (!pbSessionBlob) __leave; fResult = CryptExportKey(hSessionKey, hPublicKey, SIMPLEBLOB, 0, pbSessionBlob , &dwSessionBlob ); if (!fResult) __leave; // Get session key size in bits dwSize = sizeof(DWORD); fResult = CryptGetKeyParam(hSessionKey, KP_KEYLEN, (LPBYTE)dwKeyMaterial, &dwSize, 0); if (!fResult) __leave; // Get the number of bytes and allocate buffer *dwKeyMaterial /= 8; *pbKeyMaterial = (LPBYTE)LocalAlloc(LPTR, *dwKeyMaterial); if (!*pbKeyMaterial) __leave; // Skip the header pbPtr = pbSessionBlob; pbPtr += sizeof(BLOBHEADER); pbPtr += sizeof(ALG_ID); // We are at the beginning of the key // but we need to start at the end since // it's reversed pbPtr += (*dwKeyMaterial - 1); // Copy the raw key into our return buffer for (n = 0; n < *dwKeyMaterial; n++) { (*pbKeyMaterial)[n] = *pbPtr; pbPtr--; } fReturn = TRUE; } __finally { if (pbSessionBlob) LocalFree(pbSessionBlob); if ((!fReturn) && (*pbKeyMaterial )) { LocalFree(*pbKeyMaterial ); *pbKeyMaterial = NULL; *dwKeyMaterial = 0; } } return fReturn; } BOOL ImportPlainSessionBlob(HCRYPTPROV hProv, HCRYPTKEY hPrivateKey, ALG_ID dwAlgId, LPBYTE pbKeyMaterial , DWORD dwKeyMaterial , HCRYPTKEY *hSessionKey) { BOOL fResult; BOOL fReturn = FALSE; BOOL fFound = FALSE; LPBYTE pbSessionBlob = NULL; DWORD dwSessionBlob, dwSize, n; DWORD dwPublicKeySize; DWORD dwProvSessionKeySize; ALG_ID dwPrivKeyAlg; LPBYTE pbPtr; DWORD dwFlags = CRYPT_FIRST; PROV_ENUMALGS_EX ProvEnum; HCRYPTKEY hTempKey = 0; __try { // Double check to see if this provider supports this algorithm // and key size do { dwSize = sizeof(ProvEnum); fResult = CryptGetProvParam(hProv, PP_ENUMALGS_EX, (LPBYTE)&ProvEnum, &dwSize, dwFlags); if (!fResult) break; dwFlags = 0; if (ProvEnum.aiAlgid == dwAlgId) fFound = TRUE; } while (!fFound); if (!fFound) __leave; // We have to get the key size(including padding) // from an HCRYPTKEY handle. PP_ENUMALGS_EX contains // the key size without the padding so we can't use it. fResult = CryptGenKey(hProv, dwAlgId, 0, &hTempKey); if (!fResult) __leave; dwSize = sizeof(DWORD); fResult = CryptGetKeyParam(hTempKey, KP_KEYLEN, (LPBYTE)&dwProvSessionKeySize, &dwSize, 0); if (!fResult) __leave; CryptDestroyKey(hTempKey); hTempKey = 0; // Our key is too big, leave if ((dwKeyMaterial * 8) > dwProvSessionKeySize) __leave; // Get private key's algorithm dwSize = sizeof(ALG_ID); fResult = CryptGetKeyParam(hPrivateKey, KP_ALGID, (LPBYTE)&dwPrivKeyAlg, &dwSize, 0); if (!fResult) __leave; // Get private key's length in bits dwSize = sizeof(DWORD); fResult = CryptGetKeyParam(hPrivateKey, KP_KEYLEN, (LPBYTE)&dwPublicKeySize, &dwSize, 0); if (!fResult) __leave; // calculate Simple blob's length dwSessionBlob = (dwPublicKeySize/8) + sizeof(ALG_ID) + sizeof(BLOBHEADER); // allocate simple blob buffer pbSessionBlob = (LPBYTE)LocalAlloc(LPTR, dwSessionBlob); if (!pbSessionBlob) __leave; pbPtr = pbSessionBlob; // SIMPLEBLOB Format is documented in SDK // Copy header to buffer ((BLOBHEADER *)pbPtr)->bType = SIMPLEBLOB; ((BLOBHEADER *)pbPtr)->bVersion = 2; ((BLOBHEADER *)pbPtr)->reserved = 0; ((BLOBHEADER *)pbPtr)->aiKeyAlg = dwAlgId; pbPtr += sizeof(BLOBHEADER); // Copy private key algorithm to buffer *((DWORD *)pbPtr) = dwPrivKeyAlg; pbPtr += sizeof(ALG_ID); // Place the key material in reverse order for (n = 0; n < dwKeyMaterial; n++) { pbPtr[n] = pbKeyMaterial[dwKeyMaterial-n-1]; } // 3 is for the first reserved byte after the key material + the 2 reserved bytes at the end. dwSize = dwSessionBlob - (sizeof(ALG_ID) + sizeof(BLOBHEADER) + dwKeyMaterial + 3); pbPtr += (dwKeyMaterial+1); // Generate random data for the rest of the buffer // (except that last two bytes) fResult = CryptGenRandom(hProv, dwSize, pbPtr); if (!fResult) __leave; for (n = 0; n < dwSize; n++) { if (pbPtr[n] == 0) pbPtr[n] = 1; } pbSessionBlob[dwSessionBlob - 2] = 2; fResult = CryptImportKey(hProv, pbSessionBlob , dwSessionBlob, hPrivateKey, CRYPT_EXPORTABLE, hSessionKey); if (!fResult) __leave; fReturn = TRUE; } __finally { if (hTempKey) CryptDestroyKey(hTempKey); if (pbSessionBlob) LocalFree(pbSessionBlob); } return fReturn; } } // namespace CryptoHelper --- NEW FILE gui.cpp --- /** BEGIN COPYRIGHT BLOCK * This Program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; version 2 of the License. * * This Program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place, Suite 330, Boston, MA 02111-1307 USA. * * Copyright (C) 2003-2004 Identity Alliance * All rights reserved. * END COPYRIGHT BLOCK **/ /***************************************************************** / / File : gui.cpp / Date : December 3, 2002 / Purpose: Crypto API CSP->PKCS#11 Module / License: Copyright (C) 2003-2004 Identity Alliance / ******************************************************************/ #include "resource.h" #include "csp.h" #include using namespace std; namespace MCSP { static BOOL DoInitDialog(HWND hDlg, LPARAM lParam) { RECT rect; int width, height; int screen_x, screen_y; int x, y; GetWindowRect(hDlg, &rect); width = rect.right - rect.left; height = rect.bottom - rect.top; screen_x = GetSystemMetrics(SM_CXSCREEN); screen_y = GetSystemMetrics(SM_CYSCREEN); x = screen_x/2 - width/2; y = screen_y/2 - height/2; SetWindowPos(hDlg, HWND_TOPMOST, x, y, width, height, SWP_NOSIZE); SetFocus(GetDlgItem(hDlg, IDC_PIN_EDIT)); if (lParam == 0) { SetLastError(ERROR_INVALID_BLOCK); EndDialog(hDlg, 0); return TRUE; } // FIXME: Why does lParam need to be type-cast to LONG? // The parameter is suppose to be LONG_PTR (LPARAM) SetWindowLongPtr(hDlg, GWLP_USERDATA, static_cast(lParam)); EnableWindow(GetDlgItem(hDlg, IDOK), FALSE); return FALSE; } static BOOL DoPINChanged(HWND hDlg) { HWND pinCtrl; BOOL enable = TRUE; pinCtrl = GetDlgItem(hDlg, IDC_PIN_EDIT); int len = GetWindowTextLength(pinCtrl); if (len == 0) enable = FALSE; EnableWindow(GetDlgItem(hDlg, IDOK), enable); return TRUE; } static BOOL DoPIN(HWND hDlg, WPARAM wParam) { switch(HIWORD(wParam)) { case EN_UPDATE: return DoPINChanged(hDlg); break; default: break; } return TRUE; } static void OnOK(HWND hDlg, LPARAM lParam) { BinStr* s = reinterpret_cast((LPARAM)GetWindowLongPtr(hDlg, GWLP_USERDATA)); if (!s) return; HWND pinCtrl = GetDlgItem(hDlg, IDC_PIN_EDIT); int len = GetWindowTextLength(pinCtrl); s->resize(len + 1); GetWindowText(pinCtrl, reinterpret_cast(&(*s)[0]), static_cast(s->size())); // Chop off null cause we don't need it s->resize(s->size() - 1); EndDialog(hDlg, IDOK); } static BOOL DoCommand(HWND hDlg, WPARAM wParam, LPARAM lParam) { switch(LOWORD(wParam)) { case IDCANCEL: EndDialog(hDlg, IDCANCEL); break; case IDOK: OnOK(hDlg, lParam); break; case IDC_PIN_EDIT: return DoPIN(hDlg, wParam); break; default: break; } return TRUE; } static INT_PTR CALLBACK PINDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { case WM_COMMAND: return DoCommand(hDlg, wParam, lParam); break; case WM_INITDIALOG: return DoInitDialog(hDlg, lParam); break; default: break; } return FALSE; } // asks the user for a pin bool DisplayPINDialog(BinStr* pin) { INT_PTR result; result = DialogBoxParam(g_hModule, MAKEINTRESOURCE(IDD_PIN_DIALOG), NULL, PINDialogProc, reinterpret_cast(pin)); switch(result) { case 0: return false; break; case IDCANCEL: return false; break; case IDOK: if (pin->empty()) return false; else return true; break; default: break; } return false; } // for debugging void DisplayError(const Session* context, const string& str) { if (!context->silent_) MessageBox(NULL, str.c_str(), PROVIDER_NAME" Error", MB_OK | MB_ICONERROR | MB_TASKMODAL); LOG("ERROR: \"%s\"\n", str.c_str()); } // for debugging void DisplayWin32Error(const Session* context) { LPVOID lpMsgBuf; FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language (LPTSTR) &lpMsgBuf, 0, NULL ); // Display the string if (!context->silent_) MessageBox(NULL, (LPCSTR)lpMsgBuf, PROVIDER_NAME" Win32 Error", MB_OK | MB_ICONERROR | MB_TASKMODAL); LOG("WIN32 error: \"%s\"\n", lpMsgBuf); // Free the buffer. LocalFree( lpMsgBuf ); } } // namespace MCSP --- NEW FILE resource.h --- //{{NO_DEPENDENCIES}} // Microsoft Visual C++ generated include file. // Used by csp.rc // #define IDD_PIN_DIALOG 101 #define IDB_PIN_LOGO 104 #define CRYPT_SIG_RESOURCE_NUMBER 0x29A #define IDC_PIN_EDIT 1001 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 107 #define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_CONTROL_VALUE 1002 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif --- NEW FILE uuid.cpp --- /** BEGIN COPYRIGHT BLOCK * This Program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; version 2 of the License. * * This Program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place, Suite 330, Boston, MA 02111-1307 USA. * * Copyright (C) 2003-2004 Identity Alliance * All rights reserved. * END COPYRIGHT BLOCK **/ /***************************************************************** / / File : uuid.cpp / Date : December 3, 2002 / Purpose: Crypto API CSP->PKCS#11 Module / License: Copyright (C) 2003-2004 Identity Alliance / ******************************************************************/ #include #include #include "BinStr.h" namespace MCSP { bool GenUUID(BinStr* uuid) { uuid->clear(); unsigned char* strId; UUID id; UuidCreate(&id); if (UuidToString(&id, &strId) == RPC_S_OK) { uuid->resize(strlen((char*)strId)); memcpy(&(*uuid)[0], strId, strlen((char*)strId)); RpcStringFree(&strId); return true; } else return false; } } // namespace MCSP From fedora-directory-commits at redhat.com Sat Jul 29 00:42:47 2006 From: fedora-directory-commits at redhat.com (Steven W Parkinson (sparkins)) Date: Fri, 28 Jul 2006 17:42:47 -0700 Subject: [Fedora-directory-commits] windowsautoenroll - Imported sources Message-ID: <200607290042.k6T0glsW031652@cvs-int.fedora.redhat.com> Author: sparkins Update of /cvs/dirsec/windowsautoenroll In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv31633 Log Message: support for microsoft autoenrollment protocol Status: Vendor Tag: redhat Release Tags: start N windowsautoenroll/README.txt N windowsautoenroll/submitrequest/submitrequest.cpp N windowsautoenroll/proxy/proxy.cpp N windowsautoenroll/proxy/submit.cpp N windowsautoenroll/panel/ProxyPanel.cs No conflicts created by this import