struct rx_service *tservice;
struct rx_securityClass **securityClasses;
afs_int32 numClasses;
- int kerberosKeys; /* set if found some keys */
int lwps = 3;
char clones[MAXHOSTSPERCELL];
afs_uint32 host = htonl(INADDR_ANY);
pr_realmName = info.name;
{
- afs_int32 kvno; /* see if there is a KeyFile here */
- struct ktc_encryptionKey key;
- code = afsconf_GetLatestKey(prdir, &kvno, &key);
- kerberosKeys = (code == 0);
- if (!kerberosKeys)
- printf
- ("ptserver: can't find any Kerberos keys, code = %d, ignoring\n",
- code);
- }
- if (kerberosKeys) {
/* initialize ubik */
ubik_CRXSecurityProc = afsconf_ClientAuth;
ubik_CRXSecurityRock = prdir;
* to force use of the KeyFile. secLevel == 0 implies -noauth was
* specified. */
if (secLevel == 2) {
- code = afsconf_GetLatestKey(tdir, 0, 0);
+ secFlags = AFSCONF_SECOPTS_LOCALAUTH;
+ secFlags |= AFSCONF_SECOPTS_ALWAYSENCRYPT;
+ code = afsconf_PickClientSecObj(tdir, secFlags, &info, cell, &sc, &scIndex, NULL);
if (code) {
afs_com_err(whoami, code, "(getting key from local KeyFile)\n");
- } else {
- /* If secLevel is two assume we're on a file server and use
- * ClientAuthSecure if possible. */
- code = afsconf_ClientAuthSecure(tdir, &sc, &scIndex);
- if (code)
- afs_com_err(whoami, code, "(calling client secure)\n");
}
+
} else if (secLevel > 0) {
secFlags = 0;
if (secLevel > 1)
/* Most callers use secLevel==1, however, the fileserver uses secLevel==2
* to force use of the KeyFile. secLevel == 0 implies -noauth was
* specified. */
- if ((afsconf_GetLatestKey(tdir, 0, 0) == 0)) {
- code = afsconf_ClientAuthSecure(tdir, &sc, &scIndex);
- if (code)
- ViceLog(0, ("hpr_Initialize: clientauthsecure returns %d %s (so trying noauth)", code, afs_error_message(code)));
- if (code)
- scIndex = RX_SECIDX_NULL;
- } else {
- afsconf_ClientAuthToken(&info, 0, &sc, &scIndex, NULL);
- }
+ code = afsconf_ClientAuthSecure(tdir, &sc, &scIndex);
+ if (code)
+ ViceLog(0, ("hpr_Initialize: clientauthsecure returns %d %s (so trying noauth)", code, afs_error_message(code)));
+ if (code)
+ scIndex = RX_SECIDX_NULL;
+
if ((scIndex == RX_SECIDX_NULL) && (sc == NULL))
sc = rxnull_NewClientSecurityObject();
if (scIndex == RX_SECIDX_NULL)